0

I have CentOS 64bit with Apache, where is the virtual hosts located so I can create a few vhosts, to setup multiple domains?

2 Answers 2

1

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.

0

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .