Wrong sites showing up

Discussion in 'Installation/Configuration' started by labsy, Sep 5, 2019.

  1. labsy

    labsy Member

    Hi,
    I have setup brand new Ubuntu 18.04 with Apache and ISPConfig, as per "The perfect server" instructions. But just after I setup my first 3 web sites, I have problems:
    2 websites are OK, while the 3rd one seems like it's showing content of 1st site!? Folders are different, content is different, and under /etc/apache2/sites-enabled I can see *vhost files, where DocumentRoot shose for each site corectly different path, like:
    site1: DocumentRoot /var/www/clients/client1/web1/web
    site2: DocumentRoot /var/www/clients/client2/web2/web
    site3: DocumentRoot /var/www/clients/client3/web3/web

    So everything looks OK...but when I browse to web site3, I see content of site1.
    ???!!! Any idea?
     
  2. Steini86

    Steini86 Member

    First thing that comes into my mind is a "shoot yourself into your foot with https".

    Looks like you try to connect (probably your browser does it by itself) to https://site3. However, https is not configured for that site. Than Apache delivers the first site with configured https which is site1.

    What webmasters should do in the long run is to deactivate port 80, activate https for all sites and deliver only https content.
    Alternatively: give every site its own IPv6 Address.
    VirtualAliases for https are just a bad workaround and sometimes they strike back
     
  3. labsy

    labsy Member

    Well, at first sight I also thought it was HTTPS issue...but I have LE SSL on both, the 1st (default) site and the problematic site nr. 3. Moreover...content of site1 is also displayed via http://site3 url....which makes things look weird.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    1) Do not mix http and https on the same IP. If you use https, enable it for all sites on your server. Or use one IP for http only sites and one IP for sites which have http and https.
    2) Do not mix * and IP in the IPv4 field on your server, either use * for all sites or use the IP for all sites.

    If you don't follow these rules, then apache/nginx may fail to show the correct site.
     
  5. Steini86

    Steini86 Member

    Hi Till, sorry for being offtopic but this reminds me of a problem I had: I have several IP addresses and need a website to listen to multiple of them. How can I do this in ISPconfig? Currently I am editing the vhost manually from <VirtualHost IP1> to <VirtualHost IP1 IP2>
    All IPs are configured in ISPconfig, but for the web I can only select a single one.
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    There is no way to select multiple IP addresses. The only option would be to use *, but that's probably not what you need for your specific problem?
     
  7. Steini86

    Steini86 Member

    No, then I would have to do this for all sites, which results in other problems ;) I vote for a low priority feature request to be able to select multiple IPs ;) For the moment I am fine with the manual approach and it probably does not affect a lot of users .. However, the solution could be easy, as the IPs can just be concatenated in the virtualhost directive.
     
  8. labsy

    labsy Member

    @Steini86 In cases when I need multiple PUBLIC IPs, I mitigate the issue on firewall NAT rules, not on server. I know this does not cover all scenarios, but maybe you can extract something for you from firewall, too.
     
    Steini86 likes this.
  9. Steini86

    Steini86 Member

    @labsy Good suggestion, will consider that next time! Thanks!
     

Share This Page