Where to store website files?
Hi,
I have a CentOS 6.4 VPS which runs several Apache virtual web servers. My VPS provider set each one in /home (for instance, /home/website1/html was the root for website1, /home/website2/html was the root for website2, etc. While this works, it is a little strange as website1, website2, etc are not normal users. I am wondering if it is best to move them all to /var/www so that /var/www/website1/html will be the root for website1, etc. Then make Apache run as user Apache whose home directory is /var/www. Thanks |
it really does not matter were they ar as long as httpd.conf knows were to find them.
personally i have mine in /www on my web server no need for any higher directory other then / as far as im concerned. /www/foo.com/doc /www/foo2.com/doc etc... so having them in /home/foo.com/html is just fine as long as you have the storage space on the /home partition, if that is even a separate partition. |
Quote:
The reason to tell SELinux where they are is so that if a relabel event occurs (usually during updates) it will know what the proper label is for these files. Without the appropriate security labels, apache will be blocked from access. Other than that, it should work just fine. |
Thanks all,
I think I will put them in /var/www just because that is what CentOS does. Don't know if necessary, but maybe SELinux will magically be set up (on my list of things to learn, but currently don't understand exactly how it does what it does). |
great point jpollard.
|
The standard location on RHEL/CentOS/SL is /var/www/html
the CMS is normally in "/var/www/html " but it really can be almost any place , however SE might NOT like a folder directly on "/" ( like "/http" ) /home/www ( with www as a user and IS owned BY "apache" and in the "apache" user group ) a bit odd but usable as long as SE and the /etc/httpd.conf knows about that My preferences are a bit "non-standard" .I like to have everything all together ( a bit easier to manage and lock down ) /var/www/Apache /var/www/MySQL /var/www/MySQLAdmin /var/www/phpmyadmin /var/www/AwStats /var/www/TheCMS.Software but this is just my likes , do some research and make up your own mind |
All times are GMT -5. The time now is 11:42 PM. |