views:

512

answers:

2

I've just become a proud owner of a MediaTemple virtual-dedicated server. My question is: How can I forward a port to redirect it to a directory? For example, I would like to redirect port 6783 (e.g., http://www.imagreedybastard.com:6783) to the directory /usr/directories/admin/

+1  A: 

You'll need to run a web server on the VPS such as Apache or Nginx. After you set up the server to listen on the proper port, you'll probably also need to configure your virtual machine's firewall to allow requests to that port.

With regards to pointing it to the proper directory, you'll want to set up an Apache VirtualHost or Nginx server block.

Ben Alpert
What about actually setting it up to look at a certain directory?
Sam
+4  A: 

This depends on your web server. For Apache, you can define a new listening port, create a virtual host on that port, and point its document root as desired:

# Open the port
Listen 6783

# Expect virtual host requests
NameVirtualHost *:6783

<VirtualHost *:6783>
    DocumentRoot /usr/directories/admin
    ServerName www.imagreedybastard.com
    # blah blah blah
</VirtualHost>
Jeffrey Hantin