Monthly Archive for November, 2008

Virtual Hosts in Leopard (after upgrading from Tiger and still knowing next to nothing about Apache)

Based on this, this and this.

First a note: On Tiger, Apache configs are stored in /etc/httpd. Make a copy of this if you’ve made changes to it on Tiger, and then just delete the folder to avoid future confusion. On Leopard they’ve moved to /etc/apache2/.

Open /etc/apache2/httpd.conf and:
Uncomment (remove the # from) line 461 so it reads Include /private/etc/apache2/extra/httpd-vhosts.conf.
Save and close /etc/apache2/httpd.conf.

Now open /etc/apache2/extra/httpd-vhosts.conf.
Make sure line 19, NameVirtualHost *:80, isn’t commented.
Comment or remove both VirtualHost example blocks at the end (everything from <VirtualHost *:80> to </VirtualHost>.
Save and close /etc/apache2/extra/httpd-vhosts.conf.

Next open /etc/apache2/users/YOURUSERNAME.conf, or create it if it doesn’t exist. YOURUSERNAME is the short name as seen in your home directory.
Copy and paste the following:

<Directory "/Users/YOURUSERNAME/Sites/">
    Options All
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>
<VirtualHost *:80>
    DocumentRoot "/Users/YOURUSERNAME/Sites"
    ServerName localhost
</VirtualHost>

If you want additional virtual hosts just add another block. For example I have a local WordPress installation that I want to access by simply typing “wp” in Safari:

<VirtualHost *:80>
    DocumentRoot "/Users/justin/Sites/wordpress"
    ServerName wp
</VirtualHost>

Save and close /etc/apache2/users/YOURUSERNAME.conf.

Lastly you need to add your virtual host names to /etc/hosts. It probably looks like this:

127.0.0.1	localhost
255.255.255.255	broadcasthost
::1             localhost

Add one line for each additional virtual host. For me that would be just 127.0.0.1 wp.

Turn Web Sharing off and on again from System Preferences > Sharing and you’re good to go.

I’ll be writing another one about running WordPress locally.

Threadless coupon code

By the way use this link to get me some points, and enter the coupon code holiday08 when ordering to get a $3 discount. Also they ran out of medium Rock is dead hoodies and I am a very angry man.

I dreamt of the truth


Software guitar: still not quite what I want it to be. I reckon I’ll expand upon this sometime, but I had to write down that ending riff that’s been bugging me for days. Grab the track here.

Threadless Sale

Taking orders til Wednesday. Don’t hold me to this just yet but I’d estimate US$10 shirts work out to about SGD$18.50 including shipping, and US$15 shirts about SGD$26.

so everyone seems to like this


but I keep having this feeling that something is missing. Ing ing ing ing ing. Or wrong. Is the bit to the left of the R too straight. I think that may be it but no not photoshop again no i just want to watch the latest episode of chuck nooo