Jump to content
  • Advertisement
Sign in to follow this  
spraff

Moving /var/www

This topic is 4025 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
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).

Share this post


Link to post
Share on other sites
That and all of the parent directories have to be world executable, but they don't have to be readable.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!