Skip to Content
Learning RHEL Networking
book

Learning RHEL Networking

by Andrew Mallett
June 2015
Intermediate to advanced
216 pages
4h 48m
English
Packt Publishing
Content preview from Learning RHEL Networking

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 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering CentOS 7 Linux Server

Mastering CentOS 7 Linux Server

Mohamed Alibi, BHASKARJYOTI ROY
Troubleshooting CentOS

Troubleshooting CentOS

Jonathan Hobson

Publisher Resources

ISBN: 9781785287831