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: