DotNetNuke on IIS + Apache as proxy

Problem
While we can give people in the local network the address with the port, they do not understand the address with this symbol “:” and they forget or mistype it. Also we’re used to type addresses like: redmine, svn, wiki, and go to the desired service. Why not the same for an IIS application?
DotNetNuke was configured with the option UsePortNumber set to True. This allows you to access the application using another port. It seems like a hack for the redirection service. If you don’t put that DotNetNuke will do a redirect loop. DotNetNuke will ignore the port in your request and will try to go to the default site alias:
- You visit test:90
- DotNetNuke finds only test as host
- DotNetNuke redirects to the default site alias: test:90
- Go to point 2.
But UsePortNumber forces the port number always. If you’ve made your connection using port 90, but you ask for host mydevhost, DotNetNuke will alter the host to mydevhost:90 and force a redirect (302). This can be a mess if you have an apache as a reverse proxy not using that port for requests. DotNetNuke will always redirect you. If you have access to the redirected host, is ok, but if not, you won’t be able to access (imagine apache serving internet requests for a intranet installation).
Solution
Configure your apache reverse proxy using mod_proxy. Example:
<VirtualHost *:80> ServerAdmin yo@yoyo.yo ServerName mydevhost ServerAlias mydevhost.mydomain.local ProxyPreserveHost On ProxyPass / http://localhost:90/ ProxyPassReverse / http://localhost:90/ </VirtualHost>
Add mydevhost as an alias for your portal and in your web.config disable UsePortNumber.
This will stop you from accessing DotNetNuke in the 90 port, but will let the proxy work and won’t force any strange redirect. Perhaps with mod_rewrite something better can be done, but I haven’t tried.
I Hope this helps
.
Tags:apache,dnn,DotNetNuke,proxy,proxypass,redirect,reverse proxy »
Trackback URL: http://fitri.manzanisimo.net/2008/12/08/dotnetnuke-on-iis-apache-as-proxy/trackback/
Hans Kruse said,
2008-12-24 @ 7.14 pm
Γειά σου,
I tried your solution. However when logging in the site still redirects to the site with the portnumber. I get DNN site and if I remove ” :90″ from the url in the browser the rest works. I checked the html code for any remaining “:90″ in the html but that was OK.
Did you have that same experience and if so have a solution to this?
greetings,
Hans Kruse