Weird apache issue, site http fails but https works

Discussion in 'Installation/Configuration' started by snowfly, May 12, 2016.

  1. snowfly

    snowfly Member

    Got a weird apache issue I'm not sure how to fix.
    ISPConfig, Apache/2.4.10, Debian Jessie, running a master server, and multiple other web servers.

    On the master server, the server hostname is, in ISPConfig the server is shown as, and I have a web site added via ISPConfig called ''. (so all using the same domain)

    Now this website only works when accessing via https, e.g., correctly showing content from the Document Root of that virtual site (e.g. /var/www/
    BUT, when trying to access via http, e.g., the default Document Root is served up, e.g. /var/www , which suggests its not matching the virtualhost for port 80, and just using the apache 000-default.conf file.

    Any tips on how I can debug and fix?

    I checked the apache conf file for the site that ISPConfig generated (/etc/apache2/sites-enabled/, and it seems to correctly have VirtualHost *:80, and ServerName matches
  2. snowfly

    snowfly Member

    Just an update, one 'hack' I can do to work around this for now, is create a php file /var/www/index.php, and use the following to redirect to the https version of the site that works.
    Not ideal, still keen to find the real cause and get it fixed.

    if ($_SERVER['HTTP_HOST']=='') {

Share This Page