The last two times I created a new virtual server in virtualmin on the first line of /etc/apache2/sites-available/the.new.url virtualmin’s Create Virtual Server put
<VirtualHost *:80> what should be there is
<VirtualHost 192.168.0.10:80> which is the same as the other virtual servers on my machine and when I correct it the new virtual server works.
On virtualmin> Create Virtual Server> IP address and forwarding> Network interface> Shared, on IP 192.168.0.10 is selected.
Does anyone know how to fix it so that when I create a new virtual server the appache file gets the correct information?
Try Virtualmin Configuration : Defaults for New Hosts. It will let you decide whether Virtualmin uses star or IP address.
If your host has a single IP address, then consistently using * should work, and will keep your Apache configuration independent of the IP address. Newer Apaches handle * nicely, older ones not always.
I did not have that problem since last year. I have 3 IP and only one was shared. In creating a virtual server, I select the shared IP for new domains and the static IP for the dedicated ones.
Thanks for point out where the setting is. I have set it and will see ho it goes.
Also are you saying that if all virtual server have the * instead of the ip then it should work because on my machine if any domain has the * it automaticly redirects to the defalt domain.
Current versions of Apache deal with * just fine instead of the IP address. Older versions sometimes didn’t. So check your Apache version.
You might also need a NameVirtualHost line somewhere, for older Apaches.
Also check this page for hints: https://wiki.apache.org/httpd/CommonMisconfigurations.
Apache has so many options that can interact with one another that making it behave just the way you want can take some experimentation plus looking up the documentation.
My own strategy when installing software is to never assume it will work the first time, and plan to throw it all away, wipe out the server or the VM, and reinstall as many times as needed to make it work. It sounds tedious but it can actually save time.