How To: Port Redirect Web Traffic On Lion Server


UPDATE: With the release of 10.7.3, you can now do this via "", so i'd advise against the below method. If you have used the below & upgraded to 10.7.3 & have an error in "" when managing the web service, click here.

Port redirection is (simply put), where an end user enters: & they are redirected to

On Snow Leopard server you could easily set port redirects from within the Server, but in Lion server this has all been changed.

The basics of how to enable virtual hosts on Lion server, is covered in this post. As well as links to the more advanced options.

Once Virtual Hosts have been enabled, editing /private/etc/apache2/extra/httpd-vhosts.conf enable the redirects. 

For this example we’ll take the Jamf Software Server (read: JSS). By default, it hosts it’s HTTP service on port 9006. The URL for the JSS in this example is

What we wish to achieve is that when users enter into a browser, they are redirected to

  1. In Terminal type:
sudo nano /private/etc/apache2/extra/httpd-vhosts.conf

2. Press Enter

3. Under the section “Use name-based virtual hosting.”

4. Enter: “NameVirtualHost*”

5. Press Enter

6. In the VirtualHost section enter the below:

7. Press “CTRL + X”

8. Press “Y”

9. Press Enter

10. Restart the Web service (flick the switch!)

In step 3 the server is listening for connections via the dns entry

In step 4 the server is redirecting all port 80 (read; HTTP) connections via the dns entry to

One thought on “How To: Port Redirect Web Traffic On Lion Server

Leave a Reply

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