Question

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/

Was it helpful?

Solution

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>

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top