🎉 Celebrating 25 Years of GameDev.net! 🎉
Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!
Moving /var/www
Hi. I want to make my Apache's content directory something other than /var/www. I tried making /var/www a symlink to a directory on my home partition (that's vital) and despite setting all permissions in that directory to 755 I still get access denied messages when I try to browse there.
So, in a nutshell, how do I move /var/www without breaking anything? If I browse to http://localhost/place1/page1.htm it should read from /home/wherever/place1/page1.htm
You need to edit the http.conf file (fedora, redhat) or the apache default site file (debian and derivatives). You'll find them in /etc. For debian and derivatives it's /etc/apache2/sites-available/default you want. Where it says /var/www in there, replace by whatever you want and restart Apache.
The reason your symlink doesn't work is because by default Apache is configured not to follow symlinks. It's possible to enable that too (but I don't know where that is by heart).
The reason your symlink doesn't work is because by default Apache is configured not to follow symlinks. It's possible to enable that too (but I don't know where that is by heart).
That and all of the parent directories have to be world executable, but they don't have to be readable.
Why would parent directories have to be executable? readable maybe. But I always thought executable was for, well, executing and was really for script files and binary executables...
EDIT: I'm not saying you're wrong, you very well may be right (i don't really have the desire to test myself) but it just doesn't make sense to me
cheers
-Dan
EDIT: I'm not saying you're wrong, you very well may be right (i don't really have the desire to test myself) but it just doesn't make sense to me
cheers
-Dan
In the context of a directory, executable means that you can navigate to or through it. Failing to do so will result in a 403 from your server.
Why would you want to move /var/www in the first place? If it's about premission issues, just add your user to the www-data group (or whatever group apache runs under).
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement