All websites show Apache default page

Discussion in 'Installation/Configuration' started by kmchen, Jan 20, 2019.

  1. kmchen

    kmchen Member

    Hi,
    On a complete fresh debian 9 / ispconfig 3.0 then an update.php upgrade to ispconfig 3.1 all the websites show the Apache default page.
    I notice that all sites-enabled/ vhost configurations generated by ispconfig have the .vhost extension but I believed that Apache 2.4 configurations in sites-enabled and conf-enabled need a ".conf" suffix now.
    I tried to add in apache2.conf a line
    IncludeOptional sites-enabled/*.vhost
    But no success. What is the problem and why do ispconfig continue to use .vhost extensions when Apache asks for .conf ?
     
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    Why not install ISPConfig 3.1 directly? Did you reconfigure services during upgrade to 3.1? Is the server configuration done following the Perfect Server Guide?
    This should not be a problem if you did the setup correctly. If you somehow messed up Apache config files, then this may be an indication of something.
    As for your problem, Apache shows the default page when it can not show the asked for page. Check apache logs for errors, usually there is something. Check with
    Code:
    apachectl -S
    for erroneus sites.
    If SSL certificates are not working, you may get the wrong website shown feature.
    Search this forum, the problem with apache showing wrong website has been discussed a lot.
     
  3. kmchen

    kmchen Member

    Puting the server IP instead of the default * in sites definitions solved the problem
     
  4. kmchen

    kmchen Member

    but one domain still shows Apache default conf. I can't find anything in logs.
    Here are ispconfig configurations Apache en Bind generated:
    [email protected]:~# cat /etc/apache2/sites-enabled/100-ligamen.fr.vhost

    <Directory /var/www/ligamen.fr>
    AllowOverride None
    Require all denied
    </Directory>

    <VirtualHost 94.23.227.123:80>

    DocumentRoot /var/www/clients/client2/web1/web

    ServerName ligamen.fr
    ServerAlias www.ligamen.fr
    ServerAdmin [email protected]

    ErrorLog /var/log/ispconfig/httpd/ligamen.fr/error.log


    <IfModule mod_ssl.c>
    </IfModule>

    <Directory /var/www/ligamen.fr/web>
    # Clear PHP settings of this website
    <FilesMatch ".+\.ph(p[345]?|t|tml)$">
    SetHandler None
    </FilesMatch>
    Options +FollowSymLinks
    AllowOverride All
    Require all granted
    </Directory>
    <Directory /var/www/clients/client2/web1/web>
    # Clear PHP settings of this website
    <FilesMatch ".+\.ph(p[345]?|t|tml)$">
    SetHandler None
    </FilesMatch>
    Options +FollowSymLinks
    AllowOverride All
    Require all granted
    </Directory>




    # suexec enabled
    <IfModule mod_suexec.c>
    SuexecUserGroup web1 client2
    </IfModule>
    <IfModule mod_fastcgi.c>
    <Directory /var/www/clients/client2/web1/cgi-bin>
    Require all granted
    </Directory>
    <Directory /var/www/ligamen.fr/web>
    <FilesMatch "\.php[345]?$">
    SetHandler php5-fcgi
    </FilesMatch>
    </Directory>
    <Directory /var/www/clients/client2/web1/web>
    <FilesMatch "\.php[345]?$">
    SetHandler php5-fcgi
    </FilesMatch>
    </Directory>
    Action php5-fcgi /php5-fcgi virtual
    Alias /php5-fcgi /var/www/clients/client2/web1/cgi-bin/php5-fcgi-94.23.227.123-80-ligamen.fr
    FastCgiExternalServer /var/www/clients/client2/web1/cgi-bin/php5-fcgi-94.23.227.123-80-ligamen.fr -idle-timeout 300 -host 127.0.0.1:9010 -pass-header Authorization
    </IfModule>
    <IfModule mod_proxy_fcgi.c>
    #ProxyPassMatch ^/(.*\.php[345]?(/.*)?)$ fcgi://127.0.0.1:9010/var/www/clients/client2/web1/web/$1
    <Directory /var/www/clients/client2/web1/web>
    <FilesMatch "\.php[345]?$">
    SetHandler "proxy:fcgi://127.0.0.1:9010"
    </FilesMatch>
    </Directory>
    </IfModule>



    # add support for apache mpm_itk
    <IfModule mpm_itk_module>
    AssignUserId web1 client2
    </IfModule>

    <IfModule mod_dav_fs.c>
    # Do not execute PHP files in webdav directory
    <Directory /var/www/clients/client2/web1/webdav>
    <ifModule mod_security2.c>
    SecRuleRemoveById 960015
    SecRuleRemoveById 960032
    </ifModule>
    <FilesMatch "\.ph(p3?|tml)$">
    SetHandler None
    </FilesMatch>
    </Directory>
    DavLockDB /var/www/clients/client2/web1/tmp/DavLock
    # DO NOT REMOVE THE COMMENTS!
    # IF YOU REMOVE THEM, WEBDAV WILL NOT WORK ANYMORE!
    # WEBDAV BEGIN
    # WEBDAV END
    </IfModule>



    </VirtualHost>

    [email protected]:~# cat /etc/bind/pri.ligamen.fr
    $TTL 3600
    @ IN SOA ks307144.imsufi.com. afremaux.ligamen.fr. (
    2019011904 ; serial, todays date + todays serial #
    7200 ; refresh, seconds
    540 ; retry, seconds
    604800 ; expire, seconds
    3600 ) ; minimum, seconds
    ;

    imap 3600 A 94.23.227.123
    ligamen.fr. 3600 A 94.23.227.123
    mail 3600 A 94.23.227.123
    pop 3600 A 94.23.227.123
    smtp 3600 A 94.23.227.123
    www 3600 A 94.23.227.123
    ligamen.fr. 3600 MX 10 mail.ligamen.fr.
    ligamen.fr. 3600 NS ks307144.imsufi.com.
    ligamen.fr. 3600 NS ns.kimsufi.com.
    ligamen.fr. 3600 TXT "v=spf1 mx a ~all"


    I can't find the problem
     
  5. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    In ISPConfig, all websites must have * in the IP address box or all websites must have the IP-address there. If you mix the two, you get the problem you currently have.
    There are other ways to get the same problem, but I mentioned a few of them already.
    Those pastes you made would be more readable in CODE tags.
     
  6. kmchen

    kmchen Member

    All websites have the IP address in ISPCONFIG but the apache 000-default original virtualhost had <VirtualHost *:80>. I changed it to the IP address but the problem remains.
    Sorry, I don't see the traditional CODE buton in the editor, see screen capture.
    capture-24.png

    I see also "_default" definitions:
    Code:
    <VirtualHost _default_:8081>
    <VirtualHost 94.23.227.123:80>
            <VirtualHost _default_:443>
    <VirtualHost 94.23.227.123:80>
    <VirtualHost 94.23.227.123:80>
    <VirtualHost 94.23.227.123:80>
    <VirtualHost 94.23.227.123:80>
    <VirtualHost 94.23.227.123:80>
    <VirtualHost 94.23.227.123:80>
    <VirtualHost 94.23.227.123:80>
    <VirtualHost _default_:8080>
    
    I suspect something wrong with the ispconfig update. Can I run the ispconfig-3.1 update.php again to force services reconfiguration ?
     
    Last edited: Jan 21, 2019
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    The default virtual hosts are fine, there is nothing wrong with them according to the output you have posted. When apache is showing the default vhost, then this means that there is no better matching vhost on the same IP. maybe you access the new site by https instead of http and https is not enabled for that site which means that the request must end in the https default vhost.
     
  8. kmchen

    kmchen Member

    No I do access by http and get the http default vhost. I access to all other vhosts (with errors but the correct vhosts are reached). Only ligamen.fr shows the http vhost. You can test it yourself
     
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    I get a "Welcome to Ligamen.fr" page but this does not seem to be the default page of the OS. Are you sure that you don't get to the right site, have you checked access.log of the site when you open the domain in a browser.
     
  10. kmchen

    kmchen Member

    Damned ! For me ligamen.fr leads to OS default page and www.ligamen.fr leads to the expected "Welcome to Ligamen.fr" page (now redirected to ligamen.com) !
    How can the subdomain reach the right vhost and not the domain ?
     
  11. till

    till Super Moderator Staff Member ISPConfig Developer

    Please post the result of the commands:

    hostname
    hostname -f

    from your server.
     
  12. kmchen

    kmchen Member

    ks307144.kimsufi.com
     

Share This Page