Tidbits

Things I have found myself repeating, and other ramblings.

Enable Apache on a Mac

Create the Apache conf file for your user

1
$ sudo cat > /etc/apache2/users/`whoami`.conf

Add the following to that file (change <username> to your Mac’s username)

1
2
3
4
5
6
<Directory "/Users/<username>/Sites/">
     Options Indexes MultiViews
     AllowOverride All
     Order allow,deny
     Allow from all
</Directory>

Complete the setup (this is where your sites will go)

1
$ mkdir ~/Sites

Start Apache

1
$ sudo /usr/sbin/apachectl start

This will also setup Apache to relaunch on system restarts.

To stop Apache, as well as disabling it for relaunch on system restarts,

1
$ sudo /usr/sbin/apachectl stop

To restart a running Apache

1
$ sudo /usr/sbin/apachectl restart

Access your sites as

1
http://localhost/~<username>/