As documented by Apache under Using Name-based Virtual Hosts:
We would instead like the VirtualHost that is generated for a particular user to be that default. What is the best/recommended way of accomplishing this?
My current thinking is to place the user's (compiled) VirtualHost directive in /usr/local/apache/conf/includes/pre_virtualhost_2.conf, but this obviously won't be managed by WHM should the user's configuration change.
Is there a better way?
Currently, the template at /var/cpanel/templates/apache2_4/main.default generates such a default VirtualHost (per IP address) with DocumentRoot [% serverroot %]/htdocs.If no matching virtual host is found, then the first listed virtual host that matches the IP address will be used.
As a consequence, the first listed virtual host is the default virtual host.
We would instead like the VirtualHost that is generated for a particular user to be that default. What is the best/recommended way of accomplishing this?
My current thinking is to place the user's (compiled) VirtualHost directive in /usr/local/apache/conf/includes/pre_virtualhost_2.conf, but this obviously won't be managed by WHM should the user's configuration change.
Is there a better way?