The Apache web server comes with the OS X is a bit out dated. So I decided to install a new one. After I tried installing it using mac port, it kept giving error.
Finally, I built the Apache from source, and it worked!
Grep Apache from here.
Download the file, where the link should look something like:
Unix Source: httpd-2.2.14.tar.gz
Run the following command in terminal:
tar -zxvf httpd-2.2.14.tar.gz cd httpd-2.2.14 ./configure make sudo make install
That’s it! Now, let’s test the webserver.
First, let’s disable the Apache that shipped with the OS X (Not the one you just install!). You can simply do it by going to:
System Preferences -> Sharing -> Web Sharing
Go back to Terminal. Make sure the default web server is not running:
sudo apachectl stop
Now, let’s verify the installations:
/usr/local/apache2/bin/apachectl -v
You should see something like this:
Server version: Apache/2.2.14 (Unix) Server built: Oct 24 2009 20:53:45
Now, let’s start the web server:
sudo /usr/local/apache2/bin/apachectl start
Open your browsers and access to http://localhost/.
You should see something like:
It works!
Have fun!
–Derrick
Our sponsors:
I followed the same procedure to compile and install the new version of Apache (2.2.14) under regular Mac OS X 10.6.1 (not the server). The procedure went well, but the old version of Apache (2.2.11) is still the version that is open when restarting the system, and I could not figure out how to set it up. I wonder why this is not done by Software Update. My web site is blocked by the network administrator because the outdated Apache version is vulnerable.
I’ve updated my post to answer your question. Hope it helps, thanks!