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

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

For example, I have a web service that can be accessed 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 I could change the / etc / hosts file first, but now I realize that I cannot include port numbers. I also looked at the / etc / services file without any luck ...

0


a source to share


1 answer


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 do this too.
  • Using a firewall to forward packets
+2


a source







All Articles