drupal多站点的apacheconfiguration

我花了一天的时间试图让一个多站点的安装工作,我想大部分是在位,但我仍然无法看到install.php当我访问www.mywebsite.co.uk/install.php?

我有一个专用的服务器运行ubuntu,apache2和最新的MySQL和PHP 5。

我已经安装了最新的Drupal代码库

/home/d/r/drupal/web/public_html 

我已经设置了drupal数据库(称为drupal)来configuration代码库,所有工作都很好,可以在www.myserver.co.uk/drupal上查看drupal安装没有问题。

接下来我按照http://gotdrupal.com/videos/multisites-vs-multiple-sites上的说明进行操作,并且已经按照所描述的完成了我的apache conf:

这些是我的各种conf文件的内容:

/etc/apache2/conf.d/drupal6.conf:

 #============================================================ # Toggle APC cache #php_flag apc.cache_by_default 1 #This is already enabled in php <Directory "/home/d/r/drupal/web/public_html"> # Yeah, better performance - no hits to the file system # Loading Drupal's .htaccess into memory is much better AllowOverride none # Define your own file limitations on drupal files <FilesMatch "(install.php|cron.php|update.php|\.txt)$"> Order deny,allow # Include conf.d/ip.conf # including the line above always caused an error when re-starting apache2 so I have hard coded the IPs below (these are not the ones I am usinb obviously!) Allow from 123.123.123.123 Allow from 124.124.124.124 Deny from all </FilesMatch> # Read in Drupal default .htaccess file asif conf - easier CVS management Include /home/d/r/drupal/web/public_html/.htaccess # Offline mode for multisite setup - see file for more info # Uncomment the line below to set sites offline # Include conf.d/offline.conf </Directory> # Sorry, no svn peeking <DirectoryMatch "\.svn"> # Currently pointing back to drupal # High traffic sites might want custom # error pages, no need to load drupal ErrorDocument 403 /index.php Order allow,deny Deny from all Satisfy All </DirectoryMatch> # Allow the .htacces files to be used in the sites folder where /files are stored <Directory "/home/d/r/drupal/web/public_html/sites"> AllowOverride </Directory> # Block off access to admin and devel - just in case <LocationMatch "/(admin|devel)"> Order deny,allow # Include conf.d/ip.conf # including the line above always caused an error when re-starting apache2 so I have hard coded the IPs below (these are not the ones I am usinb obviously!) Allow from 123.123.123.123 Allow from 124.124.124.124 Deny from all </LocationMatch> #============================================================ 

/etc/apache2/conf.d/ip.conf:

 #============================================================ #This file always caused a problem when repstarting apache so I hard coded the IP addresses # into the drupal6.conf file. Would like to undersatand why this wont work! I am using the correct IP addresses, these are just for posting! Allow from 123.123.123.123 Allow from 124.124.124.124 #============================================================ 

/etc/apache2/apache2.conf中:

 #============================================================ # .. # .. # All the apache config and at the very bottom is these lines: # Include the virtual host configurations: Include /etc/apache2/sites-enabled/[^.#]* #============================================================ 

/etc/apache2/sites-available/drupalsites.conf:

 #============================================================ # This is called from Apache2.conf # Each vhost can be read in as its own file Include vhosts/mywebsite.conf #============================================================ 

/etc/apache2/vhosts/mywebsite.conf:

 #============================================================ # This is called from /etc/apache2/sites-available/drupalsites.conf <VirtualHost mywebsite.co.uk:80> DocumentRoot /home/d/r/drupal/web/public_html ServerName mywebsiteco.uk ServerAlias www.mywebsiteco.uk ErrorLog /var/log/apache2/sites/mywebsite.co.uk_error-log CustomLog /var/log/apache2/sites/mywebsite.co.uk_access-log "combined" # Rewrite the www RewriteEngine on RewriteCond %{HTTP_HOST} ^www\.mywebsite\.co.uk/?$ [NC] RewriteRule ^(.*)$ http://mywebsite.co.uk$1 [L,R=301] # Read in the drupal configuration Include conf.d/drupal6.conf # Block access while developing # Include conf.d/beta.conf </VirtualHost> #============================================================ 

/ etc / hosts中:

 127.0.0.1 localhost server0 127.0.0.1 mywebsite.co.uk 123.123.123.123 myservername.co.uk 

我创build的网站的根目录是:

 /home/m/y/mysite/web/public_html 

我用一个符号链接replace了物理的public_html目录

 /home/d/r/drupal/web/public_html 

我可以查看文本文件,如www.mysite.co.uk/INSTALL.txt,但是当我尝试查看任何PHP页面(如install.php或根),我总是得到以下错误:“内部服务器错误,这是你的脚本错误,请查看错误日志以获取更多信息。“

我对我接下来要做的事情感到不知所措,并希望得到任何帮助或build议。

谢谢

你发布的configuration比它需要的复杂得多。 我不太清楚为什么这样设置,但是我注意到了一些可能有所作为的事情。

首先,在drupal6.conf中,您应该只需要以下内容:

 <Directory /home/d/r/drupal/web/public_html/> Options +FollowSymLinks AllowOverride All order allow,deny allow from all </Directory> 

其余的东西是次要的,可能会使问题复杂化(或导致)。 我build议 – 尤其是初次安装 – 尽可能简化configuration。 我运行了很多 Drupal站点,除了将mysite.conf指向Drupal目录并创build(Drupal根目录)/sites/my.site.com目录和设置文件外,

我build议从drupal6.conf中翻译所有其他的东西,看看它是否适用于安装。 然后join/ admin,install.php等访问块。我不build议搞乱configuration文件中的.htaccess文件。 在apache configs中不要包含.htaccess这一行,而只是让.htaccess被apachedevise。

只是出于好奇,你有PHP启用和适当的AddHandler行的地方? 它看起来有点像它试图直接运行PHP文件作为CGI脚本,而不是使用模块。 在Ubuntu和Debian上,你可以确保php被加载为以下模块:

 a2enmod php5 /etc/init.d/apache2 force-reload 

如果PHP在你的设置中的其他地方工作,我也倾向于检查.htaccess文件。 具体来说,你要确保它不是试图设置.php文件作为CGI脚本显式运行。 如果您发现任何类似于下面的引用.php文件的行,请将其注释掉,看看是否有所改进。

 AddHandler cgi-script .php 

正如你已经明确加载.htaccess文件,不要忘记重新加载适当的。