I configured a website (DotNetNuke website) on IIS 8.5 having Windows Server 2012 R2 operating system on port 85. I accessed the website using http://localhost:85
and the website worked well. Then, I added another binding to the website in IIS with respect to IP address so that I could access it as 192.168.5.187:85
. However, I am unable to access it via the IP address as I get an error page. Specifically, I get a "404 Not Found error page".
On further investigation, I found that the website works on only one port - 85. Whenever I change the binding to point to a different port, the website doesn't work(gives a 404 Not Found error). The current site binding is
IP Address Port
* 85
and the website works fine. If I change this binding to
IP Address Port
* 83 (infact anything other than 85)
the website doesn't work.(gives a 404 Not Found error)
To summarize:
The website does not work when I add a binding having the IP address. (gives a 404 Not Found error)
The website does not work on any port other than 85 when using
localhost
. (gives a 404 Not FOund error)
I am having a hard time understanding this so can somebody help me out as I need this website to be accessible via the IP address.
After adding the corresponding bindings to IIS, since DNN supports multiple portals under the same installation and same IIS application, the bindings must be specified on DNN as well. Otherwise each request, while being served by DNN, will end in a 404 error.
To setup the bindings at DNN level, the portal aliases (bindings) can be specified by following the menu "Host > Site Management" and then editing the Portal Aliases section. To add a portal alias check http://www.dnnsoftware.com/wiki/page/portal-alias
Note that if you add another port different from what you used to install DNN the first time, and the "Auto Add Site Alias" setting is not enabled, after adding the IIS binding you also need to add a new portal alias using that port. The portal alias, in your case, would be "localhost:83". This is because while the "Auto Add Site Alias" is enabled by default, if you manually disabled the option or created a second portal, no automatic portal aliases are added.
Also remember to clear the local cache (menu "Tools > Clear Cache") because the portal aliases are cached once the application is initialized. When adding/removing portal aliases the cache is automatically cleared, but depending on certain "webfarm/cachingProvider" scenarios can be tricky.
Hope this helps!
To anyone who comes across this problem, here's the solution:
Whenever you add a new binding to a website, the
PortalAlias
table is updated in the database. This is something that is done automatically byDNN
. When a webpage request is recieved by DNN it checks thedomain url
of the webpage against the addresses stored in thePortalAlias
table and only then processes the webpage. If thedomain url
and the addresses do not match, then either 403 or 404 HTTP errors are provided as output.However, sometimes DNN fails to do add a binding automatically. Hence, if your webpage is not working on a particular IIS binding, please begin by checking the
PortaAlias
table in the corresponding database.Hope that helps!!!
There may be another application already using the other ports you tried. Open a command-prompt and run 'netstat -a' and add the output to your question so we can diagnose what is going on.