Default domain on Port 80

4 posts / 0 new
Last post
#1 Thu, 03/12/2009 - 14:39
lesmith

Default domain on Port 80

Hello All.

Just got myself up and running and a great system :-).

Just a question that someone can hopefully help with.

With 1 or more domains how can you set the default domain.

And second on the default domain I have my local server running on 192.168.1.100, so I have set my router to point port 80 to this IP.

So in theory if i try from my external ip http://xx.xx.xx.xx I should see my default domain but its not showing.

Any suggestion on the questions.

Thank you in advance

Thu, 03/12/2009 - 15:01
ronald
ronald's picture

in your apache config-section <virtualhost> move your default site to be the first site listed.

if you are on LAN you can not see your site just by typing your WAN IP. For this you have to make an entry in your hosts file on the PC you are browsing with. Im actually not sure this works with an IP.

Normally you'd go
192.168.1.100 mydomain.com or you can do
192.168.1.100 myservers.hostname.com
you could also use a proxy server.

Thu, 03/12/2009 - 15:19
lesmith

Yea Im happy with local stuff ie hosts etc.

If just so I can show someone some work on a local site.

So I need the site to show up from my IP given from ISP.

Thu, 03/12/2009 - 15:42
Joe
Joe's picture

<div class='quote'>So in theory if i try from my external ip http://xx.xx.xx.xx I should see my default domain but its not showing. </div>

Define &quot;default domain&quot;.

That's a trick question...you can't define default domain in a virtual hosting configured Apache. There will probably be some virtual host that will show up, but it'll be the first best match for the name, IP, and port and the order of the configuration directives...and since you've given no name for it to work with it comes down to IP and port and the order in the configuration.

So, the answer is, &quot;No, not in theory or in practice. You're imagining functionality, namely a 'default domain', that doesn't exist.&quot; ;-)

As ronald mentioned, if you make it the first VirtualHost that Apache sees, it will generally show up when you hit the IP address. I can't really recommend this tactic, though. Virtual hosting is a name-based service, so use names, even if you use a temporary name.

There's a FAQ about various ways to make sites available before DNS propagates or for testing:

http://www.virtualmin.com/component/option,com_openwiki/Itemid,48/id,fre...

That ought to get you started, anyway.

--

Check out the forum guidelines!

Topic locked