Apache Fails to start after trying to install SSL on IPCONFIG3

Discussion in 'Installation/Configuration' started by Evan Pantano, Nov 10, 2020.

  1. Evan Pantano

    Evan Pantano New Member HowtoForge Supporter

    Hi All,
    Ive searched quite extensively before posting to try and figure out my issue to no aval. I am a complete noob when it comes to linux and cmd line stuff. So i'm sure i did something wrong here.

    My server info:
    Ubuntu 20.04.1 LTS

    My Issue:
    I had everything working, websites, email, etc. Even had my SSL configured for the websites. However i wanted to get SSL on the 8080 port that ISPCONFIG uses. So i followed this tutorial
    https://www.howtoforge.com/tutorial/securing-ispconfig-3-with-a-free-lets-encrypt-ssl-certificate/

    After completing the steps apache broke and none of my websites load anymore. I tried deleting the SSL folder in ispconfig and then running the
    "ispconfig_update.sh" cmd. I select stable and then it tells me:
    "There are no updates available for ISPConfig 3.2"

    Do i need to completely reinstall ISPCONFIG? Im not sure what I did wrong, but i have a feeling its something to do with the SSL setup for the 8080 port.

    Please help! Going crazy here.
     
  2. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Check the status of Apache and view the errors there:
    Code:
    systemctl status apache2
    Deleting the SSL folder was not a good idea, it might have made your problems worse.

    What you can try is doing a force update and reconfigure your services:
    Code:
    cd /tmp
    wget https://www.ispconfig.org/downloads/ISPConfig-3.2.tar.gz
    tar xvfz ISPConfig-3.2.tar.gz
    cd ispconfig3_install/install
    php -q update.php
     
  3. Evan Pantano

    Evan Pantano New Member HowtoForge Supporter

    Hi Th0m, thanks for the reply. after running
    Code:
     systemctl status apache2 
    Here is the output.
    Code:
    ‚óŹ apache2.service - The Apache HTTP Server
         Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
         Active: failed (Result: exit-code) since Tue 2020-11-10 20:16:26 UTC; 41min ago
           Docs: https://httpd.apache.org/docs/2.4/
        Process: 5234 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)
    
    Nov 10 20:16:26 ip-172-31-33-213 systemd[1]: Starting The Apache HTTP Server...
    Nov 10 20:16:26 ip-172-31-33-213 apachectl[5247]: AH00548: NameVirtualHost has no effect and will be removed in the >
    Nov 10 20:16:26 ip-172-31-33-213 apachectl[5247]: AH00526: Syntax error on line 63 of /etc/apache2/sites-enabled/000>
    Nov 10 20:16:26 ip-172-31-33-213 apachectl[5247]: SSLCertificateFile: file '/usr/local/ispconfig/interface/ssl/ispse>
    Nov 10 20:16:26 ip-172-31-33-213 apachectl[5234]: Action 'start' failed.
    Nov 10 20:16:26 ip-172-31-33-213 apachectl[5234]: The Apache error log may have more information.
    Nov 10 20:16:26 ip-172-31-33-213 systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
    Nov 10 20:16:26 ip-172-31-33-213 systemd[1]: apache2.service: Failed with result 'exit-code'.
    Nov 10 20:16:26 ip-172-31-33-213 systemd[1]: Failed to start The Apache HTTP Server.
    
    Went through and tried the additional provided steps, when i ran however,
    Code:
    php -q update.php
    I get this error:
    Code:
    >> Update
    
    Operating System: Ubuntu 20.04.1 LTS (Focal Fossa)
    
    PHP Warning:  include_once(/usr/local/ispconfig/server/lib/config.inc.php): failed to open stream: Permission denied in /tmp/ispconfig3_install/install/update.php on line 108
    PHP Warning:  include_once(): Failed opening '/usr/local/ispconfig/server/lib/config.inc.php' for inclusion (include_path='.:/usr/share/php') in /tmp/ispconfig3_install/install/update.php on line 108
    PHP Notice:  Undefined variable: conf in /tmp/ispconfig3_install/install/update.php on line 109
    Unable to resolve [email protected]:/tmp/ispconfig3_install/install$
    
     
  4. Evan Pantano

    Evan Pantano New Member HowtoForge Supporter

    Opps wasnt under root, let me try again.
     
  5. Evan Pantano

    Evan Pantano New Member HowtoForge Supporter

    Okay so I went through the update and at the end it gave me this error.

    Code:
    Updating Crontab
    Restarting services ...
    Job for apache2.service failed because the control process exited with error code.
    See "systemctl status apache2.service" and "journalctl -xe" for details.
    Update finished.
    
     
  6. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Part of the Apache error is off screen, so I can't read it, but I suspect the problem is that the cert file doens't exist. Create the ssl dir which you removed:
    Code:
    mkdir /usr/local/ispconfig/interface/ssl
    and then run
    Code:
    cd /usr/local/ispconfig/interface/ssl/
    mv ispserver.crt ispserver.crt-$(date +"%y%m%d%H%M%S").bak
    mv ispserver.key ispserver.key-$(date +"%y%m%d%H%M%S").bak
    mv ispserver.pem ispserver.pem-$(date +"%y%m%d%H%M%S").bak
    ln -s /etc/letsencrypt/live/host.example.com/fullchain.pem ispserver.crt
    ln -s /etc/letsencrypt/live/host.example.com/privkey.pem ispserver.key
    cat ispserver.{key,crt} > ispserver.pem
    chmod 600 ispserver.pem
    systemctl restart apache2
    Replace host.example.com with the hostname of your server. The second, third, and fourth command should not be necessary if the ssl folder was removed indeed, but I left them in just for sure.
     
  7. Evan Pantano

    Evan Pantano New Member HowtoForge Supporter

    Which error was that? I can repost it in full.

    I followed the further instructions and replaced with my host as below:
    ln -s /etc/letsencrypt/live/ec2-3-137-3-48.us-east-2.compute.amazonaws.com/fullchain.pem ispserver.crt
    ln -s /etc/letsencrypt/live/ec2-3-137-3-48.us-east-2.compute.amazonaws.com/privkey.pem ispserver.key

    Also the SSL folder was there probably from when i ran the update from the first post you sent me so i didnt have to recreate the directory.

    Output after redoing the ssl
    Code:
    systemctl status apache2
    Code:
         Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
         Active: failed (Result: exit-code) since Tue 2020-11-10 22:53:21 UTC; 41s ago
           Docs: https://httpd.apache.org/docs/2.4/
        Process: 15033 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)
    
    Nov 10 22:53:21 ip-172-31-33-213 systemd[1]: Starting The Apache HTTP Server...
    Nov 10 22:53:21 ip-172-31-33-213 apachectl[15046]: AH00526: Syntax error on line 6 of /etc/apache2/sites-enabled/000-apps.vhost:
    Nov 10 22:53:21 ip-172-31-33-213 apachectl[15046]: Listen requires 1 or 2 arguments.
    Nov 10 22:53:21 ip-172-31-33-213 apachectl[15033]: Action 'start' failed.
    Nov 10 22:53:21 ip-172-31-33-213 apachectl[15033]: The Apache error log may have more information.
    Nov 10 22:53:21 ip-172-31-33-213 systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
    Nov 10 22:53:21 ip-172-31-33-213 systemd[1]: apache2.service: Failed with result 'exit-code'.
    Nov 10 22:53:21 ip-172-31-33-213 systemd[1]: Failed to start The Apache HTTP Server.
    
     
  8. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Did you change /etc/apache2/sites-enabled/000-apps.vhost ?

    There is now a error in line 6. Check that and eventually share the content of that file.
     
  9. Evan Pantano

    Evan Pantano New Member HowtoForge Supporter

    Not that i know of. Here is the content of the file.
    Code:
    ######################################################
    # This virtual host contains the configuration
    # for the ISPConfig apps vhost
    ######################################################
    
     Listen
    # NameVirtualHost *:
    
    <VirtualHost _default_:>
      ServerAdmin [email protected]
    
    
      <FilesMatch "\.ph(p3?|tml)$">
        SetHandler None
      </FilesMatch>
    
      # SSL Configuration
      #SSLEngine On
        #SSLProtocol All -SSLv3 -TLSv1 -TLSv1.1
        #SSLCertificateFile /usr/local/ispconfig/interface/ssl/ispserver.crt
      #SSLCertificateKeyFile /usr/local/ispconfig/interface/ssl/ispserver.key
      #SSLCACertificateFile /usr/local/ispconfig/interface/ssl/ispserver.bundle
    
      #SSLCipherSuite ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM>
      #SSLHonorCipherOrder On
    
      <IfModule mod_headers.c>
        # ISPConfig 3.1 currently requires unsafe-line for both scripts and styles, as well as unsafe-eval
        Header set Content-Security-Policy "default-src 'self' 'unsafe-inline' 'unsafe-eval'; img-src 'self' data:; object-src 'none'"
        #Header set Content-Security-Policy "default-src 'self' 'unsafe-inline' 'unsafe-eval'; img-src 'self' data:; object-src 'none'; upgrade-insecure-requests"
        Header set X-Content-Type-Options: nosniff
        Header set X-Frame-Options: SAMEORIGIN
        Header set X-XSS-Protection: "1; mode=block"
        Header always edit Set-Cookie (.*) "$1; HTTPOnly"
        #Header always edit Set-Cookie (.*) "$1; Secure"
        <IfVersion >= 2.4.7>
            Header setifempty Strict-Transport-Security "max-age=15768000"
        </IfVersion>
        <IfVersion < 2.4.7>
            Header set Strict-Transport-Security "max-age=15768000"
        </IfVersion>
        RequestHeader unset Proxy early
      </IfModule>
    
        #SSLUseStapling On
      #SSLStaplingResponderTimeout 5
      #SSLStaplingReturnResponderErrors Off
    
      <IfModule mod_headers.c>
            RequestHeader unset Proxy early
      </IfModule>
    
      <IfModule mod_php5.c>
        DocumentRoot /var/www/apps
        AddType application/x-httpd-php .php
        <Directory /var/www/apps>
                    Options FollowSymLinks
                    AllowOverride None
    
     
  10. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Seems like you removed the port setting from the UI. On line 6, it should be
    Code:
    Listen 8081
    instead of
    Code:
    Listen
    After changing that, try starting apache. Uf it works, set the port in the UI under System -> Server Config -> servername -> Web -> Apps vhost
     
  11. Evan Pantano

    Evan Pantano New Member HowtoForge Supporter

    You are a genuis! Thanks, I set the port under Apps-vhost port to 8081.
     
    Th0m likes this.

Share This Page