Default website for IP adress

4 posts / 0 new
Last post
#1 Thu, 06/21/2007 - 10:42
ChristianReitz

Default website for IP adress

Hello!

I'm trying to set the website that is shown, when accessing the server with an ip-address.

I have several ips set up, on one IP there is only one website hosted. Needless to say, it shows the right website when I try to access the ip.

On another ip there are several domains with subdomains and the current default seems to be the first one found in /sites-available in alphabetic order.

Can I set up another default site for the IP? If so, where? ;)

Christian

Thu, 06/21/2007 - 13:47
Joe
Joe's picture

Hey Christian,

That's an interesting side effect of the Debian way of handling virtuals. ;-)

Apache has two modes of operation, and when it is configured for virtual hosting the "default" virtual server becomes the first one defined in the VirtualHost sections, as you've noted.

You've probably got two options:

Rename the sites-available filename for the domain you want to be the "default" to be always before the others. 0virtualmin.com.conf for example.

Add a VirtualHost section to the Apache configuration file before the include line that leads to the loading of the sites-available files.

--

Check out the forum guidelines!

Fri, 06/22/2007 - 05:18 (Reply to #2)
ChristianReitz

Hey Joe!

Hmm, renaming would be easy, but would this not break the maintenance via Virtualmin?

Thanks again! ;)

Fri, 06/22/2007 - 13:40 (Reply to #3)
Joe
Joe's picture

Hey Christian,

Crap, you're right. I don't have a good solution to this one!

Maybe make a dummy version of the site that is identical in every way, but is outside the control of Virtualmin. (i.e. rather than renaming it, copy the file and the make up some random domain name that you'll never use.)

--

Check out the forum guidelines!

Topic locked