Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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 have CentOS 64bit with Apache, where is the virtual hosts located so I can create a few vhosts, to setup multiple domains?

share|improve this question
up vote 1 down vote accepted

There is a file called httpd.conf in /etc/httpd/conf directory. Uncomment the following:

NameVirtualHost *:80

<VirtualHost *:80>
    ServerAdmin root@localhost
    DocumentRoot /var/www/html
    ServerName localhost
    ErrorLog logs/localhost-error_log
    CustomLog logs/localhost-access_log common

NameVirtualHost enables Name Virtual Hosting. The section for ServerAdmin is a contact email address. DocumentRoot is where your www files are located for this vhost. ServerName is useful for subdomains and such, but I generally use it to name the domain/subdomain/site. ErrorLog and CustomLog directives are usually per vhost, so that they aren't all logged into the same error/custom log, however, these are going to be where your error and access logs will be stored and written to - make sure the directory/file can be written by the apache user.

share|improve this answer

Using Apache on CentOS is pretty much like using Apache on any other platform. The configuration files are in /etc/httpd/, and the Apache documentation is here. If you have specific questions about something, let us know.

share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.