top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Help with Apache Virtual Host Config for Ubuntu Server 4 IPs

0 votes
469 views

Im 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, Im not having any success with it.

posted Jun 25, 2013 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

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" wont do it.
I have a setup like this and it works really well.

answer Jun 25, 2013 by anonymous
Yes, this is the Ubuntu default configuration. I did as you suggested and it worked. Thanks for all the help.
Similar Questions
+1 vote

I have IIS and Apache both running on my server. Apache is on 8080. I am having some DNS mapping issues.

I have a virtual host entry as follows:

  ServerName something.domain.com
  DocumentRoot "D:/www/public_html"

    Options Indexes FollowSymLinks
    AllowOverride All

      Order allow,deny                          
      Allow from all

   = 2.3>
     Require all granted

Is there something wrong with this? because when I browse to something.domain.com, it gives me a 404 error. I can't even browse it as something.domain.com:8080. If I map the same domain on IIS it works fine and lets me browse to something.domain.com

I am able to browse to my Apache site via localhost:8080 but not with something.domain.com. Can anyone help me.

My Host file has the following entry

127.0.0.1      TestDevServer

Please help me map my domain (sub domain in this case) to point at the location of my site.

+1 vote

I have two virtual web server and only one IP for the host. So the need of some kind of proxy server.
Whitch one should I use? (apache, nginx, varnish, squid)

I need also the same for smtp (two postfix), if possible the same one :-) basic config?

I have one host , one IP and two domain, one for each virtual machine and the result I want:
abc.org[188.165.211.22]--->abc.org[192.168.50.2]
xyz.org[188.165.211.22]--->xyz.org[192.168.50.3]

0 votes

I am using CentOS 6.0 with Apache 2.2.15, and set up Apache with virtual host. The SSI works fine on the first VH, but ssi on the other virtual hosts does not work. I got the following message in the error log:

mod_include: Options +Includes (or IncludesNoExec) wasnt set, INCLUDES filter removed

Does anyone know how to resolve this problem?

0 votes

I am using Apache 2.2 on LE for several years now and I use intensively the virtual host mechanism (300 virtual hosts per http instance).

As soon as you start sharing resources between applications, you want to protect your platform and prevent an application from taking all the threads and cause a resource starvation for the others.

To do so i used the third party mod_qos module to limit the number of simultaneous connections per virtual hosts. Now that i intend to migrate to Apache 2.4, my first tests reveal that this module is not compatible with this version of Apache, thats also the warning that developer raised for his module.

It appears that I don't find any real alternative to substitute the mod_qos module with something else. Here are my questions :
- Can you confirm that Apache does not provide any mechanism allowing to limit the number of connection per virtual host, just to be sure that I am not missing something ?
- Why Apache doesn't provide such a functionality ? :) From my very humble user perspective, I am surprised that this is not a native functionality as it seems to me that my need is probably shared by many users. Moreover Apache provides many other complex functionalities, the one I am describing would be probably something simple to implement compared to other functionalities already available.

...