logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Port Routing within Apache
Author
LHovo



Joined: 03 Dec 2006
Posts: 4

PostPosted: Mon 04 Dec '06 6:19    Post subject: Port Routing within Apache Reply with quote

I'm wanting to redirect a address like http://192.168.1.x:8080 to http://192.168.1.x:80/OtherWebPage, so any page on port 8080 gets routed to a directory on port 80.
is this possible Question

Thanks
Lhovo
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Mon 04 Dec '06 10:40    Post subject: Reply with quote

Code:

<VirtualHost *:8080>
    ServerAdmin you@whatever.tld
    ServerName  http://192.168.1.24
    ErrorLog C:/server2/logs/sun.error.log
    CustomLog C:/server2/logs/sun.access.log common
ProxyPass / http://192.168.178.24/folder/
ProxyPassReverse / http://192.168.1.24/folder/
ProxyHTMLURLMap http://192.168.1.24/folder/ /
<Location />
ProxyPassReverse /
    SetOutputFilter     proxy-html
    ProxyHTMLURLMap     /    /
    ProxyHTMLURLMap     /    /
    RequestHeader      unset    Accept-Encoding
</Location>
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
</VirtualHost>


requires
Code:

LoadModule vhost_alias_module modules/mod_vhost_alias.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_html_module modules/mod_proxy_html.so
LoadFile   /server2/apache/bin/libxml2.dll


All modules are included in apach, but mod_proxy_html can be found here
http://www.apachelounge.com/download/
Back to top
LHovo



Joined: 03 Dec 2006
Posts: 4

PostPosted: Sun 10 Dec '06 1:25    Post subject: Reply with quote

I cant seem to get it to work? Crying or Very sad
can someone look over my code for me

Thanks
Lhovo

<VirtualHost *:6886>
ServerAdmin myemail@somewhere.com
ServerName http://192.168.1.94
ErrorLog "C:/Program Files/xampp/apache/logs/sun.error.log"
CustomLog "C:/Program Files/xampp/apache/logs/sun.access.log" common
ProxyPass / http://192.168.1.94/TorHovo
ProxyPassReverse / http://192.168.1.94/TorHovo
ProxyHTMLURLMap http://192.168.1.94/TorHovo /
<Location />
ProxyPassReverse /
SetOutputFilter proxy-html
ProxyHTMLURLMap / /
ProxyHTMLURLMap / /
# RequestHeader unset Accept-Encoding
</Location>
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
</VirtualHost>

P.S What does the RequestHeader do? Apache didn't like this line
Back to top
LHovo



Joined: 03 Dec 2006
Posts: 4

PostPosted: Sun 10 Dec '06 2:53    Post subject: Reply with quote

Got RequestHeader working, another module was needed,
Still not working though..
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Sun 10 Dec '06 21:22    Post subject: Reply with quote

Sorry I made a mistake!

<VirtualHost *:80>


and

ProxyPass / http://192.168.1.94:6886/TorHovo

and so on Wink
Back to top
LHovo



Joined: 03 Dec 2006
Posts: 4

PostPosted: Sun 24 Dec '06 5:41    Post subject: Reply with quote

A big Thanks to James Very Happy

my final code is below for anyone else who may want something simular

<VirtualHost *:80>
ServerAdmin myemail@somewhere.com
ServerName http://192.168.1.94
ErrorLog "C:/Program Files/xampp/apache/logs/sun.error.log"
CustomLog "C:/Program Files/xampp/apache/logs/sun.access.log" common
ProxyPass /Torrents/ http://192.168.1.94:6886/
ProxyPassReverse / http://192.168.1.94/Torrents
ProxyHTMLURLMap http://192.168.1.94/Torrents /
<Location />
ProxyPassReverse /
SetOutputFilter proxy-html
ProxyHTMLURLMap /Torrents /
ProxyHTMLURLMap /Torrents /
RequestHeader unset Accept-Encoding
</Location>
ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
</VirtualHost>
Back to top


Reply to topic   Topic: Port Routing within Apache View previous topic :: View next topic
Post new topic   Forum Index -> Apache