Friday, February 27, 2015

Built in Apache server in Mac OS X

Mac OS X has built-in Apache Web server which can be very useful to quickly test web app.

The Apache configuration file is:
/etc/apache2/httpd.conf
Listen 80
DocumentRoot "/Library/WebServer/Documents"
ErrorLog "/private/var/log/apache2/error_log"

Commands to start/stop Apache server
sudo apachectl start
sudo apachectl stop
sudo apachectl restart

Copy some website for testing
sudo cp -r example-multipage-shim-master/www-built/ /Library/WebServer/Documents/test

Then access testing page using localhost and port 80
http://localhost/test/page1.html


No comments:

Post a Comment