Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

2 Answers 2

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
</VirtualHost>

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

 
discard

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.