LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-23-2013, 12:39 PM   #1
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 561

Rep: Reputation: Disabled
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

Last edited by NotionCommotion; 06-23-2013 at 12:42 PM.
 
Old 06-23-2013, 02:19 PM   #2
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora
Posts: 2,630

Rep: Reputation: 495Reputation: 495Reputation: 495Reputation: 495Reputation: 495
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.
 
Old 06-23-2013, 06:59 PM   #3
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,654

Rep: Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255Reputation: 1255
Quote:
Originally Posted by lleb View Post
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.
AND remember to tell SELinux where they are, and set the appropriate security labels.

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.
 
Old 06-23-2013, 09:35 PM   #4
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 561

Original Poster
Rep: Reputation: Disabled
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).
 
Old 06-24-2013, 12:22 AM   #5
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora
Posts: 2,630

Rep: Reputation: 495Reputation: 495Reputation: 495Reputation: 495Reputation: 495
great point jpollard.
 
Old 06-24-2013, 04:13 PM   #6
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 16,986

Rep: Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447
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

Last edited by John VV; 06-24-2013 at 04:20 PM. Reason: added to
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to Store Files Safely? sunveer Linux - General 4 07-30-2012 01:11 AM
using fetchmail to store in files only Skaperen Linux - Software 2 01-30-2010 08:30 PM
A website to store system profiles? kap4lin Linux - General 3 09-26-2009 06:29 AM
Can you store installer files on a CD? dannybuntu Linux - Newbie 3 12-03-2007 10:21 AM
Partition where i can store my files while formatting anti.corp Slackware - Installation 1 12-02-2005 04:44 PM


All times are GMT -5. The time now is 02:11 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration