Re: Help with Apache Virtual Host Config for Ubuntu Server 4 IPs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jun 25, 2013 at 11:35 AM, Francis Lee Mondia <fbmondia@xxxxxxxxx> wrote:
I'm trying to configure an Ubuntu server with 4 Public IPs to display "This is a shared IP site" if any of the IPs are accessed directly. The server has IP-based virtual-hosts configured on the different IPs. So far, I'm not having any success with it.

Are you using the default Ubuntu configuration where each vhost is in its own file?
If so, Ubuntu should load them in alphabetical order, so which ever vhost is loaded first for each IP will be the default one.
Common practice is to rename the symlinks in /etc/apache/sites-enabled to something like ###-NAME (where ### is the order you want the vhosts loaded 000,001,002, etc). That will force (at least the Ubuntu-distributed version of) apache to load the vhosts in that order.

As long as your "This is a shared IP site" vhost is the first one loaded, it will be shown as the default site.
You might need to explicitly bind the vhost to every IP address. Something like "*:80" won't do it.

I have a setup like this and it works really well.

- Y

[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux