Forum Moderators: phranque
ourdomain.com:1111 <-mapped to--> internal-pc1:3389
ourdomain.com:2222 <-mapped to--> internal-pc2:3389
at some places ports other than 80 are blocked so we cannot connect to our custom ports. is there a way to map different virtual names (bound to apaches port 80) to our internal pcs? for example:
pc1.ourdomain.com:80 <-mapped to--> internal-pc1:3389
pc2.ourdomain.com:80 <-mapped to--> internal-pc2:3389
I've checked mod_proxy but couldn't figured out a way. anyhelp is appreciated cause this is an emergency.
ps:we have only one static ip addr. matching our domain name
So, using Apache you can't do this. There are alternatives, for example in Windows 2008 Server there's a new "feature" called Terminal Services Gateway (TS Gateway), that's something you are looking for...
Listen 80
Listen 81
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot C:/Inet/www/
ServerName www.ourdomain.com
</VirtualHost>
<VirtualHost *:81>
DocumentRoot C:/Inet/www/
ServerName www.ourdomain.com
SSLEngine On
SSLCertificateFile conf/ssl/web.crt
SSLCertificateKeyFile conf/ssl/web.key
</VirtualHost>
<VirtualHost *:80>
SSLProxyEngine On
ProxyRequests Off
ServerName secure.ourdomain.com
ProxyPreserveHost On
ProxyPass / [ourdomain.com:81...]
ProxyPassReverse / [ourdomain.com:81...]
</VirtualHost>
with this setup I want to be able to reach our https site by pointing out secure.ourdomain.com address. But I couldn't.. The very same setup is needed to proxy to our secure webmail service running on a different port. Its ok when its plain connection but I'm out of luck with ssl. I'm doing smth. wrong or I got the whole idea wrong?
It means that each SSL secured website (virtualhost) must have it's own ip address, or port number (or both), that's only only way for the Apache to determine which virtualhost to use
I'm not sure of the behavior of the SSLProxyEngine directive, but probably it proxies the SSL protocol from the remote server to the local server (and to the browser), so it has the same behavior as a "normal" SSL website, which means you have to put it on a different ip address or different port.
But I don't get the idea of running a https website and proxying the same thing to the same server on a different name (on the http port)? If you only want to make secure.example.com SSL secured too, then you should only make one SSL enabled virtual host, and that virtualhost must be declared like this:
<VirtualHost *:81>
DocumentRoot C:/Inet/www/
ServerName www.ourdomain.com
SSLEngine On
SSLCertificateFile conf/ssl/web.crt
SSLCertificateKeyFile conf/ssl/web.key
</VirtualHost>
secure.example.com means port81
webmail.example.com means port82
I'll try ipbased config. I hope I can reach somewhere that way. thanks for your helps
What is the use of configuring SSL support for any website, and then making it unavailable for people with ports 81, and 82 blocked? And to solve it, you force a secured connection into the http protocol which is not secured? So actually what you seem to go for is to secure the communication between your Apache instance and a server next to it (or even on the same server), but the data between your Apache and your browser will go unsecured? If that's so, I'd drop the SSL completely, unless it is running on port 443.
Back to your virtualhost configuration, it looks quite okay, except one thing, the
ProxyPreserveHost Ondeclaration, which is meant to pass on the original Host header to the remote host, may lead to undesired results in your case.