1

I've installed lamp stack and trying to set it up using the instructions on

https://help.ubuntu.com/community/ApacheMySQLPHP

I want to be able to work in a directory other than "var/www/" so i thought i could set up a virtual host for this as suggested in the link but i can't seem to get it to work. I'm using apache 2.4.7.

The thing is, i can't find the step 4. the link i gave under Virtual Hosts. So i've edited /etc/apache2/apache2.conf and added a directory tag as;

<Directory /home/kemallin/Dropbox/www/>
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
</Directory>

I've disabled the default site and enabled my newly created site conf with;

 sudo a2dissite 000-default.conf && sudo a2ensite editor.conf

but when try htpp://localhost/ it gives me this error :

Forbidden

You don't have permission to access / on this server.

Apache/2.4.7 (Ubuntu) Server at localhost Port 80

i also tried to change

<Directory />
    Options FollowSymLinks
    AllowOverride None
    Require all denied
</Directory>

to require all granted restarted the apache service and still its giving me the same 403 forbidden error.

Any pointers on this one?

Thanks.

1 Answer 1

3

Firstly, remove the following from apache.conf and put it in editor.conf (it's just good practice). When compiled, the location won't make a difference to the Virtual Host editor.

<Directory /home/kemallin/Dropbox/www/>
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
</Directory>  

Now execute the following:

$ sudo -i
# chmod +x /home
# chmod +x /home/kemallin
# chmod +x /home/kemallin/Dropbox/
# chmod -R 755 /home/kemallin/Dropbox/www/
# a2ensite editor.conf
# service apache2 reload

You are basically giving apache permission to list all files in the tree /home/kemallin/Dropbox/ and then permissions to read files from the folder you want to serve files from.

0

You must log in to answer this question.

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