Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have a virtual host set up on my Ubuntu server:

<VirtualHost *:80>
     ServerAdmin email@gmail.com
     ServerName dailysongfix.com
     ServerAlias www.dailysongfix.com

     DirectoryIndex index.php index.html
     DocumentRoot /var/www/dailysongfix/public

     # Custom log file locations
     LogLevel warn

     ErrorLog /var/log/apache2/dailysongfix/error_log
     CustomLog /var/log/apache2/dailysongfix/access_log combined
</VirtualHost>

If I go to http : dailysongfix . com I get a forbidden error. This is probably an issue with my directory permissions...so I went over to /var/www

Here are my permissions:

ls -al /var
drwxr-xr-x  3 root root  4096 May 26 22:47 www

ls -al /var/www/
drwxr-xr-x  3 root root     4096 May 26 22:47 .
drwxr-xr-x 14 root root     4096 May 26 22:46 ..
drwxr-xr-x  3 root www-data 4096 May 26 22:53 dailysongfix

ls -al /var/www/dailysongfix/
drwxr-xr-x 3 root www-data 4096 May 26 22:53 .
drwxr-xr-x 3 root root     4096 May 26 22:47 ..
drwxr-sr-x 2 root www-data 4096 May 26 22:59 public

I also have this in my httpd.conf

User www-data
Group www-data

Does anyone know how to fix this?

Thanks!

share|improve this question

2 Answers 2

up vote 0 down vote accepted

Looks like I needed to change the Directory permissions:

<Directory "/var/www/dailysongfix/public">
         Options Indexes FollowSymLinks
         AllowOverride None
         Order allow,deny
         Allow from all
     </Directory>
share|improve this answer

You also might want to "chgrp" from "root" to "www-data" to be sure that any file upload scripts located in the public directory are able to properly save files to that directory.

There should be no reason for "root" to be the owner group for "public" that I can see.

share|improve this answer
    
should all of my html/php files have the group www-data? for example, when I install wordpress, should all the wordpress files have the group www-data? thanks! –  Tony May 27 '09 at 17:01

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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