all domains point to the same site

6 posts / 0 new
Last post
#1 Sun, 08/19/2007 - 08:30
richardhuber

all domains point to the same site

hi @ all,

i see a very strange behavior of my box for the last few days... every time i create a new virtual- or sub server, all existing servers point to the new one .... if i delete the new created server, everything is ok again. if i have a look at the virtualhost list, everything seems to be ok..... and another thing is , if i use subservers like : cms.mydomain.ch i get allways redirected to www.cms.mydomain.ch.

i guess, the second last update ( which nearly crashed my box ) let run me from one problem to the next.

i made a backup of all my virtual server now, and think about, to reinstall virtualmin, maybe this would solve the most problems.

so, i ve a few questions about it. - is the uninstall from the install.sh working now ? - what do i need to do, to uninstall virtualmin and webmin completely, so that i have a clean system again, ready for a new installation ? - do i need to backup the existing virtualservers in a special way, to prevent misconfigurations when restore them on the new installation ?

..

Tue, 08/21/2007 - 09:54
Joe
Joe's picture

Hey Richard,

I'm sure a reinstall is way more trouble than you need to go through for this simple problem (and it is simple).

This particular problem has been popping up a lot lately...I think there must be something in the default package on some platform that re-adds the "default" VirtualHost. Anyway, there's a bit of documentation about the problem here in the troubleshooting common problems guide:

http://www.virtualmin.com/documentation/id,troubleshooting_common_proble...

In short, the NameVirtualHost and VirtualHost directives do not match--or you have a *:80 entry that is sucking up all of the hits before the specific IP-based directives come into play. Fix that, and all will fall into place.

--

Check out the forum guidelines!

Tue, 09/04/2007 - 15:18 (Reply to #2)
merlynx

I am having this same issue.

When I went to this thread:
<a href='http://www.virtualmin.com/documentation/id,troubleshooting_common_proble... target='_blank'>http://www.virtualmin.com/documentation/id,troubleshooting_common_proble...

I found a description of the problem, and a &quot;quick&quot; solution. Would it be too much to ask for clarification with an example image? Or &quot;Virtual host directives you can get to by clicking [some link]-&gt;[the next link]-&gt;&quot; and so on...

I know where to find the &quot;Addresses for name virtual servers&quot; and mine is set for the external IP [xxx.xxx.xxx.xxx:80] (clicked webmin-&gt;apache2-&gt;Global Configuration tab-&gt;networking and addresses). I assume this is the &quot;NameVirtualHost&quot; directive.

Right now in my httpd.conf file - this is how these directives are set:

NameVirtualHost xxx.xxx.xxx.xxx:80
AND
NameVirtualHost *

(where xxx.xxx.xxx.xxx is our public IP address)

And for each &lt;VirtualHost&gt;&lt;/VirtualHost&gt; the entries look something like this:

&lt;VirtualHost *&gt;
ServerName oneofourchurchsites.com
ServerAlias www.oneofourchurchsites.com
Redirect / http://www.oneofourchurchsites.org/
DocumentRoot /home/oneofourchurchsites/public_html
&lt;/VirtualHost&gt;

If I understand this correctly, then in the httpd.config file REMOVE the NameVirtualHost * AND in every single &lt;VirtualHost&gt; entry, change it to look like this:

&lt;VirtualHost xxx.xxx.xxx.xxx:80&gt;
ServerName oneofourchurchsites.com
ServerAlias www.oneofourchurchsites.com
Redirect / http://www.oneofourchurchsites.org/
DocumentRoot /home/oneofourchurchsites/public_html
&lt;/VirtualHost&gt;

Is this correct?

Thanks!

Tue, 09/04/2007 - 18:45 (Reply to #3)
Joe
Joe's picture

<div class='quote'>If I understand this correctly, then in the httpd.config file REMOVE the NameVirtualHost * AND in every single </div>

Absolutely correct.

You've also got a problem in your Virtualmin configuration. It shouldn't be generating entries like this.

In the Virtualmin Module Configuration (in the System Settings menu), browse to the &quot;Other Server Settings&quot; section, and find the option labeled &quot;Default virtual server IP address&quot; and set it either to the network interface (default) or to an explicit IP. It can't be * (which is what you have now, I think...if you don't, let me know, as something is broken in Virtualmin).

You're right that I should be a bit more explicit about this. I'll add some more detail to the troubleshooting doc.

--

Check out the forum guidelines!

Tue, 09/04/2007 - 21:40 (Reply to #4)
merlynx

Nope, the default IP is set to our only public ip for the virtualmin box. I edit everything manually usually...more of a command line person (read: I broke it), but like gui stuff if it speeds me up (I just don't always understand how to use it...). Things are working fine now - I can add a site after making these changes and not have the whole apache system of virtual servers choke and fall back to the default site because it's confused. So it's not adding the &quot;*&quot; but our IP instead and since all of the virtual hosts are set with the IP now it worketh. Whew.

Thanks for the response and clarity!

-Jeremy

Tue, 09/04/2007 - 22:58 (Reply to #5)
Joe
Joe's picture

Awesome. Thanks for the update.

I've added a few more concrete details and pointers to the relevant configuration options to the Troubleshooting documentation.

--

Check out the forum guidelines!

Topic locked