1

I have spent over a day trying to get a multisite install to work and I think most of it is in place but I still cannot see the install.php when I visit www.mywebsite.co.uk/install.php?

I have a dedicated server running ubuntu, apache2 and latest mysql and php 5.

I have installed the latest Drupal codebase into

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

I have have setup drupal database (called drupal) to and configured the codebase and all is working great and can view the drupal installation no problem on www.myserver.co.uk/drupal.

I next followed the instructions at: http://gotdrupal.com/videos/multisites-vs-multiple-sites and have setup up my apache conf almost exactly as described:

These are the contents of my various conf files:

/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

The website root I have created is at:

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

I have replaced the physical public_html directory with a symlink to

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

I can view the text files such as www.mysite.co.uk/INSTALL.txt but when I try to view any php page (such as install.php or the root) I always get the following error: "Internal Server Error, this is an error with your script, check your error log for more information."

I am at a loss as to what I need to do next and would appreciate any help or advice.

Thank you

belliez
  • 175
  • 2
  • 10

2 Answers2

4

The config you have posted is vastly more complicated than it needs to be. I'm not quite sure why it's set up that way, but I did notice a few things that might make a difference.

First and foremost, in drupal6.conf all you should need is the following:

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

The rest of the stuff is secondary and may be complicating (or causing) the problem. I'd recommend - especially for the initial install - to simplify the configs as much as possible. I run a lot of Drupal sites and I never mess with anything beyond pointing the mysite.conf to the Drupal directory and creating the (Drupal root)/sites/my.site.com directory and settings files.

I'd recommend ripping all the other stuff out of the drupal6.conf and seeing if it works for the install. Then add back in the access blocks on the /admin, install.php, etc. I don't recommend messing with the .htaccess files in the config file. Leave out the line including the .htaccess in the apache configs and just let .htaccess be picked up as it's designed to by apache.

Greg
  • 56
  • 2
0

Just out of curiosity, have you got php enabled and an appropriate AddHandler line somewhere? It looks a bit like it's trying to run the php files as cgi scripts directly rather than using the module. On Ubuntu and Debian you can make sure php is loaded as a module with the following:

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

If php works elsewhere in your setup, I'd also be inclined to check the .htaccess file. Specifically, you'll want to make sure it isn't trying to set .php files to be run as cgi scripts explicitly. If you find anything like the following line referring to .php files, comment them out and see if things improve.

AddHandler cgi-script .php

As you've explicitly loaded the .htaccess file, don't forget to reload as appropriate.

Frenchie
  • 1,282
  • 9
  • 14
  • When I run "a2enmod php5" in shell I get a message saying this module does not exist? – belliez Jul 28 '09 at 10:23
  • I performed a atp-get on php5, php5-dev, apache-dev yesterday in order to get the php APC module. – belliez Jul 28 '09 at 10:24
  • 1
    I do however have php based websites also running from this server without a problem (and I have configured the drupal codebase I installed and have it running) – belliez Jul 28 '09 at 10:25
  • On further examination, it seems that it may be finding your .htaccess and throwing a 500 Error because you have AllowOverride None set. As a test move .htaccess to htaccess and update your apache config appropriately, then reload and see if things improve. Also if you could post anything relevant from the error log that'd be good too. – Frenchie Jul 28 '09 at 11:30
  • Specifically the fact that drupal includes 'Option' Directives in that file. – Frenchie Jul 28 '09 at 11:31
  • when I move the .htaccess and restart apache I get an error saying .htaccess cannot be found (it is included from drupal6.conf). I updated apache2.conf to reflect the moved htaccess and got the following error: Syntax error on line 134 of /etc/apache2/apache2.conf: Syntax error on line 22 of /etc/apache2/conf.d/drupal6.conf: Could not open configuration file /home/d/r/drupal/web/public_html/.htaccess: No such file or directory – belliez Jul 28 '09 at 11:41
  • Apologies, I should've been more specific, you should update drupal6.conf to reflect that /home/d/r/drupal/web/public_html/.htaccess has been moved to /home/d/r/drupal/web/public_html/htaccess – Frenchie Jul 28 '09 at 11:47
  • Ok, I did just that and apache restarted ok with no problems. Checked www.mysite.co.uk and still got server not found. Checked www.mysite.co.uk/install.php and got "server not found". Checked www.mysite.co.uk/INSTALL.txt and got the drupal installation instructions. – belliez Jul 28 '09 at 11:56
  • Just another quick check, your hosts listed only have 127.0.0.1 mysite.co.uk listed. Is what resolves when you host www.mysite.co.uk what you expect? – Frenchie Jul 28 '09 at 13:00
  • I must admit, I am not sure why I added it to the etc/hosts because I was following instructions from drupal website. I'm not a linux guru and still finding my way around! I will try removing that line from my hosts and restart apache2. – belliez Jul 28 '09 at 13:07
  • my hosts file also has my server name and ip, I omitted that. – belliez Jul 28 '09 at 13:12
  • At this point I'm at a loss, at the very least it's not generating a 500 error which is a step in the right direction, ammending my post to reflect what was causing htat. – Frenchie Jul 28 '09 at 13:35
  • I have just removed my website hosting for www.mysite.co.uk from my control panel (webfusion) then re-created it again and now I get server not found? I also played with symlinks replacing my public_html with a symlink to /drupal codebase. If I use virtualhost do I also need symlinks? – belliez Jul 28 '09 at 13:40
  • I appreciate you help. Thank you. I will keep bashing at it until something works! – belliez Jul 28 '09 at 13:44