An odd problem accessing a website by ip address - how to direct it?

Discussion in 'ISPConfig 3 Priority Support' started by craig baker, Feb 5, 2023.

  1. craig baker

    craig baker Member HowtoForge Supporter

    I have customer server behind a dual wan router and 2 different ips bound to the router.
    Now I understood that adding a website 000default.local gave a means of responding to an ip address access (no name).
    but this seems not to work here and anyway here I have 2 different ip addresses. and the second address (96.88.250.105) seems to bring up an error message from an instance of nextcloud. Nextcloud was implemented as a vhost nextcloud.qhscares.com and that works properly.
    but both the first and the second ip address bring up this text:
    --SNIP--
    This version of Nextcloud requires at least PHP 7.0
    You are currently running 5.4.16. Please update your PHP version.
    --SNIP
    how does these by ip address only access find its way to the nextcloud vhost? and that vhost has php 7.2 selected as the default. Ironically I WANT the second ip address to bind to nextcloud - but my 'default' access above even though it goes to the right place (accidentally?) its not using php 7.2.
    so how to explain this? and anyway to get the ip address (alone) to default to the nextcloud instance with the right php?
    Inquiring minds!
     
  2. craig baker

    craig baker Member HowtoForge Supporter

    ENLIGHTENMENT - I found an old answer and simply adding ServerAlias xxx.xxx.xxx.xxx and ServerAlias yyy.yyy.yyy.yyy under the nextcloud vhost options page seems to work well. Though I also had to add in the nextcloud config the 2 ip addresses as trusted to have it grant access:
    --snip--
    'trusted_domains' =>
    array (
    0 => 'nextcloud.qhscares.com',
    1 => 'xxx.xxx.xxx.xxx',
    0 => 'yyy.yyy.yyy',
    ),
    --snip--

    so to have it default to a given domain if addressing by ip address only you just add a ServerAlias to the desired website apache options page. how simple is that?
     

Share This Page