service httpd restart - broken in F11
FedoraForum.org - Fedora Support Forums and Community
Results 1 to 11 of 11
  1. #1
    Join Date
    Apr 2005
    Location
    Northern Ireland
    Age
    50
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    service httpd restart - broken in F11

    Has anyone noticed that when using NameVirtualHost's in apache that the service httpd restart command is broken?

    Also it seems system-config-bind has glitches too.

    Can someone confirm these? Hope its not just me...
    I've been in worse situations than this, but I can't seem to recall them... :eek:

  2. #2
    Join Date
    Nov 2008
    Location
    Canada
    Posts
    2,724
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I can confirm I have something bad going on, but it's long before virtualhosts. However I believe it's because I changed this server's name. Check your error log, do you have the same?

    [Fri Jul 03 07:01:55 2009] [error] avahi_entry_group_add_service_strlst("localhost") failed: Invalid host name
    [Fri Jul 03 07:01:55 2009] [error] avahi_entry_group_add_service_strlst("localhost") failed: Invalid host name

    I've only taken it as far as:
    lsof -i tcp:80
    netstat -lp | grep -w LISTEN
    nmap 127.0.0.1
    and edited /etc/hosts, /etc/hosts.conf,

    With any luck I've reminded you of something or tossed a command to help troubleshoot.

  3. #3
    Join Date
    Oct 2008
    Posts
    299
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You MIGHT have a bad configuration option or something. I remember when I had a bad one I had to fix it before I could start or restart httpd.
    Intel Core 2 Quad Q8400 CPU (2.66 GHz)
    3gb RAM
    500GB HD
    Debian Lenny x86_64 & Windows 7 Ultimate x64
    NVIDIA GeForce 9800 GTX+ Superclocked - Fattypack

    Second(Server) PC:
    512mb RAM
    80gb TiVO HD(Lololol, took it from TiVO, old one broke)
    PC-BSD 7.1.1 x86
    Ossom router decked out with DD-WRT as a bridge providing net
    Sign the Online Petition to bring Crysis 2 to Linux/Mac!

  4. #4
    Join Date
    Apr 2005
    Location
    Northern Ireland
    Age
    50
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Configuration isn't bad in my case, If i wanted to restart the httpd service I have to use lsof -i tcp:80 and then kill all the processes in use.
    Using service httpd restart is not killing the service off and therefore when it starts the service again it fails.

    You can use apachectl -S to check your configuration.

    As for an avahi issue not finding localhost, look at:
    /etc/hosts
    /etc/host.conf
    /etc/resolv.conf
    Also check you SELinux and Firewall settings.
    I've been in worse situations than this, but I can't seem to recall them... :eek:

  5. #5
    Join Date
    Nov 2008
    Location
    Canada
    Posts
    2,724
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks. I must have been drinking early Friday, after some swearing I finially realised this:
    cat /etc/hosts
    127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
    ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
    Yeah I swear it wasn't there Friday.

    My second problem was a broken symbolic link. /etc/httpd/run points to /var/run/httpd (default pid location from httpd.conf). You might want to check yours to be sure. Also look at /etc/init.d/httpd for:
    # Path to the apachectl script, server binary, and short-form for messages.
    apachectl=/usr/sbin/apachectl
    httpd=${HTTPD-/usr/sbin/httpd}
    prog=httpd
    pidfile=${PIDFILE-/var/run/httpd/httpd.pid}
    lockfile=${LOCKFILE-/var/lock/subsys/httpd}

    RETVAL=0
    besure those paths exist.

    for now I'm going for a drink and will create a virutalhost later. Maybe I can kick something up for you.
    Last edited by beaker_; 5th July 2009 at 05:44 PM.

  6. #6
    Join Date
    Jun 2004
    Posts
    56
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just did the F10 -> F11 update within this week and the previously good Apache config didn't work in F11. Since I have nothing special in that config I just removed the config-file and re-installed Apache to get it running.

    My httpd wasn't starting at all so no restart possible.

  7. #7
    Join Date
    Nov 2006
    Location
    U.S.A.
    Age
    34
    Posts
    473
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I copied my httpd.conf file and did a clean install of Fedora 11, it all works for me. What does /var/log/messages and /var/log/httpd/error_log say when you try to restart?
    Registered linux user: #475337

    Never underestimate someone with source code, a text editor, and the willingness to completely hose their system.

  8. #8
    Join Date
    Jun 2004
    Posts
    56
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If the question was for me then here's the answer.

    It complained about one of the lines in config and since I have made some minor trials with it I thought best to restore to default. All is well now

  9. #9
    Join Date
    Jan 2006
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is the old right hand not knowing what the left is doing after an upgrade

    Solution:
    The script that 'service' runs is /etc/rc.d/rc.init/httpd
    In that script, there is a line that says pidfile=${PIDFILE-/var/run/httpd/httpd.pid}.
    In Fedora 9, that line is pidfile=${PIDFILE-/var/run/httpd.pid}
    Change your script to match the Fedora 9 line and that should solve the restart problem.

    This solved a similar problem that I had. Someone tried changing the PID line in /etc/httpd/conf/httpd.conf to /run/httpd/httpd.pid, but it didn't work for them.

  10. #10
    Join Date
    Jul 2009
    Location
    Canada
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question httpd.pid location ?

    I have a similar problem. "service" and "system-config-services" are confused about
    the status of httpd.

    They say it is stopped, or dead, while it is running just fine. Consequently you can't stop, start, restart httpd from service or system-config-services.

    The problem seems to be that httpd.pid is in the wrong place.
    It is now in /var/run/httpd.pid, as opposed to /var/run/httpd/httpd.pid, where it was
    on my system until yesterday.

    If I copy httpd.pid to the httpd/ directory, "service" is fine. That is, until httpd starts again
    for whatever reason (boot, restart with "service", restart with apachectl, you name it). Then the
    same situation happens.

    My /etc/init.d/httpd file says:

    # Path to the apachectl script, server binary, and short-form for messages.
    apachectl=/usr/sbin/apachectl
    httpd=${HTTPD-/usr/sbin/httpd}
    prog=httpd
    pidfile=${PIDFILE-/var/run/httpd/httpd.pid}
    lockfile=${LOCKFILE-/var/lock/subsys/httpd}
    RETVAL=0

    apache conf file /etc/httpd/conf/httpd.conf says:
    #
    # PidFile: The file in which the server should record its process
    # identification number when it starts.
    #
    PidFile run/httpd/httpd.pid

    How many more places does this path need to be configured?
    And, more interestingly, where are those places?

    Any Ideas where to look?

    Bernd

  11. #11
    Join Date
    Apr 2005
    Location
    Northern Ireland
    Age
    50
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up

    Well after giving this thread some time to 'brew', its actually pointed me in the right direction (and mit turns out to be a configuration issue after all).

    The /etc/httpd/conf/httpd.conf file was pointing the pid file to the wrong place.

    So for you guys out there with this issue check the pid file path in the follwoing files.

    • /etc/httpd/conf/httpd.conf
    • /etc/init.d/httpd
    • /etc/sysconfig/httpd
    I've been in worse situations than this, but I can't seem to recall them... :eek:

Similar Threads

  1. service httpd restart not working
    By ruchita in forum Servers & Networking
    Replies: 4
    Last Post: 26th September 2009, 05:11 PM
  2. restart service
    By ColonelPenguin in forum Servers & Networking
    Replies: 4
    Last Post: 17th November 2008, 07:14 PM
  3. Replies: 9
    Last Post: 3rd July 2008, 06:00 AM
  4. service httpd restart hanging
    By dnraikes in forum Using Fedora
    Replies: 1
    Last Post: 1st December 2004, 10:30 PM

Tags for this Thread

Posting Permissions

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