Apache jumping between virtual hosts

Discussion in 'Server Operation' started by Chasalin, Nov 5, 2020.

  1. Chasalin

    Chasalin New Member

    Hi there,

    I have a Ubuntu 16.04 server with ISPConfig 3.1.15p3 and some 200+ virtual hosts.
    This week I added a new website and it's behaving very strange:
    When I visit the site, I *sometimes* get the correct site, *sometimes* either a 500 or 503 error and *sometimes* I get the contents of the _default_ virtual host.
    It would be quite an easy problem if it'd *always* load the default site, although weird, because it's a basic virtual host with no special options or redirects or something.
    It's as if the Host header is missing some of the time...
    *every* other site on the server is working fine, but every new website I add is behaving this way, even if I create it manually in stead of via ISPConfig.
    The log files show nothing out of the ordinary: when the wrong vhost is served, the corresponding log files are used with normal lines as if I intended to visit that site.
    Has anyone any idea where I could start looking?
     
  2. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    it is possible that between various reloads and restarts that you have multiple instances of apache2 running, each one with a slightly different list of active vhosts, and sometimes your connection goes to one of these alternative instances.
    i know this is possible because i've experienced it, and it was extremely confusing at the time.

    try stopping the apache service, and then check with ps to see if any apache processes are still running, if there are kill them all, until
    Code:
    ps -aux | grep apache 
    doesn't show any running instances, and then restart apache. alternatively, and a bit more drastically, restart your server...
    then see if the problem still exists.
     
    Jesse Norell likes this.
  3. Chasalin

    Chasalin New Member

    That sounded too simple to be true and too weird to be possible, but there appeared to be 3 apache root processes.
    Stopping apache with systemctl or apache2ctl only affected one process, so I killed the others.
    Everything is working fine again! Thanks!
     
  4. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Good grief. I would not have thought something like that could happen. Just goes to show suspect everything.
     
  5. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Very weird issue, just had the same on one of my webservers. Seems like it is fixed.
     

Share This Page