Question

I'm trying to configure my local server, in the same way I always do but not working, says I have no excuses, but if I give the same permissions to the www folder remains the same and if I point to this folder www if it works I do not understand?

if I do it this way: it works

DocumentRoot /var/www
<Directory />
        Options FollowSymLinks
        AllowOverride None
</Directory>
<Directory /var/www>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
</Directory>

drwxr-xr-x  2 root root     4096 nov  6 15:27 www

but if I do this: does not work

DocumentRoot /home/diego/web_server
<Directory />
        Options FollowSymLinks
        AllowOverride None
</Directory>
<Directory /home/diego/web_server>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
</Directory>


drwxr-xr-x 2 root root 4096 mar  4 15:40 web_server 

I'm doing wrong?

Was it helpful?

Solution

In Apache on Ubuntu 12.10 you should have an envars file in /etc/apache2/envars. The User:Group the web server is running as is set in envars. If you change documentroot you need to set permissions on that new doc root appropriately. Chances are in your environment your Apache2 instalation is running as www-data:www-data. If so you need to set permissions on the new docroot and any user that will write to that dir structure as well.

In /etc/apache2/apache2.conf you will find the following lines about half way down a the file.

#These need to be set in /etc/apache2/envars
    User ${APACHE_RUN_USER}
    Group ${APACHE_RUN_GROUP}

In /etc/apache2/envars you will find

export APACHE_RUN_USER=www-data
export APACHE_RUN_GROUP=www-data

You can either assign a different User:Group in envars or assign the directory permissions for www-data.

This is different than the way it used to be done within httpd.conf.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top