Question

How I can map a service running on a specific port number to an alias on Ubuntu 8.10?

For example, I have a webservice which I can access like this:

http://localhost:3000/

But I want to access like this:

http://myservice/

I only want to access the service from the same machine.

I am running Ubuntu 8.10 and I thought at first I could modify the /etc/hosts file but I now understand I cannot include port numbers. I also looked at /etc/services file without any luck so far...

Was it helpful?

Solution

The default port for "http" is 80, so you need root privileges to do this. There are several routes you can take:

  • ssh -l root -L 3000:localhost:80 localhost
  • netcat should be able to do this, too
  • Use the firewall to forward packets
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top