Koozali.org: home of the SME Server

[FIXED] httpd wont start

steveo

[FIXED] httpd wont start
« on: August 07, 2006, 04:16:34 PM »
Hi all, hoping you can help me.

I cannot start the httpd service:
Code: [Select]
/etc/init.d/httpd start
Starting httpd:               [FAILED]


The httpd error log (tail /var/log/httpd/error_log) says:
Code: [Select]
[Mon Aug 07 23:55:02 2006] [crit] (28)No space left on device: mod_rewrite: could not create rewrite_log_lock
Configuration Failed


There is plenty of space available:
Code: [Select]
df
Filesystem  1K-blocks   Used          Available    Use%     Mounted on
/dev/hda3  76564776   15612052   57063408    22%      /
/dev/hda1  99043        9618          84311          11%      /boot
none          225512      0               225512         0%       /dev/shm


I did install (via yum localinstall) the sme-crontab_manager contrib, but I am not sure this is the cause. I did yum remove and expand the httpd template but httpd still does not start.

I did notice another threads on this:
    http://forums.contribs.org/index.php?topic=32490.0
    http://forums.contribs.org/index.php?topic=27943.0
    [/list]
    I have also searched the bug tracker, but can see no resolution.

    Any assistance appreciated.

    Cheers.

    Offline smeghead

    • *
    • 557
    • +0/-0
    [FIXED] httpd wont start
    « Reply #1 on: August 07, 2006, 04:39:07 PM »
    .. from 10 seconds on Google!

    **********************************************************

    I did an "everything" install of Fedora Core 2 and it has produced a few small issues. One of them being that Apache gives out when I restart it too much. It turns out to be a memory leak in mod_perl, according to this website. The apache log entries in /var/log/httpd/error_log say:

    [crit] (28)No space left on device: mod_rewrite: could not create rewrite_log_lock Configuration Failed

    The fix is to run this:

    ipcs -s | grep nobody | perl -e 'while () { @a=split(/\s+/); print ipcrm sem $a[1]}'

    except where it says "nobody", make sure that matches up to whatever apache runs as. For me it's "apache" not "nobody".

    Courtesy of http://inanutshell.us/content/dev.html

    In SME apache runs as user www

    Remember search and search again!
    ..................

    Offline cactus

    • *
    • 4,880
    • +3/-0
      • http://www.snetram.nl
    [FIXED] httpd wont start
    « Reply #2 on: August 08, 2006, 10:03:58 AM »
    Quote from: "smeghead"
    ipcs -s | grep nobody | perl -e 'while () { @a=split(/\s+/); print ipcrm sem $a[1]}'

    except where it says "nobody", make sure that matches up to whatever apache runs as. For me it's "apache" not "nobody".
    Changed the user to www and tried the command but it only keeps outputting:
    Code: [Select]
    usage: ipcrm [ [-q msqid] [-m shmid] [-s semid]
              [-Q msgkey] [-M shmkey] [-S semkey] ... ]
    deprecated usage: ipcrm {shm | msg | sem} id ...
    for minutes on end. Can someone help me fix the syntaxis?
    Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

    steveo

    ipcs -s | grep nobody
    « Reply #3 on: August 10, 2006, 06:21:34 AM »
    I had the same problem. After a bit of mucking around, I came up with this:

    As root run
    Code: [Select]
    ipcs -s | grep www | cut -d " " -f2 > killthese.txt

    To extract the lock file IDs, Then run the following script to knock them off:

    Code: [Select]

    #!/bin/sh

    # open file the for reading
    exec 6<killthese.txt
    # read until end of file
    while read -u 6 dta
    do
      echo killing "$dta"
      ipcrm sem $dta
    done
    #close file killthese.txt
    exec 6<&-


    This, after some time, managed to kill off all the lock files. Remember to ensure that the httpd service is not running before you run these commands.

    Code: [Select]
    /etc/init.d/httpd stop

    I found I also needed to kill some http processes as well. After I ran these, and killed off all the locks as suggested by the second post (thanks for the info by the way), I still could not start the httpd service. I was getting ssl errors. As a short term solution I had to change the name of the server to get httpd running again. I think I need to delete an auto generated ssl certificate and then rename back to the original name. I'm still trying to figure out how to do this.

    Steve

    Offline CharlieBrady

    • *
    • 6,918
    • +3/-0
    Re: httpd wont start
    « Reply #4 on: August 10, 2006, 08:12:32 AM »
    Quote from: "steveo"
    Hi all, hoping you can help me.

    I cannot start the httpd service:
    Code: [Select]
    /etc/init.d/httpd start
    Starting httpd:               [FAILED]



    What you are showing here is that you cannot start a *third* httpd service, in addition to the two which are already running, one called "httpd-e-smith" and one called "httpd-admin".

    Please read the FAQ and the Developers Guide, both accessible via the Documentation link to the left.

    steveo

    http service
    « Reply #5 on: August 10, 2006, 10:32:02 AM »
    Thanks for the advice charlie. I have changed my server back to its original name - web pages (including server manager) do not display although the service tells me it is running.

    Code: [Select]

    Stopping httpd-e-smith:                   [  OK  ]
    Starting httpd-e-smith:                    [  OK  ]
    Stopping httpd-admin:                     [  OK  ]
    Starting httpd-admin:                      [  OK  ]


    Log confirms this:
    Code: [Select]

    Aug 10 18:20:32 darkstar httpd-e-smith: Stopping httpd-e-smith succeeded
    Aug 10 18:20:40 darkstar httpd-e-smith: Starting httpd-e-smith succeeded
    Aug 10 18:21:19 darkstar httpd-admin: Stopping httpd-admin succeeded
    Aug 10 18:21:25 darkstar httpd-admin: Starting httpd-admin succeeded


    Pages from server are not found, check the httpd/error_log
    Code: [Select]

    [Thu Aug 10 18:24:52 2006] [crit] (28)No space left on device: mod_rewrite: could not create rewrite_log_lock


    Killed the lock files as per previous post. tail /var/log/httpd/error_log
    Code: [Select]

    [Thu Aug 10 18:36:18 2006] [error] Unable to configure RSA server private key
    [Thu Aug 10 18:36:18 2006] [error] SSL Library Error: 185073780 error:0B080074:x509 certificate routines:X509_check_private_key:key values mismatch


    There is now a problem with SSL that is preventing the pages from displaying - this would explain how why the pages display with a different server name (not quite sure why the http processes have reported they are running).

    I now need to do some research on how ssl is setup (unless anyone here can give me a quick answer).

    steveo

    Web server back up
    « Reply #6 on: August 10, 2006, 12:14:07 PM »
    OK, got the web and admin pages running again.

    I deleted the private key and certificate:
    Code: [Select]
    rm  /home/e-smith/ssl.crt/darkstar.edenmonarolabour.org.crt
    rm /home/e-smith/ssl.key/darkstar.edenmonarolabour.org.key


    and then ran
    Code: [Select]
    signal-event domain-modify

    If anyone needs to delete those pesky lock files (I needed to to this quite often), here is a script you can use:

    Code: [Select]

    #!/bin/sh

    LOCK_FILE="./killthese.txt"

    # First stop the webservers
    /etc/init.d/httpd-admin stop
    /etc/init.d/httpd-e-smith stop


    # Now produce the lock file
    ipcs -s | grep www | cut -d " " -f2 > $LOCK_FILE

    # open file test.data for reading
    exec 6<$LOCK_FILE
    # read until end of file
    while read -u 6 dta
    do
      echo deleting resource "$dta"
      ipcrm sem $dta
    done

    # close file killthese.txt
    exec 6<&-

    # delete the data file
    rm -f $LOCK_FILE

    #now start the webservers again
    /etc/init.d/httpd-admin start
    /etc/init.d/httpd-e-smith start

    Online mmccarn

    • *
    • 2,628
    • +10/-0
    [FIXED] httpd wont start
    « Reply #7 on: September 13, 2006, 07:46:30 PM »
    Same problem.

    Deleting the .crt and .key files, signal-event domain-modify, and running steveo's script (thanks!) seem to have solved the problem.

    Does anyone know why this happens?

    robin

    [FIXED] httpd wont start
    « Reply #8 on: November 29, 2006, 03:50:22 AM »
    Thanks for this script etc this fixed my web problem.

    I also had an IMAP problem caused by this same issue
    Users were getting "number of connections exceded..." error in thunderbird

    you need to kill imap and imaps first then run the commands & script above

    Code: [Select]
    [root@neptune /]# ps aux | grep imap

    root      2206    0.0  0.0  2948  224 ?        Ss   12:04   0:00 runsv imaps
    root      2215    0.0  0.0  1508  224 ?        Ss   12:04   0:00 runsv imap

    [root@neptune /]# kill 2206
    [root@neptune /]# kill 2215


    Just thought this may help someone else along the line

    Robin

    Offline william_syd

    • ****
    • 1,608
    • +0/-0
    • Nothing to see here.
      • http://www.magicwilly.info
    [FIXED] httpd wont start
    « Reply #9 on: November 29, 2006, 04:10:46 AM »
    Quote from: "robin"

    I also had an IMAP problem caused by this same issue
    Users were getting "number of connections exceded..." error in thunderbird



    Code: [Select]
    [root@c3 ~]# config show imap
    imap=service
        ConcurrencyLimit=400
        ConcurrencyLimitPerIP=12
        TCPPort=143
        access=private
        status=enabled
    [root@c3 ~]# config show imaps
    imaps=service
        ConcurrencyLimit=400
        ConcurrencyLimitPerIP=100
        TCPPort=993
        access=public
        status=enabled
    [root@c3 ~]#
    Regards,
    William

    IF I give advise.. It's only if it was me....

    robin

    [FIXED] httpd wont start
    « Reply #10 on: November 29, 2006, 10:20:07 AM »
    Thanks William,

    I did the "ConcurrencyLimit" stuff first but the imap still wasn't working because of the security cert issue.
    A friend pointed me to this thread and it worked but perhaps the script could be modified to stop imap and imaps?

    would it be like this?

    Code: [Select]

    #!/bin/sh

    LOCK_FILE="./killthese.txt"


    # First stop the webservers
    /etc/init.d/httpd-admin stop
    /etc/init.d/httpd-e-smith stop

    #Now stop the imap servers
    /etc/init.d/imap stop
    /etc/init.d/imaps stop

    # Now produce the lock file
    ipcs -s | grep www | cut -d " " -f2 > $LOCK_FILE

    # open file test.data for reading
    exec 6<$LOCK_FILE
    # read until end of file
    while read -u 6 dta
    do
      echo deleting resource "$dta"
      ipcrm sem $dta
    done

    # close file killthese.txt
    exec 6<&-

    # delete the data file
    rm -f $LOCK_FILE

    #now start the webservers again
    /etc/init.d/httpd-admin start
    /etc/init.d/httpd-e-smith start

    #Now start the imap servers again
    /etc/init.d/imap start
    /etc/init.d/imaps start


    I added the imap start and stop, but do we need something in this line ?

    Code: [Select]
    # Now produce the lock file
    ipcs -s | grep www | cut -d " " -f2 > $LOCK_FILE


    I notice the grep is just www?
    does it need to look for imap in there also?

    New to this and would like to use this as a learning experience, Thanks

    Offline cfmunster

    • 13
    • +0/-0
      • http://www.funkymojo.com
    same symptoms...
    « Reply #11 on: July 06, 2007, 03:01:50 AM »
    I banged my head on this problem for awhile today. I whacked my httpd install while trying to set up SugarCRM per this thread:

    http://forums.contribs.org/index.php?topic=35112.0

    I finally did all the things recommended here, but I also removed eaccelerator.so and its settings from my php.ini file, which finally did the trick and got me running again. I might leave it off foe a bit and try and install it again later, but I don't have high usage, so it isn't a big deal.
    ----
    Robert Munn

    Offline jdavey

    • **
    • 43
    • +0/-0
    [FIXED] httpd wont start
    « Reply #12 on: July 09, 2007, 05:50:18 PM »
    Same problem...

    This was on our PDC dual Xeon s with 4 GB of RAM. 40 users. Ridiculous uptime on this box.

    As stated by others: Deleting the .crt and .key files, signal-event domain-modify, and running steveo's script have solved the problem.

    I'll go check the Bug tracker to see if there are issues reported there.
    ...

    Offline robwellesley

    • *
    • 92
    • +0/-0
    Re: [FIXED] httpd wont start
    « Reply #13 on: May 06, 2008, 01:38:30 AM »
    I had no 'luck' until I stopped doing

    /etc/init.d/httpd start

    and did

    svc - u /service/httpd-e-smith


    Offline cactus

    • *
    • 4,880
    • +3/-0
      • http://www.snetram.nl
    Re: [FIXED] httpd wont start
    « Reply #14 on: May 09, 2008, 02:05:56 PM »
    I had no 'luck' until I stopped doing

    /etc/init.d/httpd start

    and did

    svc - u /service/httpd-e-smith


    That is because the service control has changed, the /etc/init.d is deprecated, you should use
    Code: [Select]
    sv t httpd-e-smith (restart) instead.
    Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)