1

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

<VirtualHost *:80>
     ServerAdmin [email protected]
     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!

2 Answers 2

0

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>
0

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.

1
  • 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, 2009 at 17:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .