Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Permitting external access to a firewalled port via apache
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Vlad
Apprentice
Apprentice


Joined: 09 Apr 2002
Posts: 264
Location: San Diego, California

PostPosted: Fri Apr 14, 2006 9:10 pm    Post subject: Permitting external access to a firewalled port via apache Reply with quote

Hey guys,

I have a daemon serving webpages on the localhost of a server, port 7000. I'd like both internal and external clients to access it via apache. Clients can reach the server *only* by ports 80 and 443. I've tried searching the forums but I'm not really sure what to search for so my searches have been fruitless.

The problem I'm having seems common enough but I haven't had any luck getting the suggested solutions working. At first someone pointed me towards using mod_rewrite, but this clearly wont work as rewriting the URL from http://server to http://server:7000 will just cause the requests to be dropped by the firewall. Another solution was to use mod_proxy, but that also doesn't seem to work. I thought ProxyRemote would do the trick but it did nothing. iptables solutions seem ineffective as I need to maintain the request path so as to not interfere with the rest of the web server traffic. Preferably, I'd like to keep it hostname independent: The server is NATed and the FQDN used to access it is not the same as it's internal network name.

So, does anyone know how I can get apache to take traffic from a local port and send it to a client as if it were inside of apache?

Here's a little schematic of what I'm trying to do:

[CLIENTS] [ SERVER ]
Client request [http://server/pcs] ----> [httpd port 80] <-> [pcsd port 7000]

Server responds by serving content from the pcsd daemon on port 7000 and is transparently seen as content from URL http://server/pcsd

Thanks for the help! If you need any more information please let me know.

Vlad
Back to top
View user's profile Send private message
eldad
Retired Dev
Retired Dev


Joined: 26 Jan 2006
Posts: 45
Location: Israel

PostPosted: Fri Apr 14, 2006 10:04 pm    Post subject: Reply with quote

mod_proxy is the way to go.

ProxyRass /srv7000/ http://server:7000

and then you access the root of the server that is hosted on port 7000 as http://server/srv7000/

simple, and works like a charm.
Back to top
View user's profile Send private message
Vlad
Apprentice
Apprentice


Joined: 09 Apr 2002
Posts: 264
Location: San Diego, California

PostPosted: Sat Apr 15, 2006 4:10 am    Post subject: Reply with quote

This is exactly what I needed. With a little bit of trickery I managed to get exactly what I needed. Thanks a ton!

Vlad
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum