Keep Apache VirtualHost config files in a separate directory on RHEL derivatives

I am using Rocky linux 9 and instead vertualmin on it.
But when I create server the server vertualhost server configuration added in https.conf.
I want to create configuration in separate file line automatically when I create a server using vertualmin


I’m pretty sure that’s the way RHEL based distros do it. A single “httpd.conf” file. Debian based distros create separate files inside a directory “sites-available”…

1 Like

Yes, is there any way to get separated conf files


Short of switching distros to one that uses this model, not easily if at all.

Perhaps one of the other @staff know of a setting or way to accomplish this however.

We try to stick to the OS defaults when handling configuration files, as Peter correctly mentioned earlier.

However, @Jamie created absolutely incredible and flexible system. That said it is actually possible to store Apache virtual host configs in a separate directory even on RHEL derivative systems. Although it will require a few small modifications.

  1. Open Webmin Apache module config (cog button at the top left of Apache module index page) and change File or directory to add virtual servers to to let’s say /etc/httpd/sites directory. Hit Save button.
  2. mkdir /etc/httpd/sites
  3. Edit main /etc/httpd/conf/httpd.conf file, find IncludeOptional conf.d/*.conf line and add right after IncludeOptional sites/*.conf line
  4. Restart Apache
  5. Enjoy!

I am unable to find this can you help me

Webmin, Servers, Apache Webserver.
Top left corner is a small cog icon - Module config.
Then after Configurable Options on top line is a small search icon, select File or directory to add virtual servers to.

1 Like

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.