MostlyChris

Thoughts that are my own.

Separate VHOST Files on Webmin Managed Server

I recently ran across a request to place all vhost configurations in separate files. Here are the steps I followed to make this happen. Step 4 is only necessary if you have existing virtual hosts in the main or a single apache configuration file.

  1. I created the virtual_sites directory under /etc/httpd/conf.d/

  2. I set the “File or directory to add virtual servers to” option to /etc/httpd/conf.d/virtual_sites in Webmin->Servers->Apache Webserver->Module Config.

  3. I added the following line to the apache configuration file (/etc/httpd/conf/httpd.conf)

Include conf.d/virtual_sites/*.conf

  1. I created a .conf file for each of the virtual domains in the virtual_sites directory and I copied the virtual host configuration for each domain to the newly created files.

  2. I tested the virtual domains in order to make sure they are working.

  3. I created and deleted a test domain to make sure that Webmin was able to create and delete the new files–Success.

  4. I did a final restart of apache to make sure it restarted without error.

Comments