UPDATE: The below can now be completed using 'Server.app' & as such i'd not advise you perform redirects this way. If you have performed the redirects as directed below, you may have an error which has a resolution mentioned here.
With the move to Lion Server, Apple stripped moved administering the Web service from the new Server.app.
This over-simplification has caused me some head scratching as many of the options I’d become familiar with had been replaced with little more than an On/Off switch.
But don’t fret! It turns out that these options still exist, it’s just you need to hunt for them.
Virtual hosts are best explained in the opening paragraph here. To enable this on Lion Server do the following
- In Terminal type: sudo nano /private/etc/apache2/httpd.conf
- Uncomment out (remove the # at the start) of the line that reads: Include /private/etc/apache2/extra/httpd-vhosts.conf
- Press “CTRL + X”
- Press “Y”
- Press Enter
- Restart the Web service from with Server .app (flick the switch).
- …errr that’s it.
To actually use Virtual Hosts, you’ll need to modify /private/etc/apache2/extra/httpd-vhosts.conf. Further information on how to edit this file can be found here.
2 thoughts on “How To: Enable Virtual Hosts on Lion Server”
Thank you so much for posting this!