apache 2 error

Discussion in 'Installation/Configuration' started by Cobra, Mar 6, 2018.

  1. Cobra

    Cobra New Member

    hey,
    I get this error
    Code:
    Job for apache2.service failed because the control process exited with error code. See "systemctl status apache2.service" and "journalctl -xe" for details.
    I don't know how to fix it.
    Can someone help me

    systemctl status apache2.service:
    Code:
    ● apache2.service - LSB: Apache2 web server
      Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
      Drop-In: /lib/systemd/system/apache2.service.d
      └─apache2-systemd.conf
      Active: failed (Result: exit-code) since Tue 2018-03-06 09:41:22 CET; 6min ag
      Docs: man:systemd-sysv-generator(8)
      Process: 2433 ExecStart=/etc/init.d/apache2 start (code=exited, status=1/FAILU
    
    Mar 06 09:41:22 server apache2[2433]:  *
    Mar 06 09:41:22 server apache2[2433]:  * The apache2 configtest failed.
    Mar 06 09:41:22 server apache2[2433]: Output of config test was:
    Mar 06 09:41:22 server apache2[2433]: apache2: Syntax error on line 216 of /etc/
    Mar 06 09:41:22 server apache2[2433]: Action 'configtest' failed.
    Mar 06 09:41:22 server apache2[2433]: The Apache error log may have more informa
    Mar 06 09:41:22 server systemd[1]: apache2.service: Control process exited, code
    Mar 06 09:41:22 server systemd[1]: Failed to start LSB: Apache2 web server.
    Mar 06 09:41:22 server systemd[1]: apache2.service: Unit entered failed state.
    Mar 06 09:41:22 server systemd[1]: apache2.service: Failed with result 'exit-cod
    ~
    
    Journalctl -xe
    Code:
    root@server:~# journalctl -xe
    Mar 06 09:49:01 server CRON[2856]: pam_unix(cron:session): session opened for user root by (uid=0)
    Mar 06 09:49:01 server CRON[2855]: pam_unix(cron:session): session opened for user root by (uid=0)
    Mar 06 09:49:01 server CRON[2857]: (root) CMD (/usr/local/ispconfig/server/server.sh 2>&1 | while read line; do echo `/bin/date` "$line" >> /var/log/ispconfig/cron.log; done)
    Mar 06 09:49:01 server CRON[2858]: (root) CMD (/usr/local/ispconfig/server/cron.sh 2>&1 | while read line; do echo `/bin/date` "$line" >> /var/log/ispconfig/cron.log; done)
    Mar 06 09:49:02 server CRON[2855]: pam_unix(cron:session): session closed for user root
    Mar 06 09:49:02 server CRON[2856]: pam_unix(cron:session): session closed for user root
    Mar 06 09:49:57 server ntpd[1390]: 162.210.111.4 local addr 192.168.178.68 -> <null>
    Mar 06 09:50:01 server CRON[2899]: pam_unix(cron:session): session opened for user getmail by (uid=0)
    Mar 06 09:50:01 server CRON[2900]: pam_unix(cron:session): session opened for user root by (uid=0)
    Mar 06 09:50:01 server CRON[2901]: pam_unix(cron:session): session opened for user root by (uid=0)
    Mar 06 09:50:01 server CRON[2902]: (root) CMD (/usr/local/ispconfig/server/cron.sh 2>&1 | while read line; do echo `/bin/date` "$line" >> /var/log/ispconfig/cron.log; done)
    Mar 06 09:50:01 server CRON[2904]: (root) CMD (/usr/local/ispconfig/server/server.sh 2>&1 | while read line; do echo `/bin/date` "$line" >> /var/log/ispconfig/cron.log; done)
    Mar 06 09:50:01 server CRON[2906]: (getmail) CMD (/usr/local/bin/run-getmail.sh > /dev/null 2>> /dev/null)
    Mar 06 09:50:01 server CRON[2899]: pam_unix(cron:session): session closed for user getmail
    Mar 06 09:50:01 server CRON[2901]: pam_unix(cron:session): session closed for user root
    Mar 06 09:50:02 server pure-ftpd[2964]: (?@::1) [INFO] New connection from ::1
    Mar 06 09:50:02 server pure-ftpd[2964]: (?@::1) [INFO] Logout.
    Mar 06 09:50:02 server dovecot[1282]: imap-login: Disconnected (disconnected before auth was ready, waited 0 secs): user=<>, rip=::1, lip=::1, secured, session=<DKM3h7pmtLIAAAAAAAAAAAAAAAAA
    Mar 06 09:50:02 server dovecot[1282]: pop3-login: Disconnected (no auth attempts in 0 secs): user=<>, rip=::1, lip=::1, secured, session=<+hQ4h7pmHpMAAAAAAAAAAAAAAAAAAAAB>
    Mar 06 09:50:02 server postfix/smtpd[2966]: connect from localhost[::1]
    Mar 06 09:50:02 server postfix/smtpd[2966]: lost connection after CONNECT from localhost[::1]
    Mar 06 09:50:02 server postfix/smtpd[2966]: disconnect from localhost[::1] commands=0/0
    Mar 06 09:50:02 server CRON[2900]: pam_unix(cron:session): session closed for user root
    Mar 06 09:50:07 server ntpd[1390]: 45.32.4.67 local addr 192.168.178.68 -> <null>
    Mar 06 09:50:09 server ntpd[1390]: 85.199.214.101 local addr 192.168.178.68 -> <null>
    Mar 06 09:50:34 server systemd[1]: Starting LSB: Apache2 web server...
    -- Subject: Unit apache2.service has begun start-up
    -- Defined-By: systemd
    -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
    --
    -- Unit apache2.service has begun starting up.
    Mar 06 09:50:34 server apache2[3039]:  * Starting Apache httpd web server apache2
    Mar 06 09:50:35 server apache2[3039]:  *
    Mar 06 09:50:35 server apache2[3039]:  * The apache2 configtest failed.
    Mar 06 09:50:35 server apache2[3039]: Output of config test was:
    Mar 06 09:50:35 server apache2[3039]: apache2: Syntax error on line 216 of /etc/apache2/apache2.conf: Could not open configuration file /etc/apache2/conf-enabled/squirrelmail.conf: No such
    Mar 06 09:50:35 server apache2[3039]: Action 'configtest' failed.
    Mar 06 09:50:35 server apache2[3039]: The Apache error log may have more information.
    Mar 06 09:50:35 server systemd[1]: apache2.service: Control process exited, code=exited status=1
    Mar 06 09:50:35 server systemd[1]: Failed to start LSB: Apache2 web server.
    -- Subject: Unit apache2.service has failed
    -- Defined-By: systemd
    -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
    --
    -- Unit apache2.service has failed.
    --
    -- The result is failed.
    Mar 06 09:50:35 server systemd[1]: apache2.service: Unit entered failed state.
    Mar 06 09:50:35 server systemd[1]: apache2.service: Failed with result 'exit-code'.
    
     
    Last edited: Mar 6, 2018
  2. jamby

    jamby New Member

    Hi Cobra!

    Your apache2 conf file is not correct: seeing it the error log
    This line is wrong your /etc/apache2/apache.conf file: Syntax error on line 216 <---
    Replace the wrong line and restart apache2 services. I think your server not installed squirrelmail and not have a conf file.
    Delete this line and probable restarting the service.

    Br JaM
     
  3. Cobra

    Cobra New Member

    Thanks it works. But it is strange because i have squirrelmail installed but is does not work. do you have tips?
     

Share This Page