3

I have installed the LAMP on my Ubuntu 12.10. All are working correctly.

But I want to create a alias like phpmyadmin

I have created the folder root

/home/user/Dropbox/Development/www/

And added the following lines in my apache2.conf file

Alias /dropbox " /home/user/Dropbox/Development/www/"
<Directory " /home/user/Dropbox/Development/www/">
    Options Indexes FollowSymLinks
    Order allow,deny
    Allow from all
</Directory>

When I access it like localhost/dropbox, I received 403 Error Message. Permission Not Denaid. How can I fix this easily

4 Answers 4

2

Did you restart the server afterwards?

sudo service apache2 restart

Check this out too on Ubuntu forums. It looks like a similar problem to yours and is easily fixed.

1
  • I did that. But not working even i restarted the pc
    – KKK
    Nov 26, 2012 at 5:28
2

Is /home/user/Dropbox/Development/www/ accessible to the www-data user? To find out for sure, drop to a Terminal, sudo -u www-data -s to become the www-data user, and cd /home/user/Dropbox/Development/www/. If you can't get to the directory as www-data, neither can Apache. exit to become root again, and chmod and/or chown your way out of the problem as necessary.

2

If you include a trailing to the end of tour URL path, put one at the end of your alias name too (so this trailing will be required in the URL).

Restart apache2

You surelly have to change the owner group of your new directory to www-data :

sudo chown -R yourname:www-data /home/user/Dropbox/Development/www

And change file permissions like this :

sudo chmod -R 775 /home/user/Dropbox/Development/www

...just learned...

Add this into your Directory section :

Require all granted

And now it works for me.

Hope this will help.

1
  • This solved my problem. And without adding "Require all granted" to the config file it did not work.
    – Shadi
    May 4, 2016 at 10:01
2

You have:

Alias /dropbox " /home/user/Dropbox/Development/www/"

And:

<Directory " /home/user/Dropbox/Development/www/">

This raises the question: why do you have a leading space inside the quotes?

An absolute path with a leading space before / is generally not valid. For example:

$ ls -ld "/home" " /home"
ls: cannot access  /home: No such file or directory
drwxr-xr-x 6 root root 4096 Oct 15 23:53 /home

So, assuming the leading space is not intentional but an error, try removing it and see if that fixes the problem.

You must log in to answer this question.

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