How To: Enable Virtual Hosts on Lion Server

Standard

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

  1. In Terminal type: sudo nano /private/etc/apache2/httpd.conf
  2. Uncomment out (remove the # at the start) of the line that reads: Include /private/etc/apache2/extra/httpd-vhosts.conf
  3. Press “CTRL + X”
  4. Press “Y”
  5. Press Enter
  6. Restart the Web service from with Server .app (flick the switch).
  7. …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

Leave a Reply to Andy BoutteCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.