ip address problem

5 posts / 0 new
Last post
#1 Tue, 10/14/2008 - 14:29
alfredolo

ip address problem

Good morning, I am using the great Virtualmin but i have another one problem :( I have created some virtual server : - example.com - forum.example.com - list.example.com

When I try to enter with the browser using ip address (http://x.x.x.x) I can get the login page of forum.example.com How can i change it into the main one (www.example.com) ?

Thank you Alfred

Wed, 10/15/2008 - 15:38
alfredolo

I have found a problem.
/etc/apache2/site-enabled/ contain the site list enabled in the server.

This directory is included into main apache config to read virtualhost information.
The problem is simple.
The directory is readed in alphabetic order , so the site are inculde in this order :
- default
- forum.myexample.com
- list.myexample.com
- myexample.com

So, calling the server by ip address create this problem, i can see only forum.example.com
I am trying to insert one redirect into default ( / into /home/myexample/public_html/ ) and it work, but i want a real redirect not just a fake one, becouse log file are in separate file.
Any idea ?

Thank you

Wed, 10/15/2008 - 20:07 (Reply to #2)
andreychek

Hmm, so what sort of redirect are you looking for specifically?

There's a few different ways to do redirects. It also might also be worth trying to get your desired domain to be the default host rather than doing a redirect -- though in the little bit of tinkering I've done, I'm not sure Virtualmin would be thrilled about you changing the filenames within sites-enabled.
-Eric

Fri, 10/17/2008 - 07:22
alfredolo

Thank you for reaply.
I have found today another problem :
http://myexample.com.com
give forum.myexample.com instead of www.myexample.com, like ip address does.

How can i set desired domain to be the default host ? Or if it is impossible how i do a redirect ?

Thank you

Mon, 10/20/2008 - 19:35 (Reply to #4)
andreychek

Well, I just saw Jamie post a response to a request in the tracker addressing an issue very similar to this. He said:

"One trick you can use to force an ordering /etc/apache2/sites-enabled is to rename the files so that the one you want processed first is first in alphabetical order. So you could rename x.mydomain.net.conf to 00-x.mydomain.net.conf."

So according to him, you could simply rename the domain you wish to be the default such that it's ordered first, alphabetically.

At that point, you wouldn't have to worry about redirecting.
-Eric

Topic locked