VirtualHost *:80 appearing when it should have IP address??

I'm suddenly having a problem with webserver configuration in Virtualmin.

A couple of domains had their VirtualHost setting changed from ipaddress:80 to *:80, and I can't figure out why -- they all have their IP Address (under Server Configuration) set to Shared Address. But if the setting is *:80, then that domain appears to inherit the settings of the first (alphabetically) domain I have configured, rather than its own! I think this is consistent with the way Apache configuration is designed to work, but I can't figure out what is causing this address to change from to .

I did see this change when I enabled the "SSL Website Enabled" feature, when it added a entry -- and this can't be right! That caused the non-ssl (port 80) access to begin defaulting to the "first" domain again!

It seems to want to change this setting every time I try to change anything in webserver configuration, and I have to manually edit the /etc/apache2/sites-enabled/domain.com.conf file to fix it.

What is happening? I'm on Virtualmin 5.07, webmin 1.831.

Status: 
Closed (fixed)

Comments

Howdy -- that could mean that there's another Apache config file located in /etc/apache2/sites-enabled that has the "*:80" setup.

You'd want to ensure that all of them are using "x.x.x.x:80".

What output do you receive when running this command:

grep -i '<virtualhost' /etc/apache2/sites-enabled/*.conf

Hey Andrey. Yes, I see one .conf that has *:80 -- so I should change that manually?

Also the 000-default.conf file has *:80 -- is that used?

Another slightly weird thing is that two of 23 .conf files in sites-available are 750 instead of 644 (mode). Not clear at all how they got that way; I never did a chmod to them. Should they all be 644?

I wouldn't change the permissions on the files, but the VirtualHost line is something I'd tweak.

I'd suggest running "a2dissite 000-default", and then change the remaining one with *:80 to x.x.x.x:80.

Thanks mucho Andrey. Fixed the *:80's and all looks good now; can update settings and nothing gets reset.

Excellent, I'm glad to hear that's working for you now!

Feel free to let us know if you have any additional questions.

Joe's picture
Submitted by Joe on Sat, 07/01/2017 - 19:31 Pro Licensee

Status: Active » Fixed
Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.