Skip navigation
This discussion is archived

apachectl script is broken under 10.6.5

10100 Views 12 Replies Latest reply: Dec 5, 2010 5:27 PM by etresoft RSS
g@rgoyle Calculating status...
Currently Being Moderated
Nov 11, 2010 6:37 AM
It seems that since the 10.6.5 update, the apachectl script is no longer working. This script has the line:-

ULIMITMAXFILES="ulimit -S -n `ulimit -H -n`"

Which boils down to trying to run "ulimit -S -n unlimited", which then results in the error:-

-bash: ulimit: open files: cannot modify limit: Invalid argument

This should not really be a problem, as using the work 'unlimited' should be accepted by the ulimit command. But it's not!

As a temporary fix I have modified my apachectl script to change the line to read as follows:-

ULIMITMAXFILES="ulimit -S -n 10240"

I got that limit by trial and error as someone on #httpd had recommended 65000! I guess there are some people that will know how to make a sensible target for this figure.
MacPro (2008), Mac OS X (10.6.5), 8800GT
  • Shalkydri Level 1 Level 1 (0 points)
    Currently Being Moderated
    Nov 12, 2010 4:47 AM (in response to g@rgoyle)
    Thank you for posting this solution. I encountered the same issue and your way for fixing works pretty well.
    MacBook Pro (2010), Mac OS X (10.6.5)
  • dominikgehl Calculating status...
    Currently Being Moderated
    Nov 12, 2010 9:14 AM (in response to g@rgoyle)
    I had the same issue ...

    ULIMITMAXFILES=""

    seems to fix it
    MacbookPro, Mac OS X (10.6.5)
  • k.panic Level 3 Level 3 (605 points)
    Currently Being Moderated
    Nov 12, 2010 9:19 AM (in response to g@rgoyle)
    Didn't 10.6.5 update apache? I know it did for OS X Server, I would figure Client got the update as well. Might want to check the apache changelogs.
    15" MacBook Pro i7 (Mid 2010), Mac Mini (Mid 2009), iPad, iPod, iPhone 4, Mac OS X (10.6.4), Go break something!
  • dominikgehl Level 1 Level 1 (0 points)
    Currently Being Moderated
    Nov 12, 2010 9:29 AM (in response to g@rgoyle)
    From http://support.apple.com/kb/HT4435:

    Apache

    CVE-ID: CVE-2010-0408, CVE-2010-0434

    Available for: Mac OS X v10.6 through v10.6.4, Mac OS X Server v10.6 through v10.6.4

    Impact: Multiple vulnerabilities in Apache 2.2.14

    Description: Apache is updated to version 2.2.15 to address several vulnerabilities, the most serious of which may lead to a denial of service. Further information is available via the Apache web site at http://httpd.apache.org/
    MacbookPro, Mac OS X (10.6.5)
  • m.a.paik Calculating status...
    Currently Being Moderated
    Nov 12, 2010 9:36 AM (in response to g@rgoyle)
    I thought I was going crazy. I just got my new laptop and I thought I did something wrong to it. So it was the software update. But can you explain the socket error?

    /usr/sbin/apachectl: line 82: ulimit: open files: cannot modify limit: Invalid argument
    (13)Permission denied: make_sock: could not bind to address [::]:80
    (13)Permission denied: make_sock: could not bind to address 0.0.0.0:80
    no listening sockets available, shutting down
    Unable to open logs
    MBP 2010 15" 2.66 gHz, Mac OS X (10.6.5), PowerBook G4 15" 1.67G
  • Matt Duffy1 Level 1 Level 1 (30 points)
    Currently Being Moderated
    Nov 12, 2010 3:28 PM (in response to m.a.paik)
    The socket errors are because you are trying to run apachectl as a non-root user. Running it as sudo should clear that issue up.
    XServe G5, Mac OS X (10.4.6), Powerbook 15"
  • m.a.paik Level 1 Level 1 (0 points)
    Currently Being Moderated
    Nov 16, 2010 10:07 AM (in response to Matt Duffy1)
    That did help. That was an error on my part but the weird thing is I can run apachectl on the terminal but I can't run it on the System Preferences. It doesn't show the localhost IP. If I click on the checkbox, it just turns yellow and hangs. I had the same problem with my old PowerBook. Is it some permissions issue?
    MBP 2010 15" 2.66 gHz, Mac OS X (10.6.5), PowerBook G4 15" 1.67G
  • iJohn78 Calculating status...
    Currently Being Moderated
    Dec 5, 2010 3:22 PM (in response to g@rgoyle)
    Hi,

    How to edit apachectl and change that?

    Sorry, I'm a new mac user.

    Thanks.
    iMac 3.06GHz Intel Core 2 Duo 4GB 1067 MHz RAM, Mac OS X (10.6.5)
  • MrHoffman Level 6 Level 6 (11,695 points)
    Currently Being Moderated
    Dec 5, 2010 4:01 PM (in response to iJohn78)
    Launch Terminal.app from an administrator user, and issue the following commands:


    $ cd /usr/sbin/
    $ sudo cp apachectl apachectl_save
    $ sudo nano apachectl


    sudo will require you to enter your administrative user's password.

    nano is probably the easiest command-line text editor, and includes on-screen help. Follow the on-screen instructions to find the above line, and change it per the instructions earlier in the thread.
  • iJohn78 Level 1 Level 1 (0 points)
    Currently Being Moderated
    Dec 5, 2010 4:14 PM (in response to MrHoffman)
    Hi,

    I did that and finally changed the script (the error message disappeared), but now nothing happens when I type sudo apachectl graceful and I still can't view anything in localhost.

    Can you help me? I had the XAMP installed, but I've already uninstalled it.

    Thank You.

    Regards,

    JB
    iMac 3.06GHz Intel Core 2 Duo 4GB 1067 MHz RAM, Mac OS X (10.6.5)
  • etresoft Level 7 Level 7 (23,870 points)
    Currently Being Moderated
    Dec 5, 2010 5:27 PM (in response to iJohn78)
    iJohn78 wrote:
    I did that and finally changed the script (the error message disappeared), but now nothing happens when I type sudo apachectl graceful and I still can't view anything in localhost.


    You should probably start your own thread to discuss this issue. "sudo apachectl graceful" won't do anything except restart Apache.
    MacBook 2007 (white), Mac OS X (10.6.5), + iMac 27" + iPad + MacBook Pro

Actions

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • This solved my question - 10 points
  • This helped me - 5 points
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Support Communities Terms of Use.