Normally when adding a new Drupal site I just put the sites root folder in /var/www/ and then edit the hosts file for that address and then edit the httpd.conf file to point to that site.

The situation here is the Drupal site I am working on came from a git repo where other people work on it as well. The site came like this - /sitename/web/sites/default so when I put that in my /var/www directory it isn't the same as a usual setup which is - /sitename/sites/default, multipleSite1, multipleSite2, ...

So the /web directory is throwing things off I think. It messes with the simple way I point to a site with http.d conf and the way Drupal looks inside that directory for the settings.php file.

Simple example of httpd.conf that normally works fine

<VirtualHost *:80>
     DocumentRoot /var/www/testsite
     ServerName testsite

Any ideas? I'm sure it's a real simple solution.

-apache2 on ubuntu10.04

  • This question doesn't seem specific to Drupal. – kiamlaluno Jun 6 '11 at 19:44
  • It has to do with where Drupal looks for the settings.php file. If the path to that file changes then Drupal relies on Apache to tell it where to look. How can I tell Drupal where to look for it? – winchendonsprings Jun 6 '11 at 19:51
  • If you install Drupal on /Volumes/HDA/Library/Webserver/Documents/dr71, then it will look for the settings.php file in /Volumes/HDA/Library/Webserver/Documents/dr71/sites/default/settings.php. – kiamlaluno Jun 6 '11 at 19:55
  • I install all my sites to /var/www/ – winchendonsprings Jun 6 '11 at 20:18
  • Make sure the user www-data have read acces to this folder. – tostinni Jun 7 '11 at 1:10

If I have an unusual directory structure I tend to use symlinks to get the folders into the correct place on the system.

If your site is running a standard drupal install you could install that to /var/www as normal

and create a link to your directory

ls -s /path/to/my/default/dir /var/www/default
| improve this answer | |
  • combine this with the correct permissions @tostinni mentioned above and it's good to go. Thanks – winchendonsprings Jun 25 '12 at 22:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.