🎉 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

Started by
5 comments, last by Sander 16 years, 11 months ago
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
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).

<hr />
Sander Marechal<small>[Lone Wolves][Hearts for GNOME][E-mail][Forum FAQ]</small>

That and all of the parent directories have to be world executable, but they don't have to be readable.
We''re sorry, but you don''t have the clearance to read this post. Please exit your browser at this time. (Code 23)
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
When General Patton died after World War 2 he went to the gates of Heaven to talk to St. Peter. The first thing he asked is if there were any Marines in heaven. St. Peter told him no, Marines are too rowdy for heaven. He then asked why Patton wanted to know. Patton told him he was sick of the Marines overshadowing the Army because they did more with less and were all hard-core sons of bitches. St. Peter reassured him there were no Marines so Patton went into Heaven. As he was checking out his new home he rounded a corner and saw someone in Marine Dress Blues. He ran back to St. Peter and yelled "You lied to me! There are Marines in heaven!" St. Peter said "Who him? That's just God. He wishes he were a Marine."
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.
We''re sorry, but you don''t have the clearance to read this post. Please exit your browser at this time. (Code 23)
ah, well that makes sense then, thanks
When General Patton died after World War 2 he went to the gates of Heaven to talk to St. Peter. The first thing he asked is if there were any Marines in heaven. St. Peter told him no, Marines are too rowdy for heaven. He then asked why Patton wanted to know. Patton told him he was sick of the Marines overshadowing the Army because they did more with less and were all hard-core sons of bitches. St. Peter reassured him there were no Marines so Patton went into Heaven. As he was checking out his new home he rounded a corner and saw someone in Marine Dress Blues. He ran back to St. Peter and yelled "You lied to me! There are Marines in heaven!" St. Peter said "Who him? That's just God. He wishes he were a Marine."
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).

<hr />
Sander Marechal<small>[Lone Wolves][Hearts for GNOME][E-mail][Forum FAQ]</small>

This topic is closed to new replies.

Advertisement