This tutorial is for customers utilising Business Cloud Hosting product or above, or any of the older product equivalents. If you are on cPanel or Startup/Economy Cloud hosting products, you will need to upgrade in order to utilise IIS7.
As a web developer or a designer aiming to run a ASP.NET application in a shared hosting environment with us, use the below as a checklist to ensure you have configured your application appropriately in order for it to function inside the Clustered shared hosting environment supplied by Netregistry.
All of the below updates will involve your web.config file. We are merely configuring your application to work with Clustered shared hosting.
Make sure you can see detailed error messages
By default, your application will hide errors and merely throw a “500 Internal Server Error” message if it can’t do something.
If you can’t see the true server errors for your application it’s impossible to debug your code and therefore your development will turn into wild stabbing in the dark. To save yourself the frustration, start any development by enabling Detailed errors in your web.config. Edit web.config to include the following code:
<configuration> <system.webServer> <httpErrors errorMode="Detailed"/> </system.webServer> </configuration>
Make sure any Web requests are done via a Proxy
If your application needs to connect to any third party or even local server hostnames via HTTP, you will need to use a Proxy server. Simply add the following code in yourweb.config once somewhere above any third party connection:
<system.net> <defaultProxy> <proxy usesystemdefault = "false" proxyaddress="http://proxy.private.netregistry.net:3128" bypassonlocal="true" /> </defaultProxy> </system.net>
Save your session data to Session State
Session data is externalised in clustered environments due to the nature of the task at hand — saving session data on the webserver used for the request means potential loss of data as another request is made via a different node inside the cluster.
We supply a Session State server to save session data to. The code to add to your web.config is:
<sessionState mode="StateServer" stateConnectionString="tcpip=asp-ss.netregistry.net:42424"/>
For full details on Session State, please see Session Handling on IIS7 (ASP.NET)
Create a MachineKey for your application
MachineKey assists in validating session data, which is the most popular application of the MachineKey on our cloud network. View the full details on creating a MachineKey :
Make use of preinstalled modules and frameworks
We have installed the following modules on the IIS7 cluster to assist customers with the most common of website functions.
Click the links below for full support information on the usage of those components – all of these link to the vendor documentation:
- Microsoft URL Rewrite
- File Upload – w3Upload
- Image Manipulation – w3Image
- Sending Email – w3JMail
- MD5 Encryption object
Something is not working and the error is not making sense
Contact us. While we don’t supply coding/development support, we can make sense of an error message and point you in the right direction. From our experience, in the majority of cases where customers have come across difficulties with their .NET applications – one of the above web.config updates in this article was not observed.