O'Reilly logo

Learning RHEL Networking by Andrew Mallett

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Automating virtual hosts

If we create a template file for a virtual host, we can easily drop new virtual hosts using a script. First, we need a template file that is similar to the following commands:

<VirtualHost *:80>
  ServerAdmin webmaster@dummy-host.example.com
  ServerName dummy-host.example.com
  DocumentRoot /var/www/dummy-host.example.com
  ErrorLog /var/log/httpd/dummy-host.example.com-error_log
  CustomLog /var/log/httpd/dummy-host.example.com-access_log
  UseCanonicalName Off
  ServerSignature On
  <Directory "/var/www/vhosts/dummy-host.example.com">
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
  </Directory>
</VirtualHost>

If this file is saved as /etc/httpd/conf.d/template, it will not be used as a configuration as it does not ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required