LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Port forwarding (https://www.linuxquestions.org/questions/linux-networking-3/port-forwarding-4175505237/)

enkrypted 05-16-2014 02:34 PM

Port forwarding
 
I have a VPS with a single IP which is already running apache on port 80. I am also running WEBrick on a different port, 8080 for instance. the Apache on port 80 already serves abc.domain.com, now I want to serve xyz.domain.com using WEBrick. WEBrick is running on port 8080, so setting up an A record requires me to append a :8080 to the end of the subdomain, which is undesirable. I have tried setting up an A record to the IP, and then setting up an SRV record to the subdomain to the A record with the port in it, apparently it doesn't work that way. I guess I should be able to do this using iptables then? I am using jekyll btw, if that helps. Not entirely sure if jekyll uses WEBrick. I cannot get any more IPs on this VPS. and abc.domain.com:8080 does show the jekyll page, because apache virtual hosting doesn't work on ports apache isn't running on( obviously).

Ygrex 05-17-2014 01:39 AM

iptables does not work with HTTP hostnames, I guess you need Apache proxy:
http://httpd.apache.org/docs/current/rewrite/proxy.html

enkrypted 05-17-2014 02:17 AM

I used Virtual Hosts and mod_proxy and it worked. Apparently I was wrong.


All times are GMT -5. The time now is 10:14 AM.