Apache, problem Failed to start LSB: Apache2 web server











up vote
10
down vote

favorite
1












I use Ubuntu 16.02. When i try sudo service apache2 restart, it says:



Job for apache2.service failed because the control process exited with error code. See "systemctl status apache2.service" and "journalctl -xe" for details.


Then I type: journalctl -xe, and request:




--
-- Unit apache2.service has begun starting up.
Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /etc/init.d/apache2: 1: /etc/apache2/envvars: envvars: not found
Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /etc/init.d/apache2: 49: /etc/apache2/envvars: envvars: not found
Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /etc/init.d/apache2: 1: /etc/apache2/envvars: envvars: not found
Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /etc/init.d/apache2: 49: /etc/apache2/envvars: envvars: not found
Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: * Starting Apache httpd web server apache2
Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: *
Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: * The apache2 configtest failed.
Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: Output of config test was:
Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /usr/sbin/apache2ctl: 1: /etc/apache2/envvars: envvars: not found
Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /usr/sbin/apache2ctl: 49: /etc/apache2/envvars: envvars: not found
Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: (2)No such file or directory: AH02291: Cannot access directory '/etc/apache2/logs/' for main error log
Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: AH00014: Configuration check failed
Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: Action 'configtest' failed.
Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: The Apache error log may have more information.
Jan 11 02:30:46 aleksandr-VirtualBox systemd[1]: apache2.service: Control process exited, code=exited status=1
Jan 11 02:30:46 aleksandr-VirtualBox sudo[8171]: pam_unix(sudo:session): session closed for user root
Jan 11 02:30:46 aleksandr-VirtualBox 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.
Jan 11 02:30:46 aleksandr-VirtualBox systemd[1]: apache2.service: Unit entered failed state.
Jan 11 02:30:46 aleksandr-VirtualBox systemd[1]: apache2.service: Failed with result 'exit-code'.
Jan 11 02:33:09 aleksandr-VirtualBox dhclient[792]: DHCPREQUEST of 192.168.56.101 on enp0s8 to 192.168.56.100 port 67 (xid=0x204f076f)
Jan 11 02:33:09 aleksandr-VirtualBox dhclient[792]: DHCPACK of 192.168.56.101 from 192.168.56.100
Jan 11 02:33:09 aleksandr-VirtualBox NetworkManager[619]: [1484073189.4253] address 192.168.56.101
Jan 11 02:33:09 aleksandr-VirtualBox NetworkManager[619]: [1484073189.4260] plen 24 (255.255.255.0)
Jan 11 02:33:09 aleksandr-VirtualBox NetworkManager[619]: [1484073189.4266] server identifier 192.168.56.100
Jan 11 02:33:09 aleksandr-VirtualBox NetworkManager[619]: [1484073189.4273] lease time 1200
Jan 11 02:33:09 aleksandr-VirtualBox NetworkManager[619]: [1484073189.4279] dhcp4 (enp0s8): state changed bound -> bound
Jan 11 02:33:09 aleksandr-VirtualBox dbus[590]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service'
Jan 11 02:33:09 aleksandr-VirtualBox systemd[1]: Starting Network Manager Script Dispatcher Service...
-- Subject: Unit NetworkManager-dispatcher.service has begun start-up
-- Defined-By: systemd
-- Support:
--
-- Unit NetworkManager-dispatcher.service has begun starting up.
Jan 11 02:33:09 aleksandr-VirtualBox dhclient[792]: bound to 192.168.56.101 -- renewal in 559 seconds.
Jan 11 02:33:09 aleksandr-VirtualBox dbus[590]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
Jan 11 02:33:09 aleksandr-VirtualBox systemd[1]: Started Network Manager Script Dispatcher Service.
-- Subject: Unit NetworkManager-dispatcher.service has finished start-up
-- Defined-By: systemd
-- Support:
--
-- Unit NetworkManager-dispatcher.service has finished starting up.
--
-- The start-up result is done.
Jan 11 02:33:09 aleksandr-VirtualBox nm-dispatcher[8205]: req:1 'dhcp4-change' [enp0s8]: new request (1 scripts)
Jan 11 02:33:09 aleksandr-VirtualBox nm-dispatcher[8205]: req:1 'dhcp4-change' [enp0s8]: start running ordered scripts...



And when systemctl status apache2.service It`s reaqest:




* 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 Wed 2017-01-11 02:30:46 +08; 33min ago
Docs: man:systemd-sysv-generator(8)
Process: 8023 ExecStop=/etc/init.d/apache2 stop (code=exited, status=0/SUCCESS)
Process: 2236 ExecReload=/etc/init.d/apache2 reload (code=exited, status=0/SUCCESS)
Process: 8177 ExecStart=/etc/init.d/apache2 start (code=exited, status=1/FAILURE)

Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /usr/sbin/apache2ctl: 1: /etc/apache2/envvars: envvars: not found
Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /usr/sbin/apache2ctl: 49: /etc/apache2/envvars: envvars: not found
Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: (2)No such file or directory: AH02291: Cannot access directory '/etc/apache2/logs/' for main error log
Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: AH00014: Configuration check failed
Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: Action 'configtest' failed.
Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: The Apache error log may have more information.
Jan 11 02:30:46 aleksandr-VirtualBox systemd[1]: apache2.service: Control process exited, code=exited status=1
Jan 11 02:30:46 aleksandr-VirtualBox systemd[1]: Failed to start LSB: Apache2 web server.
Jan 11 02:30:46 aleksandr-VirtualBox systemd[1]: apache2.service: Unit entered failed state.
Jan 11 02:30:46 aleksandr-VirtualBox systemd[1]: apache2.service: Failed with result 'exit-code'.



What is wrong? Where is an interrupt? Please help!










share|improve this question




























    up vote
    10
    down vote

    favorite
    1












    I use Ubuntu 16.02. When i try sudo service apache2 restart, it says:



    Job for apache2.service failed because the control process exited with error code. See "systemctl status apache2.service" and "journalctl -xe" for details.


    Then I type: journalctl -xe, and request:




    --
    -- Unit apache2.service has begun starting up.
    Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /etc/init.d/apache2: 1: /etc/apache2/envvars: envvars: not found
    Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /etc/init.d/apache2: 49: /etc/apache2/envvars: envvars: not found
    Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /etc/init.d/apache2: 1: /etc/apache2/envvars: envvars: not found
    Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /etc/init.d/apache2: 49: /etc/apache2/envvars: envvars: not found
    Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: * Starting Apache httpd web server apache2
    Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: *
    Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: * The apache2 configtest failed.
    Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: Output of config test was:
    Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /usr/sbin/apache2ctl: 1: /etc/apache2/envvars: envvars: not found
    Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /usr/sbin/apache2ctl: 49: /etc/apache2/envvars: envvars: not found
    Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: (2)No such file or directory: AH02291: Cannot access directory '/etc/apache2/logs/' for main error log
    Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: AH00014: Configuration check failed
    Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: Action 'configtest' failed.
    Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: The Apache error log may have more information.
    Jan 11 02:30:46 aleksandr-VirtualBox systemd[1]: apache2.service: Control process exited, code=exited status=1
    Jan 11 02:30:46 aleksandr-VirtualBox sudo[8171]: pam_unix(sudo:session): session closed for user root
    Jan 11 02:30:46 aleksandr-VirtualBox 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.
    Jan 11 02:30:46 aleksandr-VirtualBox systemd[1]: apache2.service: Unit entered failed state.
    Jan 11 02:30:46 aleksandr-VirtualBox systemd[1]: apache2.service: Failed with result 'exit-code'.
    Jan 11 02:33:09 aleksandr-VirtualBox dhclient[792]: DHCPREQUEST of 192.168.56.101 on enp0s8 to 192.168.56.100 port 67 (xid=0x204f076f)
    Jan 11 02:33:09 aleksandr-VirtualBox dhclient[792]: DHCPACK of 192.168.56.101 from 192.168.56.100
    Jan 11 02:33:09 aleksandr-VirtualBox NetworkManager[619]: [1484073189.4253] address 192.168.56.101
    Jan 11 02:33:09 aleksandr-VirtualBox NetworkManager[619]: [1484073189.4260] plen 24 (255.255.255.0)
    Jan 11 02:33:09 aleksandr-VirtualBox NetworkManager[619]: [1484073189.4266] server identifier 192.168.56.100
    Jan 11 02:33:09 aleksandr-VirtualBox NetworkManager[619]: [1484073189.4273] lease time 1200
    Jan 11 02:33:09 aleksandr-VirtualBox NetworkManager[619]: [1484073189.4279] dhcp4 (enp0s8): state changed bound -> bound
    Jan 11 02:33:09 aleksandr-VirtualBox dbus[590]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service'
    Jan 11 02:33:09 aleksandr-VirtualBox systemd[1]: Starting Network Manager Script Dispatcher Service...
    -- Subject: Unit NetworkManager-dispatcher.service has begun start-up
    -- Defined-By: systemd
    -- Support:
    --
    -- Unit NetworkManager-dispatcher.service has begun starting up.
    Jan 11 02:33:09 aleksandr-VirtualBox dhclient[792]: bound to 192.168.56.101 -- renewal in 559 seconds.
    Jan 11 02:33:09 aleksandr-VirtualBox dbus[590]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
    Jan 11 02:33:09 aleksandr-VirtualBox systemd[1]: Started Network Manager Script Dispatcher Service.
    -- Subject: Unit NetworkManager-dispatcher.service has finished start-up
    -- Defined-By: systemd
    -- Support:
    --
    -- Unit NetworkManager-dispatcher.service has finished starting up.
    --
    -- The start-up result is done.
    Jan 11 02:33:09 aleksandr-VirtualBox nm-dispatcher[8205]: req:1 'dhcp4-change' [enp0s8]: new request (1 scripts)
    Jan 11 02:33:09 aleksandr-VirtualBox nm-dispatcher[8205]: req:1 'dhcp4-change' [enp0s8]: start running ordered scripts...



    And when systemctl status apache2.service It`s reaqest:




    * 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 Wed 2017-01-11 02:30:46 +08; 33min ago
    Docs: man:systemd-sysv-generator(8)
    Process: 8023 ExecStop=/etc/init.d/apache2 stop (code=exited, status=0/SUCCESS)
    Process: 2236 ExecReload=/etc/init.d/apache2 reload (code=exited, status=0/SUCCESS)
    Process: 8177 ExecStart=/etc/init.d/apache2 start (code=exited, status=1/FAILURE)

    Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /usr/sbin/apache2ctl: 1: /etc/apache2/envvars: envvars: not found
    Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /usr/sbin/apache2ctl: 49: /etc/apache2/envvars: envvars: not found
    Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: (2)No such file or directory: AH02291: Cannot access directory '/etc/apache2/logs/' for main error log
    Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: AH00014: Configuration check failed
    Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: Action 'configtest' failed.
    Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: The Apache error log may have more information.
    Jan 11 02:30:46 aleksandr-VirtualBox systemd[1]: apache2.service: Control process exited, code=exited status=1
    Jan 11 02:30:46 aleksandr-VirtualBox systemd[1]: Failed to start LSB: Apache2 web server.
    Jan 11 02:30:46 aleksandr-VirtualBox systemd[1]: apache2.service: Unit entered failed state.
    Jan 11 02:30:46 aleksandr-VirtualBox systemd[1]: apache2.service: Failed with result 'exit-code'.



    What is wrong? Where is an interrupt? Please help!










    share|improve this question


























      up vote
      10
      down vote

      favorite
      1









      up vote
      10
      down vote

      favorite
      1






      1





      I use Ubuntu 16.02. When i try sudo service apache2 restart, it says:



      Job for apache2.service failed because the control process exited with error code. See "systemctl status apache2.service" and "journalctl -xe" for details.


      Then I type: journalctl -xe, and request:




      --
      -- Unit apache2.service has begun starting up.
      Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /etc/init.d/apache2: 1: /etc/apache2/envvars: envvars: not found
      Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /etc/init.d/apache2: 49: /etc/apache2/envvars: envvars: not found
      Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /etc/init.d/apache2: 1: /etc/apache2/envvars: envvars: not found
      Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /etc/init.d/apache2: 49: /etc/apache2/envvars: envvars: not found
      Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: * Starting Apache httpd web server apache2
      Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: *
      Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: * The apache2 configtest failed.
      Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: Output of config test was:
      Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /usr/sbin/apache2ctl: 1: /etc/apache2/envvars: envvars: not found
      Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /usr/sbin/apache2ctl: 49: /etc/apache2/envvars: envvars: not found
      Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: (2)No such file or directory: AH02291: Cannot access directory '/etc/apache2/logs/' for main error log
      Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: AH00014: Configuration check failed
      Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: Action 'configtest' failed.
      Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: The Apache error log may have more information.
      Jan 11 02:30:46 aleksandr-VirtualBox systemd[1]: apache2.service: Control process exited, code=exited status=1
      Jan 11 02:30:46 aleksandr-VirtualBox sudo[8171]: pam_unix(sudo:session): session closed for user root
      Jan 11 02:30:46 aleksandr-VirtualBox 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.
      Jan 11 02:30:46 aleksandr-VirtualBox systemd[1]: apache2.service: Unit entered failed state.
      Jan 11 02:30:46 aleksandr-VirtualBox systemd[1]: apache2.service: Failed with result 'exit-code'.
      Jan 11 02:33:09 aleksandr-VirtualBox dhclient[792]: DHCPREQUEST of 192.168.56.101 on enp0s8 to 192.168.56.100 port 67 (xid=0x204f076f)
      Jan 11 02:33:09 aleksandr-VirtualBox dhclient[792]: DHCPACK of 192.168.56.101 from 192.168.56.100
      Jan 11 02:33:09 aleksandr-VirtualBox NetworkManager[619]: [1484073189.4253] address 192.168.56.101
      Jan 11 02:33:09 aleksandr-VirtualBox NetworkManager[619]: [1484073189.4260] plen 24 (255.255.255.0)
      Jan 11 02:33:09 aleksandr-VirtualBox NetworkManager[619]: [1484073189.4266] server identifier 192.168.56.100
      Jan 11 02:33:09 aleksandr-VirtualBox NetworkManager[619]: [1484073189.4273] lease time 1200
      Jan 11 02:33:09 aleksandr-VirtualBox NetworkManager[619]: [1484073189.4279] dhcp4 (enp0s8): state changed bound -> bound
      Jan 11 02:33:09 aleksandr-VirtualBox dbus[590]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service'
      Jan 11 02:33:09 aleksandr-VirtualBox systemd[1]: Starting Network Manager Script Dispatcher Service...
      -- Subject: Unit NetworkManager-dispatcher.service has begun start-up
      -- Defined-By: systemd
      -- Support:
      --
      -- Unit NetworkManager-dispatcher.service has begun starting up.
      Jan 11 02:33:09 aleksandr-VirtualBox dhclient[792]: bound to 192.168.56.101 -- renewal in 559 seconds.
      Jan 11 02:33:09 aleksandr-VirtualBox dbus[590]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
      Jan 11 02:33:09 aleksandr-VirtualBox systemd[1]: Started Network Manager Script Dispatcher Service.
      -- Subject: Unit NetworkManager-dispatcher.service has finished start-up
      -- Defined-By: systemd
      -- Support:
      --
      -- Unit NetworkManager-dispatcher.service has finished starting up.
      --
      -- The start-up result is done.
      Jan 11 02:33:09 aleksandr-VirtualBox nm-dispatcher[8205]: req:1 'dhcp4-change' [enp0s8]: new request (1 scripts)
      Jan 11 02:33:09 aleksandr-VirtualBox nm-dispatcher[8205]: req:1 'dhcp4-change' [enp0s8]: start running ordered scripts...



      And when systemctl status apache2.service It`s reaqest:




      * 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 Wed 2017-01-11 02:30:46 +08; 33min ago
      Docs: man:systemd-sysv-generator(8)
      Process: 8023 ExecStop=/etc/init.d/apache2 stop (code=exited, status=0/SUCCESS)
      Process: 2236 ExecReload=/etc/init.d/apache2 reload (code=exited, status=0/SUCCESS)
      Process: 8177 ExecStart=/etc/init.d/apache2 start (code=exited, status=1/FAILURE)

      Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /usr/sbin/apache2ctl: 1: /etc/apache2/envvars: envvars: not found
      Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /usr/sbin/apache2ctl: 49: /etc/apache2/envvars: envvars: not found
      Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: (2)No such file or directory: AH02291: Cannot access directory '/etc/apache2/logs/' for main error log
      Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: AH00014: Configuration check failed
      Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: Action 'configtest' failed.
      Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: The Apache error log may have more information.
      Jan 11 02:30:46 aleksandr-VirtualBox systemd[1]: apache2.service: Control process exited, code=exited status=1
      Jan 11 02:30:46 aleksandr-VirtualBox systemd[1]: Failed to start LSB: Apache2 web server.
      Jan 11 02:30:46 aleksandr-VirtualBox systemd[1]: apache2.service: Unit entered failed state.
      Jan 11 02:30:46 aleksandr-VirtualBox systemd[1]: apache2.service: Failed with result 'exit-code'.



      What is wrong? Where is an interrupt? Please help!










      share|improve this question















      I use Ubuntu 16.02. When i try sudo service apache2 restart, it says:



      Job for apache2.service failed because the control process exited with error code. See "systemctl status apache2.service" and "journalctl -xe" for details.


      Then I type: journalctl -xe, and request:




      --
      -- Unit apache2.service has begun starting up.
      Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /etc/init.d/apache2: 1: /etc/apache2/envvars: envvars: not found
      Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /etc/init.d/apache2: 49: /etc/apache2/envvars: envvars: not found
      Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /etc/init.d/apache2: 1: /etc/apache2/envvars: envvars: not found
      Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /etc/init.d/apache2: 49: /etc/apache2/envvars: envvars: not found
      Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: * Starting Apache httpd web server apache2
      Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: *
      Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: * The apache2 configtest failed.
      Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: Output of config test was:
      Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /usr/sbin/apache2ctl: 1: /etc/apache2/envvars: envvars: not found
      Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /usr/sbin/apache2ctl: 49: /etc/apache2/envvars: envvars: not found
      Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: (2)No such file or directory: AH02291: Cannot access directory '/etc/apache2/logs/' for main error log
      Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: AH00014: Configuration check failed
      Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: Action 'configtest' failed.
      Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: The Apache error log may have more information.
      Jan 11 02:30:46 aleksandr-VirtualBox systemd[1]: apache2.service: Control process exited, code=exited status=1
      Jan 11 02:30:46 aleksandr-VirtualBox sudo[8171]: pam_unix(sudo:session): session closed for user root
      Jan 11 02:30:46 aleksandr-VirtualBox 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.
      Jan 11 02:30:46 aleksandr-VirtualBox systemd[1]: apache2.service: Unit entered failed state.
      Jan 11 02:30:46 aleksandr-VirtualBox systemd[1]: apache2.service: Failed with result 'exit-code'.
      Jan 11 02:33:09 aleksandr-VirtualBox dhclient[792]: DHCPREQUEST of 192.168.56.101 on enp0s8 to 192.168.56.100 port 67 (xid=0x204f076f)
      Jan 11 02:33:09 aleksandr-VirtualBox dhclient[792]: DHCPACK of 192.168.56.101 from 192.168.56.100
      Jan 11 02:33:09 aleksandr-VirtualBox NetworkManager[619]: [1484073189.4253] address 192.168.56.101
      Jan 11 02:33:09 aleksandr-VirtualBox NetworkManager[619]: [1484073189.4260] plen 24 (255.255.255.0)
      Jan 11 02:33:09 aleksandr-VirtualBox NetworkManager[619]: [1484073189.4266] server identifier 192.168.56.100
      Jan 11 02:33:09 aleksandr-VirtualBox NetworkManager[619]: [1484073189.4273] lease time 1200
      Jan 11 02:33:09 aleksandr-VirtualBox NetworkManager[619]: [1484073189.4279] dhcp4 (enp0s8): state changed bound -> bound
      Jan 11 02:33:09 aleksandr-VirtualBox dbus[590]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service'
      Jan 11 02:33:09 aleksandr-VirtualBox systemd[1]: Starting Network Manager Script Dispatcher Service...
      -- Subject: Unit NetworkManager-dispatcher.service has begun start-up
      -- Defined-By: systemd
      -- Support:
      --
      -- Unit NetworkManager-dispatcher.service has begun starting up.
      Jan 11 02:33:09 aleksandr-VirtualBox dhclient[792]: bound to 192.168.56.101 -- renewal in 559 seconds.
      Jan 11 02:33:09 aleksandr-VirtualBox dbus[590]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'
      Jan 11 02:33:09 aleksandr-VirtualBox systemd[1]: Started Network Manager Script Dispatcher Service.
      -- Subject: Unit NetworkManager-dispatcher.service has finished start-up
      -- Defined-By: systemd
      -- Support:
      --
      -- Unit NetworkManager-dispatcher.service has finished starting up.
      --
      -- The start-up result is done.
      Jan 11 02:33:09 aleksandr-VirtualBox nm-dispatcher[8205]: req:1 'dhcp4-change' [enp0s8]: new request (1 scripts)
      Jan 11 02:33:09 aleksandr-VirtualBox nm-dispatcher[8205]: req:1 'dhcp4-change' [enp0s8]: start running ordered scripts...



      And when systemctl status apache2.service It`s reaqest:




      * 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 Wed 2017-01-11 02:30:46 +08; 33min ago
      Docs: man:systemd-sysv-generator(8)
      Process: 8023 ExecStop=/etc/init.d/apache2 stop (code=exited, status=0/SUCCESS)
      Process: 2236 ExecReload=/etc/init.d/apache2 reload (code=exited, status=0/SUCCESS)
      Process: 8177 ExecStart=/etc/init.d/apache2 start (code=exited, status=1/FAILURE)

      Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /usr/sbin/apache2ctl: 1: /etc/apache2/envvars: envvars: not found
      Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /usr/sbin/apache2ctl: 49: /etc/apache2/envvars: envvars: not found
      Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: (2)No such file or directory: AH02291: Cannot access directory '/etc/apache2/logs/' for main error log
      Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: AH00014: Configuration check failed
      Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: Action 'configtest' failed.
      Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: The Apache error log may have more information.
      Jan 11 02:30:46 aleksandr-VirtualBox systemd[1]: apache2.service: Control process exited, code=exited status=1
      Jan 11 02:30:46 aleksandr-VirtualBox systemd[1]: Failed to start LSB: Apache2 web server.
      Jan 11 02:30:46 aleksandr-VirtualBox systemd[1]: apache2.service: Unit entered failed state.
      Jan 11 02:30:46 aleksandr-VirtualBox systemd[1]: apache2.service: Failed with result 'exit-code'.



      What is wrong? Where is an interrupt? Please help!







      apache2






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 11 '17 at 8:34









      d a i s y

      3,24482244




      3,24482244










      asked Jan 10 '17 at 19:11









      A.Verber

      53114




      53114






















          4 Answers
          4






          active

          oldest

          votes

















          up vote
          6
          down vote



          accepted










          There are two errors:





          1. For some reason your /etc/apache2/envvars is missing:





          • from journalctl -xe:



            Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /etc/init.d/apache2: 1: /etc/apache2/envvars: envvars: not found
            Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /etc/init.d/apache2: 49: /etc/apache2/envvars: envvars: not found
            Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /etc/init.d/apache2: 1: /etc/apache2/envvars: envvars: not found
            Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /etc/init.d/apache2: 49: /etc/apache2/envvars: envvars: not found
            ...
            Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /usr/sbin/apache2ctl: 1: /etc/apache2/envvars: envvars: not found
            Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /usr/sbin/apache2ctl: 49: /etc/apache2/envvars: envvars: not found



          • from systemctl status apache2.service:



            Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /usr/sbin/apache2ctl: 1: /etc/apache2/envvars: envvars: not found
            Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /usr/sbin/apache2ctl: 49: /etc/apache2/envvars: envvars: not found



          In my system this file has next permissions:



          $ ls -l /etc/apache2/envvars

          -rw-r--r-- 1 root root 1782 мар 19 2016 envvars


          And its content ($ cat /etc/apache2/envvars) is:



          # envvars - default environment variables for apache2ctl

          # this won't be correct after changing uid
          unset HOME

          # for supporting multiple apache2 instances
          if [ "${APACHE_CONFDIR##/etc/apache2-}" != "${APACHE_CONFDIR}" ] ; then
          SUFFIX="-${APACHE_CONFDIR##/etc/apache2-}"
          else
          SUFFIX=
          fi

          # Since there is no sane way to get the parsed apache2 config in scripts, some
          # settings are defined via environment variables and then used in apache2ctl,
          # /etc/init.d/apache2, /etc/logrotate.d/apache2, etc.
          export APACHE_RUN_USER=www-data
          export APACHE_RUN_GROUP=www-data
          # temporary state file location. This might be changed to /run in Wheezy+1
          export APACHE_PID_FILE=/var/run/apache2/apache2$SUFFIX.pid
          export APACHE_RUN_DIR=/var/run/apache2$SUFFIX
          export APACHE_LOCK_DIR=/var/lock/apache2$SUFFIX
          # Only /var/log/apache2 is handled by /etc/logrotate.d/apache2.
          export APACHE_LOG_DIR=/var/log/apache2$SUFFIX

          ## The locale used by some modules like mod_dav
          export LANG=C
          ## Uncomment the following line to use the system default locale instead:
          #. /etc/default/locale

          export LANG

          ## The command to get the status for 'apache2ctl status'.
          ## Some packages providing 'www-browser' need '--dump' instead of '-dump'.
          #export APACHE_LYNX='www-browser -dump'

          ## If you need a higher file descriptor limit, uncomment and adjust the
          ## following line (default is 8192):
          #APACHE_ULIMIT_MAX_FILES='ulimit -n 65536'

          ## If you would like to pass arguments to the web server, add them below
          ## to the APACHE_ARGUMENTS environment.
          #export APACHE_ARGUMENTS=''

          ## Enable the debug mode for maintainer scripts.
          ## This will produce a verbose output on package installations of web server mod ules and web application
          ## installations which interact with Apache
          #export APACHE2_MAINTSCRIPT_DEBUG=1


          You can create it manually: sudo nano /etc/apache2/envvars, paste above content inside, save ctrl+o and exit ctrl+x.





          2. In your system, the folder /etc/apache2/logs also missing:





          • from journalctl -xe:



            Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: (2)No such file or directory: AH02291: Cannot access directory '/etc/apache2/logs/' for main error log



          • from systemctl status apache2.service:



            Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: (2)No such file or directory: AH02291: Cannot access directory '/etc/apache2/logs/' for main error log



          This is not the default log folder, it is defined in your custom configuration, and must be created:



          $ sudo mkdir /etc/apache2/logs





          share|improve this answer























          • I did as you wrote. Unfortunately, error still exist :( So will continue searching
            – A.Verber
            Jan 10 '17 at 20:01










          • @A.Verber Is still the same error or something has changed?
            – pa4080
            Jan 10 '17 at 20:05












          • @A.Verber I'm have looked again your question. Is in your system the directory /etc/apache2/logs/ exists? Because this is the second error message. You can try sudo mkdir /etc/apache2/logs.
            – pa4080
            Jan 10 '17 at 20:29








          • 1




            Yes! After making log dir, error disappeared! Thank you
            – A.Verber
            Jan 11 '17 at 6:32


















          up vote
          5
          down vote













          I deleted .conf files in sites-available and did not delete the link files in sites- enabled .



          Now I deleted those all files in sites-enabled



          restarted apache2 server (sudo service apache2 restart)



          worked for me



          hope this might help someone :)






          share|improve this answer





















          • helped me! thx..
            – Occam's Razor
            Nov 7 '17 at 19:35


















          up vote
          4
          down vote













          Try these commands:



          sudo a2dismod mpm_event
          sudo a2enmod mpm_prefork


          Then restart apache2 service.






          share|improve this answer























          • sudo a2dismod mpm_event sudo a2enmod mpm_prefork
            – arnauld
            Apr 7 '17 at 14:47


















          up vote
          3
          down vote













          I had the same problem. I got the same error with sudo service apache2 restart and ran sudo systemctl status apache2.service and the red line was Failed to start LSB: Apache2 web server.



          Solution



          run the bellow command:



          sudo apache2ctl configtest


          It'll check for errors (Syntax errors I think) and then you can debug the error.






          share|improve this answer





















            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "89"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f870356%2fapache-problem-failed-to-start-lsb-apache2-web-server%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            4 Answers
            4






            active

            oldest

            votes








            4 Answers
            4






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            6
            down vote



            accepted










            There are two errors:





            1. For some reason your /etc/apache2/envvars is missing:





            • from journalctl -xe:



              Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /etc/init.d/apache2: 1: /etc/apache2/envvars: envvars: not found
              Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /etc/init.d/apache2: 49: /etc/apache2/envvars: envvars: not found
              Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /etc/init.d/apache2: 1: /etc/apache2/envvars: envvars: not found
              Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /etc/init.d/apache2: 49: /etc/apache2/envvars: envvars: not found
              ...
              Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /usr/sbin/apache2ctl: 1: /etc/apache2/envvars: envvars: not found
              Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /usr/sbin/apache2ctl: 49: /etc/apache2/envvars: envvars: not found



            • from systemctl status apache2.service:



              Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /usr/sbin/apache2ctl: 1: /etc/apache2/envvars: envvars: not found
              Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /usr/sbin/apache2ctl: 49: /etc/apache2/envvars: envvars: not found



            In my system this file has next permissions:



            $ ls -l /etc/apache2/envvars

            -rw-r--r-- 1 root root 1782 мар 19 2016 envvars


            And its content ($ cat /etc/apache2/envvars) is:



            # envvars - default environment variables for apache2ctl

            # this won't be correct after changing uid
            unset HOME

            # for supporting multiple apache2 instances
            if [ "${APACHE_CONFDIR##/etc/apache2-}" != "${APACHE_CONFDIR}" ] ; then
            SUFFIX="-${APACHE_CONFDIR##/etc/apache2-}"
            else
            SUFFIX=
            fi

            # Since there is no sane way to get the parsed apache2 config in scripts, some
            # settings are defined via environment variables and then used in apache2ctl,
            # /etc/init.d/apache2, /etc/logrotate.d/apache2, etc.
            export APACHE_RUN_USER=www-data
            export APACHE_RUN_GROUP=www-data
            # temporary state file location. This might be changed to /run in Wheezy+1
            export APACHE_PID_FILE=/var/run/apache2/apache2$SUFFIX.pid
            export APACHE_RUN_DIR=/var/run/apache2$SUFFIX
            export APACHE_LOCK_DIR=/var/lock/apache2$SUFFIX
            # Only /var/log/apache2 is handled by /etc/logrotate.d/apache2.
            export APACHE_LOG_DIR=/var/log/apache2$SUFFIX

            ## The locale used by some modules like mod_dav
            export LANG=C
            ## Uncomment the following line to use the system default locale instead:
            #. /etc/default/locale

            export LANG

            ## The command to get the status for 'apache2ctl status'.
            ## Some packages providing 'www-browser' need '--dump' instead of '-dump'.
            #export APACHE_LYNX='www-browser -dump'

            ## If you need a higher file descriptor limit, uncomment and adjust the
            ## following line (default is 8192):
            #APACHE_ULIMIT_MAX_FILES='ulimit -n 65536'

            ## If you would like to pass arguments to the web server, add them below
            ## to the APACHE_ARGUMENTS environment.
            #export APACHE_ARGUMENTS=''

            ## Enable the debug mode for maintainer scripts.
            ## This will produce a verbose output on package installations of web server mod ules and web application
            ## installations which interact with Apache
            #export APACHE2_MAINTSCRIPT_DEBUG=1


            You can create it manually: sudo nano /etc/apache2/envvars, paste above content inside, save ctrl+o and exit ctrl+x.





            2. In your system, the folder /etc/apache2/logs also missing:





            • from journalctl -xe:



              Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: (2)No such file or directory: AH02291: Cannot access directory '/etc/apache2/logs/' for main error log



            • from systemctl status apache2.service:



              Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: (2)No such file or directory: AH02291: Cannot access directory '/etc/apache2/logs/' for main error log



            This is not the default log folder, it is defined in your custom configuration, and must be created:



            $ sudo mkdir /etc/apache2/logs





            share|improve this answer























            • I did as you wrote. Unfortunately, error still exist :( So will continue searching
              – A.Verber
              Jan 10 '17 at 20:01










            • @A.Verber Is still the same error or something has changed?
              – pa4080
              Jan 10 '17 at 20:05












            • @A.Verber I'm have looked again your question. Is in your system the directory /etc/apache2/logs/ exists? Because this is the second error message. You can try sudo mkdir /etc/apache2/logs.
              – pa4080
              Jan 10 '17 at 20:29








            • 1




              Yes! After making log dir, error disappeared! Thank you
              – A.Verber
              Jan 11 '17 at 6:32















            up vote
            6
            down vote



            accepted










            There are two errors:





            1. For some reason your /etc/apache2/envvars is missing:





            • from journalctl -xe:



              Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /etc/init.d/apache2: 1: /etc/apache2/envvars: envvars: not found
              Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /etc/init.d/apache2: 49: /etc/apache2/envvars: envvars: not found
              Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /etc/init.d/apache2: 1: /etc/apache2/envvars: envvars: not found
              Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /etc/init.d/apache2: 49: /etc/apache2/envvars: envvars: not found
              ...
              Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /usr/sbin/apache2ctl: 1: /etc/apache2/envvars: envvars: not found
              Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /usr/sbin/apache2ctl: 49: /etc/apache2/envvars: envvars: not found



            • from systemctl status apache2.service:



              Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /usr/sbin/apache2ctl: 1: /etc/apache2/envvars: envvars: not found
              Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /usr/sbin/apache2ctl: 49: /etc/apache2/envvars: envvars: not found



            In my system this file has next permissions:



            $ ls -l /etc/apache2/envvars

            -rw-r--r-- 1 root root 1782 мар 19 2016 envvars


            And its content ($ cat /etc/apache2/envvars) is:



            # envvars - default environment variables for apache2ctl

            # this won't be correct after changing uid
            unset HOME

            # for supporting multiple apache2 instances
            if [ "${APACHE_CONFDIR##/etc/apache2-}" != "${APACHE_CONFDIR}" ] ; then
            SUFFIX="-${APACHE_CONFDIR##/etc/apache2-}"
            else
            SUFFIX=
            fi

            # Since there is no sane way to get the parsed apache2 config in scripts, some
            # settings are defined via environment variables and then used in apache2ctl,
            # /etc/init.d/apache2, /etc/logrotate.d/apache2, etc.
            export APACHE_RUN_USER=www-data
            export APACHE_RUN_GROUP=www-data
            # temporary state file location. This might be changed to /run in Wheezy+1
            export APACHE_PID_FILE=/var/run/apache2/apache2$SUFFIX.pid
            export APACHE_RUN_DIR=/var/run/apache2$SUFFIX
            export APACHE_LOCK_DIR=/var/lock/apache2$SUFFIX
            # Only /var/log/apache2 is handled by /etc/logrotate.d/apache2.
            export APACHE_LOG_DIR=/var/log/apache2$SUFFIX

            ## The locale used by some modules like mod_dav
            export LANG=C
            ## Uncomment the following line to use the system default locale instead:
            #. /etc/default/locale

            export LANG

            ## The command to get the status for 'apache2ctl status'.
            ## Some packages providing 'www-browser' need '--dump' instead of '-dump'.
            #export APACHE_LYNX='www-browser -dump'

            ## If you need a higher file descriptor limit, uncomment and adjust the
            ## following line (default is 8192):
            #APACHE_ULIMIT_MAX_FILES='ulimit -n 65536'

            ## If you would like to pass arguments to the web server, add them below
            ## to the APACHE_ARGUMENTS environment.
            #export APACHE_ARGUMENTS=''

            ## Enable the debug mode for maintainer scripts.
            ## This will produce a verbose output on package installations of web server mod ules and web application
            ## installations which interact with Apache
            #export APACHE2_MAINTSCRIPT_DEBUG=1


            You can create it manually: sudo nano /etc/apache2/envvars, paste above content inside, save ctrl+o and exit ctrl+x.





            2. In your system, the folder /etc/apache2/logs also missing:





            • from journalctl -xe:



              Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: (2)No such file or directory: AH02291: Cannot access directory '/etc/apache2/logs/' for main error log



            • from systemctl status apache2.service:



              Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: (2)No such file or directory: AH02291: Cannot access directory '/etc/apache2/logs/' for main error log



            This is not the default log folder, it is defined in your custom configuration, and must be created:



            $ sudo mkdir /etc/apache2/logs





            share|improve this answer























            • I did as you wrote. Unfortunately, error still exist :( So will continue searching
              – A.Verber
              Jan 10 '17 at 20:01










            • @A.Verber Is still the same error or something has changed?
              – pa4080
              Jan 10 '17 at 20:05












            • @A.Verber I'm have looked again your question. Is in your system the directory /etc/apache2/logs/ exists? Because this is the second error message. You can try sudo mkdir /etc/apache2/logs.
              – pa4080
              Jan 10 '17 at 20:29








            • 1




              Yes! After making log dir, error disappeared! Thank you
              – A.Verber
              Jan 11 '17 at 6:32













            up vote
            6
            down vote



            accepted







            up vote
            6
            down vote



            accepted






            There are two errors:





            1. For some reason your /etc/apache2/envvars is missing:





            • from journalctl -xe:



              Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /etc/init.d/apache2: 1: /etc/apache2/envvars: envvars: not found
              Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /etc/init.d/apache2: 49: /etc/apache2/envvars: envvars: not found
              Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /etc/init.d/apache2: 1: /etc/apache2/envvars: envvars: not found
              Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /etc/init.d/apache2: 49: /etc/apache2/envvars: envvars: not found
              ...
              Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /usr/sbin/apache2ctl: 1: /etc/apache2/envvars: envvars: not found
              Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /usr/sbin/apache2ctl: 49: /etc/apache2/envvars: envvars: not found



            • from systemctl status apache2.service:



              Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /usr/sbin/apache2ctl: 1: /etc/apache2/envvars: envvars: not found
              Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /usr/sbin/apache2ctl: 49: /etc/apache2/envvars: envvars: not found



            In my system this file has next permissions:



            $ ls -l /etc/apache2/envvars

            -rw-r--r-- 1 root root 1782 мар 19 2016 envvars


            And its content ($ cat /etc/apache2/envvars) is:



            # envvars - default environment variables for apache2ctl

            # this won't be correct after changing uid
            unset HOME

            # for supporting multiple apache2 instances
            if [ "${APACHE_CONFDIR##/etc/apache2-}" != "${APACHE_CONFDIR}" ] ; then
            SUFFIX="-${APACHE_CONFDIR##/etc/apache2-}"
            else
            SUFFIX=
            fi

            # Since there is no sane way to get the parsed apache2 config in scripts, some
            # settings are defined via environment variables and then used in apache2ctl,
            # /etc/init.d/apache2, /etc/logrotate.d/apache2, etc.
            export APACHE_RUN_USER=www-data
            export APACHE_RUN_GROUP=www-data
            # temporary state file location. This might be changed to /run in Wheezy+1
            export APACHE_PID_FILE=/var/run/apache2/apache2$SUFFIX.pid
            export APACHE_RUN_DIR=/var/run/apache2$SUFFIX
            export APACHE_LOCK_DIR=/var/lock/apache2$SUFFIX
            # Only /var/log/apache2 is handled by /etc/logrotate.d/apache2.
            export APACHE_LOG_DIR=/var/log/apache2$SUFFIX

            ## The locale used by some modules like mod_dav
            export LANG=C
            ## Uncomment the following line to use the system default locale instead:
            #. /etc/default/locale

            export LANG

            ## The command to get the status for 'apache2ctl status'.
            ## Some packages providing 'www-browser' need '--dump' instead of '-dump'.
            #export APACHE_LYNX='www-browser -dump'

            ## If you need a higher file descriptor limit, uncomment and adjust the
            ## following line (default is 8192):
            #APACHE_ULIMIT_MAX_FILES='ulimit -n 65536'

            ## If you would like to pass arguments to the web server, add them below
            ## to the APACHE_ARGUMENTS environment.
            #export APACHE_ARGUMENTS=''

            ## Enable the debug mode for maintainer scripts.
            ## This will produce a verbose output on package installations of web server mod ules and web application
            ## installations which interact with Apache
            #export APACHE2_MAINTSCRIPT_DEBUG=1


            You can create it manually: sudo nano /etc/apache2/envvars, paste above content inside, save ctrl+o and exit ctrl+x.





            2. In your system, the folder /etc/apache2/logs also missing:





            • from journalctl -xe:



              Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: (2)No such file or directory: AH02291: Cannot access directory '/etc/apache2/logs/' for main error log



            • from systemctl status apache2.service:



              Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: (2)No such file or directory: AH02291: Cannot access directory '/etc/apache2/logs/' for main error log



            This is not the default log folder, it is defined in your custom configuration, and must be created:



            $ sudo mkdir /etc/apache2/logs





            share|improve this answer














            There are two errors:





            1. For some reason your /etc/apache2/envvars is missing:





            • from journalctl -xe:



              Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /etc/init.d/apache2: 1: /etc/apache2/envvars: envvars: not found
              Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /etc/init.d/apache2: 49: /etc/apache2/envvars: envvars: not found
              Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /etc/init.d/apache2: 1: /etc/apache2/envvars: envvars: not found
              Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /etc/init.d/apache2: 49: /etc/apache2/envvars: envvars: not found
              ...
              Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /usr/sbin/apache2ctl: 1: /etc/apache2/envvars: envvars: not found
              Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /usr/sbin/apache2ctl: 49: /etc/apache2/envvars: envvars: not found



            • from systemctl status apache2.service:



              Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /usr/sbin/apache2ctl: 1: /etc/apache2/envvars: envvars: not found
              Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: /usr/sbin/apache2ctl: 49: /etc/apache2/envvars: envvars: not found



            In my system this file has next permissions:



            $ ls -l /etc/apache2/envvars

            -rw-r--r-- 1 root root 1782 мар 19 2016 envvars


            And its content ($ cat /etc/apache2/envvars) is:



            # envvars - default environment variables for apache2ctl

            # this won't be correct after changing uid
            unset HOME

            # for supporting multiple apache2 instances
            if [ "${APACHE_CONFDIR##/etc/apache2-}" != "${APACHE_CONFDIR}" ] ; then
            SUFFIX="-${APACHE_CONFDIR##/etc/apache2-}"
            else
            SUFFIX=
            fi

            # Since there is no sane way to get the parsed apache2 config in scripts, some
            # settings are defined via environment variables and then used in apache2ctl,
            # /etc/init.d/apache2, /etc/logrotate.d/apache2, etc.
            export APACHE_RUN_USER=www-data
            export APACHE_RUN_GROUP=www-data
            # temporary state file location. This might be changed to /run in Wheezy+1
            export APACHE_PID_FILE=/var/run/apache2/apache2$SUFFIX.pid
            export APACHE_RUN_DIR=/var/run/apache2$SUFFIX
            export APACHE_LOCK_DIR=/var/lock/apache2$SUFFIX
            # Only /var/log/apache2 is handled by /etc/logrotate.d/apache2.
            export APACHE_LOG_DIR=/var/log/apache2$SUFFIX

            ## The locale used by some modules like mod_dav
            export LANG=C
            ## Uncomment the following line to use the system default locale instead:
            #. /etc/default/locale

            export LANG

            ## The command to get the status for 'apache2ctl status'.
            ## Some packages providing 'www-browser' need '--dump' instead of '-dump'.
            #export APACHE_LYNX='www-browser -dump'

            ## If you need a higher file descriptor limit, uncomment and adjust the
            ## following line (default is 8192):
            #APACHE_ULIMIT_MAX_FILES='ulimit -n 65536'

            ## If you would like to pass arguments to the web server, add them below
            ## to the APACHE_ARGUMENTS environment.
            #export APACHE_ARGUMENTS=''

            ## Enable the debug mode for maintainer scripts.
            ## This will produce a verbose output on package installations of web server mod ules and web application
            ## installations which interact with Apache
            #export APACHE2_MAINTSCRIPT_DEBUG=1


            You can create it manually: sudo nano /etc/apache2/envvars, paste above content inside, save ctrl+o and exit ctrl+x.





            2. In your system, the folder /etc/apache2/logs also missing:





            • from journalctl -xe:



              Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: (2)No such file or directory: AH02291: Cannot access directory '/etc/apache2/logs/' for main error log



            • from systemctl status apache2.service:



              Jan 11 02:30:46 aleksandr-VirtualBox apache2[8177]: (2)No such file or directory: AH02291: Cannot access directory '/etc/apache2/logs/' for main error log



            This is not the default log folder, it is defined in your custom configuration, and must be created:



            $ sudo mkdir /etc/apache2/logs






            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Jul 13 '17 at 8:25

























            answered Jan 10 '17 at 19:29









            pa4080

            13.2k52561




            13.2k52561












            • I did as you wrote. Unfortunately, error still exist :( So will continue searching
              – A.Verber
              Jan 10 '17 at 20:01










            • @A.Verber Is still the same error or something has changed?
              – pa4080
              Jan 10 '17 at 20:05












            • @A.Verber I'm have looked again your question. Is in your system the directory /etc/apache2/logs/ exists? Because this is the second error message. You can try sudo mkdir /etc/apache2/logs.
              – pa4080
              Jan 10 '17 at 20:29








            • 1




              Yes! After making log dir, error disappeared! Thank you
              – A.Verber
              Jan 11 '17 at 6:32


















            • I did as you wrote. Unfortunately, error still exist :( So will continue searching
              – A.Verber
              Jan 10 '17 at 20:01










            • @A.Verber Is still the same error or something has changed?
              – pa4080
              Jan 10 '17 at 20:05












            • @A.Verber I'm have looked again your question. Is in your system the directory /etc/apache2/logs/ exists? Because this is the second error message. You can try sudo mkdir /etc/apache2/logs.
              – pa4080
              Jan 10 '17 at 20:29








            • 1




              Yes! After making log dir, error disappeared! Thank you
              – A.Verber
              Jan 11 '17 at 6:32
















            I did as you wrote. Unfortunately, error still exist :( So will continue searching
            – A.Verber
            Jan 10 '17 at 20:01




            I did as you wrote. Unfortunately, error still exist :( So will continue searching
            – A.Verber
            Jan 10 '17 at 20:01












            @A.Verber Is still the same error or something has changed?
            – pa4080
            Jan 10 '17 at 20:05






            @A.Verber Is still the same error or something has changed?
            – pa4080
            Jan 10 '17 at 20:05














            @A.Verber I'm have looked again your question. Is in your system the directory /etc/apache2/logs/ exists? Because this is the second error message. You can try sudo mkdir /etc/apache2/logs.
            – pa4080
            Jan 10 '17 at 20:29






            @A.Verber I'm have looked again your question. Is in your system the directory /etc/apache2/logs/ exists? Because this is the second error message. You can try sudo mkdir /etc/apache2/logs.
            – pa4080
            Jan 10 '17 at 20:29






            1




            1




            Yes! After making log dir, error disappeared! Thank you
            – A.Verber
            Jan 11 '17 at 6:32




            Yes! After making log dir, error disappeared! Thank you
            – A.Verber
            Jan 11 '17 at 6:32












            up vote
            5
            down vote













            I deleted .conf files in sites-available and did not delete the link files in sites- enabled .



            Now I deleted those all files in sites-enabled



            restarted apache2 server (sudo service apache2 restart)



            worked for me



            hope this might help someone :)






            share|improve this answer





















            • helped me! thx..
              – Occam's Razor
              Nov 7 '17 at 19:35















            up vote
            5
            down vote













            I deleted .conf files in sites-available and did not delete the link files in sites- enabled .



            Now I deleted those all files in sites-enabled



            restarted apache2 server (sudo service apache2 restart)



            worked for me



            hope this might help someone :)






            share|improve this answer





















            • helped me! thx..
              – Occam's Razor
              Nov 7 '17 at 19:35













            up vote
            5
            down vote










            up vote
            5
            down vote









            I deleted .conf files in sites-available and did not delete the link files in sites- enabled .



            Now I deleted those all files in sites-enabled



            restarted apache2 server (sudo service apache2 restart)



            worked for me



            hope this might help someone :)






            share|improve this answer












            I deleted .conf files in sites-available and did not delete the link files in sites- enabled .



            Now I deleted those all files in sites-enabled



            restarted apache2 server (sudo service apache2 restart)



            worked for me



            hope this might help someone :)







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Aug 17 '17 at 4:23









            Soundarya

            5111




            5111












            • helped me! thx..
              – Occam's Razor
              Nov 7 '17 at 19:35


















            • helped me! thx..
              – Occam's Razor
              Nov 7 '17 at 19:35
















            helped me! thx..
            – Occam's Razor
            Nov 7 '17 at 19:35




            helped me! thx..
            – Occam's Razor
            Nov 7 '17 at 19:35










            up vote
            4
            down vote













            Try these commands:



            sudo a2dismod mpm_event
            sudo a2enmod mpm_prefork


            Then restart apache2 service.






            share|improve this answer























            • sudo a2dismod mpm_event sudo a2enmod mpm_prefork
              – arnauld
              Apr 7 '17 at 14:47















            up vote
            4
            down vote













            Try these commands:



            sudo a2dismod mpm_event
            sudo a2enmod mpm_prefork


            Then restart apache2 service.






            share|improve this answer























            • sudo a2dismod mpm_event sudo a2enmod mpm_prefork
              – arnauld
              Apr 7 '17 at 14:47













            up vote
            4
            down vote










            up vote
            4
            down vote









            Try these commands:



            sudo a2dismod mpm_event
            sudo a2enmod mpm_prefork


            Then restart apache2 service.






            share|improve this answer














            Try these commands:



            sudo a2dismod mpm_event
            sudo a2enmod mpm_prefork


            Then restart apache2 service.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Apr 7 '17 at 15:19









            anonymous2

            3,27341846




            3,27341846










            answered Apr 7 '17 at 14:45









            arnauld

            411




            411












            • sudo a2dismod mpm_event sudo a2enmod mpm_prefork
              – arnauld
              Apr 7 '17 at 14:47


















            • sudo a2dismod mpm_event sudo a2enmod mpm_prefork
              – arnauld
              Apr 7 '17 at 14:47
















            sudo a2dismod mpm_event sudo a2enmod mpm_prefork
            – arnauld
            Apr 7 '17 at 14:47




            sudo a2dismod mpm_event sudo a2enmod mpm_prefork
            – arnauld
            Apr 7 '17 at 14:47










            up vote
            3
            down vote













            I had the same problem. I got the same error with sudo service apache2 restart and ran sudo systemctl status apache2.service and the red line was Failed to start LSB: Apache2 web server.



            Solution



            run the bellow command:



            sudo apache2ctl configtest


            It'll check for errors (Syntax errors I think) and then you can debug the error.






            share|improve this answer

























              up vote
              3
              down vote













              I had the same problem. I got the same error with sudo service apache2 restart and ran sudo systemctl status apache2.service and the red line was Failed to start LSB: Apache2 web server.



              Solution



              run the bellow command:



              sudo apache2ctl configtest


              It'll check for errors (Syntax errors I think) and then you can debug the error.






              share|improve this answer























                up vote
                3
                down vote










                up vote
                3
                down vote









                I had the same problem. I got the same error with sudo service apache2 restart and ran sudo systemctl status apache2.service and the red line was Failed to start LSB: Apache2 web server.



                Solution



                run the bellow command:



                sudo apache2ctl configtest


                It'll check for errors (Syntax errors I think) and then you can debug the error.






                share|improve this answer












                I had the same problem. I got the same error with sudo service apache2 restart and ran sudo systemctl status apache2.service and the red line was Failed to start LSB: Apache2 web server.



                Solution



                run the bellow command:



                sudo apache2ctl configtest


                It'll check for errors (Syntax errors I think) and then you can debug the error.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Apr 5 at 17:06









                vmoh_ir

                1336




                1336






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Ask Ubuntu!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f870356%2fapache-problem-failed-to-start-lsb-apache2-web-server%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

                    Mangá

                    Eduardo VII do Reino Unido