These forums are locked and archived, but all topics have been migrated to the new forum. You can search for this topic on the new forum: Search for Order of apache virtual host config file on the new forum.
Hi I want to know if it's possible to manage the loading order of /etc/apache2/sites-available/FILES in virtualmin? If not it was interesting because the virtual host config file order define the priority of config
For example (in my case) file bar.foo.conf
<virtualhost>
ServerName bar.foo.com
</virtualhost>
file foo.com.conf
<virtualhost>
ServerName foo.com
ServerAlias *.foo.com
</virtualhost>
file gar.foo.conf
<virtualhost>
ServerName gar.foo.com
</virtualhost>
the sub domain bar.foo.com WORK but the gar.foo.com don't because the loading order is alphabetical.
Ambiguous / Conflicting configuration with ServerAlias *.foo.com collides with gar.foo.com
Apache may not be loading gar because it already exists in *.foo.com
If you insist on this configuration, you can manually rename some of the symbolic links to use numeric prefixes as is done with 00-default
Thank to anwser
Yeah i've rename the simlink in /etc/apache2/site-enable/* and it work fine.
But i want to purpose to virtualmin feature. Can set the loading order when i create the virtualhost
have nice day
I would also like to see this feature in Virtualmin or Webmin.
Best regards, Fernando Nunes
Virtualmin has an option to define a domain as "default for the respective IP address", symlinking it as the alphabetically first Apache domain to load. I suppose this should do what you're trying to achieve?
Yup, Locutus is correct -- you can set a default VirtualHost in Apache by logging into Virtualmin, choosing the default domain from the drop-down list, and selecting Server Configuration -> Website Options, and there you can set "Default website for IP address" to "Yes".
-Eric