[BlueOnyx:24154] Re: Static IP question

Michael Stauber mstauber at blueonyx.it
Thu Aug 6 21:12:28 -05 2020


Hi Ernie,

> I am trying to access a vsite, which has been assigned it's own static IP
> which is different from the server IP, by using just the IP address.
> 
> eg. http://xxx.xxx.xxx.xxx/test.html
> 
> It's a 5209R server, and it's always trying to get to
> /var/www/html/test.html when I use the IP address, instead of looking in the site1
> /directory where the page is.
> 
> In the past I have never had a problem doing this on 5107R servers, but
> something seems to have changed over the years.

That is correct. This was eventually changed. If you have multiple
Vsites on the same IP and a client enters the IP, then which page does
he see? Chances are, he sees the page of another client with which his
Vsite shares that IP.

For that reason /etc/httpd/conf.perl/00-default-vsite.pl was introduced
a few years ago. It's part of the Apache configuration and detects on
the fly which IPs are associated with the server and creates a dummy
VirtualHost container for each of them, which is loaded first and before
any VirtualHost containers of Vsites come into play.

The DocumentRoot for these dummy-VirtualHosts is /var/www/html/ and
that's what anyone will see when he accesses any IP bound to the server
directly.

> It's so I can test certain things in a vsite without having to alter DNS
> records. 
> 
> Is there anyway to achieve this on 5209R servers?

Enable "Nginx as SSL Proxy" in the GUI. It disables this feature completely.

Or if you don't want to do that, edit
/etc/httpd/conf.perl/00-default-vsite.pl and find the comment near the
bottom where it says ...

# Push out config:
$server = Apache2::ServerUtil->server;
$server->add_config([split /\n/, $config]);

... and modify it to this:

# Push out config:
$config = '';
$server = Apache2::ServerUtil->server;
$server->add_config([split /\n/, $config]);

-- 
With best regards

Michael Stauber



More information about the Blueonyx mailing list