I just install apache2 on ubuntu,the default www directory is /var/www/ ,I use ln to link it to '/media/Software/Program Files/wamp/www/' at the windows directory,but the apache shows 'You don't have permission to access / on this server',Then I use 'sudo chmod -R 777 /media/Software/Program\ Files/wamp/www/' to set the permission,but it didn't work,and nothing changed when I saw the permission in the preporties of the '.../wamp/www' folder.So I want to know How can I change the www directory to '.../wamp/www' as I also need to access this diretory in windows.
There are two things around.
One is whether Apache is allowed to follow symlinks. Is you link a symlink via ln -s? It is the recommended way but it might be a security issue in some servers and it is disabled many times.
See http://superuser.com/questions/244245/how-do-i-get-apache-to-follow-symlinks for more info on that topic but esentially you need
Other topic is the permissions.
As it is a Windows directory (it seems so) the best option will be to follow this guide http://ubuntuforums.org/showthread.php?t=1604251:
Essentially it recommends you to edit the
The interesting part is the umask. I will recommend to put the last digit as 6 or 7 for allowing Apache to access.
The recommended way is to use UUID. The steps are:
0) Make a backup of fstab (just in case ;))
1) Get the UUID of your hard-drive:
2) Add the line in fstab
It should be something like this:
I have added auto so that it auto mounts. If you don't want that use noauto instead.
This will give it full permission. If you prefer different permissions use
Linux/Unix Partition (if not using Windows partitions)
If it is not a Windows partition the permissions should be in the standard linux way.
The best option is to change the permission of that directory. I will do it in this way:
Also you will need read permission (maybe write) for that directory. It is done in this way:
For also adding write:
But again that won't work if the partition is a NTFS partition because Windows do not store permission in the disk in this way.
Assuming you have a default Apache install, you should update the DocumentRoot directive inside /etc/apache2/sites-enabled/000-default and have this it point to /media/Software/Program\ Files/wamp/www/
DocumentRoot /media/Software/Program\ Files/wamp/www
Further infos can be found here: http://httpd.apache.org/docs/2.2/urlmapping.html
For me the problem was none of the above but something much simpler.
I had two Apache2 virtual hosts competing for the same domain name in the ServerAlias line.
In one virtual host file, I had
but in the other virtual host file I had a wildcard entry:
This caused a conflict in Apache 2. Removing the wildcard entry (with the *) solved the problem for me.
(Taken from (K)Ubuntuguide at http://ubuntuguide.org/wiki/Dynamic_dns#Troubleshooting .)