Skip to content

Instantly share code, notes, and snippets.

@troyk
Created January 22, 2013 01:35
Show Gist options
  • Select an option

  • Save troyk/4591288 to your computer and use it in GitHub Desktop.

Select an option

Save troyk/4591288 to your computer and use it in GitHub Desktop.
Fix apache bench for mt lion
# download and install pcre
# download and unpack (mine was 2.4.3) latest stable apache
cd httpd-2.4.3
export LTFLAGS='--tag CC'
# might have to symlink this file if you get a toolchain error
# sudo ln -s /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.8.xctoolchain
./configure --silent --prefix=/usr/local/ --disable-debug --disable-dependency-tracking
cd support
make -s ab
# can run which ab to verify location, mine was /usr/sbin
sudo cp ./ab /usr/sbin
# that fixes ab for erro, but OS X needs to have ports extended
# http://stackoverflow.com/questions/1216267/ab-program-freezes-after-lots-of-requests-why
sysctl net.inet.ip.portrange.first net.inet.ip.portrange.last
# net.inet.ip.portrange.first: 49152 <-- too high, not enpugh ports
# net.inet.ip.portrange.last: 65535
# TODO: see if this makes lives through a reboot!
sudo sysctl -w net.inet.ip.portrange.first=32768
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment