Friday, June 1, 2012

Running Apache and PHP on Mac OS

Apache comes installed on Mac OS 10.5.

The config files are in:
/etc/apache2/

The log files are in:
/private/var/log/apache2/

To start the server:
sudo /usr/sbin/httpd -k start

To enable PHP, uncomment this line in /etc/apache2/httpd,conf:
LoadModule php5_module libexec/apache2/libphp5.so

DocumentRoot is:
/Library/WebServer/Documents

Server is accessible by:
http://localhost/

It is also pre-configured such that ~/Sites can be accessed by:
http://localhost/~username/

So with your regular user account you can just put your files in the Sites folder.

No comments:

Post a Comment