Results 1 to 9 of 9

Thread: Apache2 Web Server failed to run

  1. #1

    Angry Apache2 Web Server failed to run

    Apache2 Web Server failed to run. I have reinstalled OpenSuse 42.1 twice but both times the Apache2 Webserver doesn't run.

    # sudo systemctl start apache2.service
    Job for apache2.service failed. See "systemctl status apache2.service" and "journalctl -xn" for details.


    # sudo systemctl status apache2.service
    apache2.service - The Apache Webserver
    Loaded: loaded (/usr/lib/systemd/system/apache2.service; enabled)
    Active: failed (Result: exit-code) since Tue 2016-02-23 12:41:22 AEDT; 22s ago
    Process: 24030 ExecStop=/usr/sbin/start_apache2 -DSYSTEMD -DFOREGROUND -k graceful-stop (code=exited, status=1/FAILURE)
    Process: 24025 ExecStart=/usr/sbin/start_apache2 -DSYSTEMD -DFOREGROUND -k start (code=exited, status=1/FAILURE)
    Main PID: 24025 (code=exited, status=1/FAILURE)

    I have ran zypper to update Apache2 and it successully updated.

    Now if I run it again, it displays "Nothing to do."
    # zypper in apache2
    Loading repository data...
    Reading installed packages...
    'apache2' is already installed.
    No update candidate for 'apache2-2.4.16-9.1.x86_64'. The highest available version is already installed.
    Resolving package dependencies...

    Nothing to do.

  2. #2

    Default Re: Apache2 Web Server failed to run

    Did you change the configuration in some way?
    It should start fine with the default one.

    Does /var/log/apache2/error_log exist?
    If yes, it might contain more information why apache failed to start.

    Maybe try to stop AppArmor as a test. This can cause strange problems if the profiles are wrong or you have an unusual system setup.
    Code:
    systemctl stop apparmor

  3. #3

    Angry Re: Apache2 Web Server failed to run

    I have stopped apparmor and tried to restart apache but failed to restart.


    peace:/home/kiran # systemctl stop apparmor
    peace:/home/kiran # systemctl start apache2.service
    Job for apache2.service failed. See "systemctl status apache2.service" and "journalctl -xn" for details.
    peace:/home/kiran # systemctl enable apache2.service
    peace:/home/kiran # systemctl start apache2.service
    Job for apache2.service failed. See "systemctl status apache2.service" and "journalctl -xn" for details.
    peace:/home/kiran #

    /var/log/apache2/error_log does not exist.

  4. #4
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    11,254
    Blog Entries
    2

    Default Re: Apache2 Web Server failed to run

    Immediately after attempting to start your Apache service, run the following immediately in a console to display the last 100 entries written to the journal
    Code:
    journalctl -n 100
    Also, going over some basics...
    - Where did you install Apache from, from the OSS?
    - Did you configure a website, and if you did, did you use the YAST http server module? You'd have to install it using YAST or zypper as follows
    Code:
    zypper in yast2-http-server
    - Are you posting the entire "systemctl status apache2" - I find it strange that it would say it stopped without first saying it had started.

    In any case, you might consider just force re-installing with the following
    Code:
    zypper in -f apache2
    Followed <immediately> by starting apache
    Code:
    systemctl start apache2
    It'll take awhile to start this first time, then you should be able to verify it started with
    Code:
    systemctl status apache2
    HTH,
    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  5. #5

    Default Re: Apache2 Web Server failed to run

    I took the following steps but Apache Webserver did not run at all.

    A:

    peace:/var/log/apache2 # zypper in yast2-http-server
    Retrieving repository 'openSUSE-Leap-42.1-Update' metadata ........................................................................................[done]
    Building repository 'openSUSE-Leap-42.1-Update' cache .............................................................................................[done]
    Loading repository data...
    Reading installed packages...
    'yast2-http-server' is already installed.
    No update candidate for 'yast2-http-server-3.1.6-5.7.noarch'. The highest available version is already installed.
    Resolving package dependencies...

    Nothing to do.

    B:
    peace:/var/log/apache2 # zypper in -f apache2
    Loading repository data...
    Reading installed packages...
    Forcing installation of 'apache2-2.4.16-9.1.x86_64' from repository 'openSUSE-Leap-42.1-Update'.
    Resolving package dependencies...

    The following package is going to be reinstalled:
    apache2

    1 package to reinstall.
    Overall download size: 1.0 MiB. Already cached: 0 B. No additional space will be used or freed after the operation.
    Continue? [y/n/? shows all options] (y): y
    Retrieving package apache2-2.4.16-9.1.x86_64 (1/1), 1.0 MiB ( 3.6 MiB unpacked)
    Retrieving: apache2-2.4.16-9.1.x86_64.rpm ...........................................................................................[done (528.4 KiB/s)]
    Checking for file conflicts: ......................................................................................................................[done]
    (1/1) Installing: apache2-2.4.16-9.1 ..............................................................................................................[done]
    Additional rpm output:
    /usr/sbin/suexec: cannot verify root:root 0755 - not listed in /etc/permissions
    Updating /etc/sysconfig/apache2...

    C:
    peace:/var/log/apache2 # systemctl start apache2
    Job for apache2.service failed. See "systemctl status apache2.service" and "journalctl -xn" for details.

    D:
    peace:/var/log/apache2 # journalctl -n 100

    Feb 25 09:09:03 peace start_apache2[4982]: AH00526: Syntax error on line 15 of /etc/apache2/conf.d/nagios.conf:
    Feb 25 09:09:03 peace start_apache2[4982]: Invalid command 'Order', perhaps misspelled or defined by a module not included in the server configuration
    Feb 25 09:09:03 peace start_apache2[4987]: AH00526: Syntax error on line 15 of /etc/apache2/conf.d/nagios.conf:
    Feb 25 09:09:03 peace start_apache2[4987]: Invalid command 'Order', perhaps misspelled or defined by a module not included in the server configuration
    Fe

    F:
    peace:/var/log/apache2 # systemctl status apache2
    apache2.service - The Apache Webserver
    Loaded: loaded (/usr/lib/systemd/system/apache2.service; enabled)
    Active: failed (Result: exit-code) since Thu 2016-02-25 09:14:41 AEDT; 5min ago
    Process: 6389 ExecStop=/usr/sbin/start_apache2 -DSYSTEMD -DFOREGROUND -k graceful-stop (code=exited, status=1/FAILURE)
    Process: 6384 ExecStart=/usr/sbin/start_apache2 -DSYSTEMD -DFOREGROUND -k start (code=exited, status=1/FAILURE)
    Main PID: 6384 (code=exited, status=1/FAILURE)

    Feb 25 09:14:41 peace start_apache2[6384]: AH00526: Syntax error on line 15 of /etc/apache2/conf.d/nagios.conf:
    Feb 25 09:14:41 peace start_apache2[6384]: Invalid command 'Order', perhaps misspelled or defined by a module not included in the server configuration
    Feb 25 09:14:41 peace start_apache2[6389]: AH00526: Syntax error on line 15 of /etc/apache2/conf.d/nagios.conf:
    Feb 25 09:14:41 peace start_apache2[6389]: Invalid command 'Order', perhaps misspelled or defined by a module not included in the server configuration
    peace:/var/log/apache2 #


    G:
    The content of the file /etc/apache2/conf.d/nagios.conf is as follows.

    # SAMPLE CONFIG SNIPPETS FOR APACHE WEB SERVER
    # Last Modified: 11-26-2005
    #
    # This file contains examples of entries that need
    # to be incorporated into your Apache web server
    # configuration file. Customize the paths, etc. as
    # needed to fit your system.

    ScriptAlias /nagios/cgi-bin "/usr/lib/nagios/cgi"

    <Directory "/usr/lib/nagios/cgi">
    # SSLRequireSSL
    Options ExecCGI
    AllowOverride None
    Order allow,deny
    Allow from all
    # Order deny,allow
    # Deny from all
    # Allow from 127.0.0.1
    AuthName "Nagios Access"
    AuthType Basic
    AuthUserFile /etc/nagios/htpasswd.users
    Require valid-user
    </Directory>

    Alias /nagios "/usr/share/nagios"

    <Directory "/usr/share/nagios">
    # SSLRequireSSL
    Options None
    AllowOverride None
    Order allow,deny
    Allow from all
    # Order deny,allow
    # Deny from all
    # Allow from 127.0.0.1
    AuthName "Nagios Access"
    AuthType Basic
    AuthUserFile /etc/nagios/htpasswd.users
    Require valid-user
    <IfDefine KOHANA2>
    DirectoryIndex index.html index.php
    </IfDefine>
    </Directory>

  6. #6
    Jon_Freeman NNTP User

    Default Re: Apache2 Web Server failed to run

    See https://httpd.apache.org/docs/2.4/upgrading.html

    Code:
    2.2 configuration:
    
    Order allow,deny
    Allow from all 
    
    2.4 configuration:
    
    Require all granted

  7. #7

    Default Re: Apache2 Web Server failed to run

    I have reinstalled OpenSuse 42.1 for the third time and this time it is working fine. I did not select many Server Functions and restricted to
    i. File Server
    ii. Network Administration and
    iii. Web and LAMP Server.

    It is great to see Apache2 server running on OpenSuse 42.1.

    I have installed Kdesktop as default Desktop and selected Gnome Desktop as well but Gnome desktop just hangs and does not run.

  8. #8
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    11,254
    Blog Entries
    2

    Default Re: Apache2 Web Server failed to run

    Quote Originally Posted by kiran View Post
    I have reinstalled OpenSuse 42.1 for the third time and this time it is working fine. I did not select many Server Functions and restricted to
    i. File Server
    ii. Network Administration and
    iii. Web and LAMP Server.

    It is great to see Apache2 server running on OpenSuse 42.1.

    I have installed Kdesktop as default Desktop and selected Gnome Desktop as well but Gnome desktop just hangs and does not run.
    Good to see your problem is resolved.
    From what you posted since my post, it looked like you had nagios installed, which could possibly have caused problems. I would have recommended removing nagios, then re-installing apache again.

    And then, I would have suggested that you install any of many modern nagios clones or the most recent version of Nagios from nagios.com (yes, it costs if you're monitoring more than a few machines) instead of the original nagios.

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  9. #9

    Default Re: Apache2 Web Server failed to run

    Quote Originally Posted by tsu2 View Post
    Good to see your problem is resolved.
    From what you posted since my post, it looked like you had nagios installed, which could possibly have caused problems. I would have recommended removing nagios, then re-installing apache again.

    And then, I would have suggested that you install any of many modern nagios clones or the most recent version of Nagios from nagios.com (yes, it costs if you're monitoring more than a few machines) instead of the original nagios.

    TSU

    I have reinstalled OpenSuse 42.1 for the fourth time. Apache2 Web server failed to start again. I have followed above instructions and uninstalled 3 apps related to nagios. I was able to restart Apache2 web server. Thanks TSU.

    Great ! Apache2 web server is running again.




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •