Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

In my home, I have a single Comcast modem connected to a D-Link router. The domain name myDomain.com points to my Comcast IP (yes, I know this is probably not okay, but I am only using it for personal testing with very little bandwidth, and have another server for production). The router is connected to several PC clients and two Linux servers. The Linux server static IPs are 192.168.0.200 and 192.168.0.201.

I've set up virtual server (i.e. port forwarding) to pass ports 21, 22, 80, 443, and 10000 to 192.168.0.200.

192.168.0.201 is just a PHP based fax server, and I wish to access it also using HTTP (i.e. Port 80). But I can't use Port 80 since I am already using this port for 192.168.0.200.

So, would I just access the fax server using http://myDomain.com:123/sendAFax.php and create another virtual server to forward port 123 to 192.168.0.201? Which port number should I use? Or is there a better way to do this?

share|improve this question
1  
Are you using Apache? Reverse Proxy and subdomains is what you should use...... serverfault.com/questions/55846/… example - h**p://fax.myDomain.com/ –  Logman Jul 14 '13 at 19:20
    
Yes, I am using Apache. Do you agree with Eccentropy's advice that I won't be able to use this solution with my existing configuration? –  user1032531 Jul 14 '13 at 20:06
    
if I had the time I would go to turnkeylinux.org and get a virtual machine and test it. –  Logman Jul 14 '13 at 21:40

1 Answer 1

up vote 0 down vote accepted

@user1032531, you're on the right path.

You're using NAT on a home network,so you won't be able to use @Logman's solution since you're still dealing with port 80, and a single IP Address (COMCast's).

You could use any unassigned port such as 8080, 8888, etc.

Try this:

  1. Forward port 8080 on your router to port 80 on 192.168.0.201, and leave your 192.168.0.201 web server serving port 80.
  2. To access that server from the Internet, you'd use http://myDomain.com:8080/sendAFax.php. Port forwarding will take care of hooking up your external port 8080 to 192.168.0.201's port 80.
share|improve this answer
    
For some reason, I cannot access myDomain.com:8080 (FF gives me Firefox can't establish a connection to the server at myDomain.com:8080.). I've turned of iptables and have selinux in permissive mode. For my router, I have IP Address as 192.168.0.201, public IP as 8080, and private IP as 80. Any suggestions? Thank you –  user1032531 Jul 14 '13 at 20:03
    
Can you get to 192.168.0.201 on the local LAN? A dumb question, but want to rule it out: Are you using DDNS (Dynamic DNS) on your router to update the public IP address for myDomain.com? Is the IP address correct? Can you try to hit myDomain.com:8080/sendAFax.php from a mobile device [not connected to your local LAN via WIFI] to make sure it isn't a client/browser issue? –  Eccentropy Jul 14 '13 at 20:37
    
I can access 192.168.0.201 on local LAN. I am using DDNS. IP is correct. Mobile devices do not make a difference. Note that I can access 192.168.0.201/index.php but not 192.168.0.201:8080/index.php. Maybe I should make Apache listen to 8080 also? –  user1032531 Jul 15 '13 at 1:44
    
You shouldn't need to make Apache listen on port 8080 if your port forward is set up correctly. For simplicity, you could use only port 8080 on 192.168.0.201 instead of using port 80, and having the port forward from 8080 to 192.168.0.201:8080. –  Eccentropy Jul 16 '13 at 0:21
    
Had firewall issues, and once fixed, all worked like a charm. –  user1032531 Jul 16 '13 at 15:37

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.