Disabling apache internal domain for lan

1 post / 0 new
#1 Mon, 06/16/2014 - 03:39
drguild

Disabling apache internal domain for lan

Here is the thing I have a host setup similar this im currently setting up it works fine except one thing.

  • Internal.lan / 192.168.1.1
  • dev.internal.lan / same as above but on dns server
  • 110.x.x.x / outbound dedicated IP webpage for my external IP address if used directly, will be a parking page
  • hostname.noip.me / initially testing hostname site before more of them

This is working great and I will be adding more stuff in later. Except the Apache default host landing page config.

Originally I had it set to my internal site internal.lan and made the hostname.noip.me first before the vhost.

What happened was as it was set to default, the new hostname was directed to my internal site until I set-up a vhost which yes I know that happens as the default page all addresses resolve to when they don't have a dedicated path.

Now I have changed the default page to the external IP '110.x.x.x' site, which I'll create a landing /parking page there as no-one will need to access anything via ip directly when I have hostnames.

Now what has happened is the 'Internal.lan / 192.168.1.1' site has now defaulted back to apache's /var/www page as I took off the default tag on it in virtualmin. Is there a way I can have virtualmin manage this page at '/home/webmaster/public_html' ?

The External IP is fine as the default and works as intended for that hostname before I created a vhost, so it will become a parking page stating nothing is actually there and to use a hostname instead.

For those confused the sites are all working as intended with these issues

Internal.lan / 192.168.1.1

  • Defaults to apaches built in site var/www now for some reason.

dev.internal.lan / 192.168.1.1

  • Works as intended

110.x.x.x / outbound dedicated IP

  • Works as intended for http://110.x.x.x and is the default page if a hostname is setup before a vhost.

hostname.noip.me (Vhost)

  • Works as intended

hostname2.noip.me (Hostname without a Vhost or path)

  • Works as intended and defaults using the default page/host tag at 110.x.x.x

Looks like I fixed it, so all of you can just deleted the default apache virtual server '*' at '/var/www' as we don't want apache to manage a default vhost itself.

So remember to delete the inbuilt default public '/var/www' apache vhost and not the 'Default Server' and use virtualmin to set up all the vhosts.

Now '192.168.1.1' and 'internal.lan' are considered 2 different sites which is absolutely fine and a good thing for flexibility, I can always put a redirect in, for now however I have created a separate vhost for each.

Getting a pretty complex system going here for myself but most of you would think what I'm doing is perfectly normal and not complex at all.