Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

So I have a problem - I have my main site on apache web server on debian on port 80; I develop a web server (in some C++ or C#) and it currently runs on port 6666. But some people are living under firewalls and can access only port 80. I wonder if it is possible via apache map all requests to say mysite.com:80/6666/url as if they were to mysite.com:6666/url, not map via redirection, but really make apache stream content from my site to user as if it were in some folder?

share|improve this question

2 Answers 2

Here is a good answer on Ask Ubuntu

iptables -t nat -A PREROUTING -p tcp --dport 6666 -j REDIRECT --to-port 80

This assumes you're not routing traffic for an entire network through this box and that if you were there's no expectation that traffic destined for other hosts will be on that port

Update

In case you mess up your iptables, here is a great article on flushing the tables and getting back to normal :)

share|improve this answer
1  
this seems like it would rout users to the entire port 80 - not emulate a folder under it... –  myWallJSON Mar 22 '12 at 13:26

You could use a reverse proxy via mod_proxy. The Apache Httpd configuration would be along these lines:

    ProxyPass /6666/ http://localhost:6666/
    <Location /6666/>
            ProxyPassReverse /6666/
            Order deny,allow
            Allow from all
    </Location>
share|improve this answer

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.