Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm setting up a RHEL web server which will host static and dynamic content for several domain names. Multiple users will update files by SSH and SFTP.

Where should the files for each domain name be placed? On my default system, there is a single /var/www/, but no clue as how to locate multiple domains.

Looking at the Filesystem Hierarchy Standard (, it seems the best option is:


Any preferences?

share|improve this question
up vote 2 down vote accepted

Apache default is usually /var/www/ but you may as well follow FHS guidelines which I find quite good. The important thing is that you keep consistency between systems, that's why FHS are a good reference to follow.

In any case, I recommend to have it in a different partition because:

  • If it fills, will not affect the server
  • You can set mount options like noexec for added security

Remember to be very careful with the directory permissions to avoid users from one site accessing other sites.

share|improve this answer

We have very good experiences with a structure of

/srv/www/ (if preferred)

if the server is used by one company. If you have client domains to serve, you might want to consider

share|improve this answer

I like the /var/www/ convention.

I like to have the conf in /etc/httpd/vhosts.d/ and included in the main apache conf. I don't let the customer edit this. This way if you add a new domain and the configtest, reload or restart detects an error then it's really easy to back out.

With: /var/www/ /var/www/ /var/www/

I use posix acls to add default acls on the above dirs, so that any files they create are created with rwx for their server user(the one used in suexec)/group, so that no matter what user they are when they create the file, the user the webserver can access them and so that members of the VritualHosts user's group can access all of the files.

/var/www/ I use private as the place for password and group files to go.

/var/www/ If I want to allow the site owner to make config changes I also create a file such as: /var/www/ which is included in the VirtualHost in the main config for the domain i.e. /etc/httpd/vhosts.d/

You need to be careful with this though as it means the user can break your entire config so you want to be pretty careful the user knows what they are doing. I tend to do it when there is a server with multiple VirtualHosts all owned by the same customer, so if the break the config, they only break their own sites.

I'd also suggest using suexec which allows processes to run as a user other than apache and also allows dynamic content to be run as users other than the apache user.


You may also want to look at the various RLmit directives, which allow you to lmit resource usage on a VirtualHost, etc basis. See:

share|improve this answer

We use the following layout


So, taking as an example

<VirtualHost *:80>

   DocumentRoot /var/www/domains/

   ErrorLog /var/www/domains/
   CustomLog /var/www/domains/ combined
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.