Tuesday, 3 February 2015

How to create an Apache HTTP Virtual Host

  1. You must first Install and Configure Apache HTTP Server
  2. Create/Open the file /etc/httpd/conf.d/$domain.confwith the following text replacing variables where necessary
    $domain HTTP Virtual Host
    <VirtualHost *:80>
      # General
      ServerAdmin $webmaster_email
      DocumentRoot /var/www/html/$domain
      ServerName www.$domain
      ServerAlias $domain

      # Logging
      ErrorLog logs/$domain-error_log
      CustomLog logs/$domain-access_log common
    </VirtualHost>
  3. Restart the Apache HTTP Server daemon
    service httpd restart

No comments:

Post a Comment