Deploying Your DotNetNuke Portal

Exclusive offer: get 50% off this eBook here
Building Websites with VB.NET and DotNetNuke 3.0

Building Websites with VB.NET and DotNetNuke 3.0 — Save 50%

A practical guide to creating and maintaining your own website with DotNetNuke, the free, open source evolution of Microsoft's IBuySpy Portal

$23.99    $12.00
by Daniel N. Egan | June 2008 | .NET Microsoft Content Management Open Source

Once your portal is looking the way you want it to, it is time to share your creation with the rest of the world. We want to transfer our site from our local computer and set it up on the World Wide Web.

In this article by Daniel N. Egan, you will know the following:

  • How to obtain a domain name for your site
  • What to look for in a hosting provider
  • How to modify your files to prepare for moving to a host
  • How to set up your database on a hosted site
  • What file permissions are needed for your site to run

Acquiring a Domain Name

One of the most exciting parts of starting a website is acquiring a domain name. When selecting the perfect name there are a few things that you need to keep in mind:

  • Keep it brief: The more letters that a user has to type in to get to your site the more difficult it is going to be for them to remember your site. The name you select will help to brand your site. If it is catchy then people will remember it more readily.
  • Have alternative names in mind: As time goes on, great domain names are becoming fewer and fewer. Make sure you have a few alternatives to choose from. The first domain name you had in mind may already be taken so having a backup plan will help when you decide to purchase a name.
  • Consider buying additional top-level domain names: Say you've already bought www.DanielsDoughnuts.com. You might want to purchase www.DanielsDoughnuts.net as well to protect your name.

Once you have decided on the name you want for your domain, you will need to register it. There are dozens of different sites that allow you to register your domain name as well as search to see if it is available. Some of the better-known domain-registration sites are Register.com and NetworkSolutions.com. Both of these have been around a long time and have good reputations. You can also look into some of the discount registers like BulkRegister (http://www.BulkRegister.com) or Enom (http://www.enom.com).

After deciding on your domain name and having it registered, you will need to find a place to physically host your portal. Most registration services will also give the ability to host your site with them but it is best to search for a provider that fits your site's needs.

Finding a Hosting Provider

When deciding on a provider to host your portal, you will need to consider a few things:

  • Cost: This is of course one of the most important things to look at when looking for a provider. There are usually a few plans to select from. The basic plan usually allows you a certain amount of disk space for a very small price but has you share the server with numerous other websites. Most providers also offer dedicated (you get the server all to yourself) and semi-dedicated (you share with a few others). It is usually best to start with the basic plan and move up if the traffic on your site requires it.
  • Windows servers: The provider you select needs to have Windows Server 200/2003 running IIS (Internet Information Services). Some hosts run alternatives to Microsoft like Linux and Apache web server.
  • .NET framework: The provider's servers need to have the .NET framework version 1.1 installed. Most hosts have installed the framework on their servers, but not all. Make sure this is available because DotNetNuke needs this to run.
  • Database availability: You will need database server availability to run DotNetNuke and Microsoft SQL Server is the preferred back-end. It is possible to run your site off Microsoft Access or MySQL (with a purchased provider), but I would not suggest it. Access does not hold up well in a multi-user platform and will slow down considerably when your traffic increases. Also, since most module developers target MS SQL, MySQL, while able to handle multiple users, does not have the module support.
  • FTP access: You will need a way to post your DotNetNuke portal files to your site and the easiest way is to use FTP. Make sure that your host provides this option.
  • E-mail server: A great deal of functionality associated with the DotNetNuke portal relies on being able to send out e-mails to users. Make sure that you will have the availability of an e-mail server.
  • Folder rights: The ASPNET or NetworkService Account (depending on server) will need to have full permissions to the root and subfolders for your DotNetNuke application to run correctly. Make sure that your host either provides you with the ability to set this or is willing to set this up for you. We will discuss the exact steps later in this article.

The good news is that you will have plenty of hosting providers to choose from and it should not break the bank. Try to find one that fits all of your needs. There are even some hosts (www.WebHost4life.com) that will install DotNetNuke for you free of charge. They host many DotNetNuke sites and are familiar with the needs of the portal.

Preparing Your Local Site

Once you have your domain name and a provider to host your portal, you will need to get your local site ready to be uploaded to your remote server. This is not difficult, but make sure you cover all of the following steps for a smooth transition.

  1. Modify the compilation debug setting in the web.config file: You will need to modify your web.config file to match the configuration of the server to which you will be sending your files. The first item that needs to be changed is the debug configuration. This should be set to false. You should also rebuild your application in release mode before uploading. This will remove the debug tokens, perform optimizations in the code, and help the site to run faster:
    <!-- set debugmode to false for running application --> 
    <compilation
    debug="false" />
  2. Modify the data-provider information in the web.config file: You will need to change the information for connecting to the database so that it will now point to the server on your host. There are three things to look out for in this section (changes shown overleaf):
    • First, if you are using MS SQL, make sure SqlDataProvider is set up as the default provider.
    • Second, change the connection string to reflect the database server address, the database name (if not DotNetNuke), as well as the user ID and password for the database that you received from your provider.
    • Third, if you will be using an existing database to run the DotNetNuke portal, add an objectQualifier. This will append whatever you place in the quotations to the beginning of all of the tables and procedures that are created for your database.
      <data defaultProvider="
      SqlDataProvider" >
      <providers>
      <clear/>
      <add name =
      "SqlDataProvider" type = "DotNetNuke.Data.SqlDataProvider,
      DotNetNuke.SqlDataProvider"
      connectionStringname =
      "Server=MyServerIP;Database=DotNetNuke;
      uid=myID;pwd=myPWD;"
      providerPath =
      "~ProvidersDataProvidersSqlDataProvider"
      objectQualifier = "DE"
      databaseOwner = "dbo"
      upgradeConnectionString =
      ""

      />
  3. Modify any custom changes in the web.config file: Since you set up YetAnotherForum for use on our site, we will need to make the modifications necessary to ensure that the forums connect to the hosted database. Change the to point to the database on the server:
    <yafnet>
    <dataprovider>yaf.MsSql,yaf</dataprovider>
    <connstr> user
    id=myID;password=myPwd;data source=myServerIP;initial
    catalog=DotNetNuke;timeout=90 </connstr>
    <root>/DotNetNuke/DesktopModules/YetAnotherForumDotNet/</root>
    <language>english.xml</language>
    <theme>standard.xml</theme>
    <uploaddir>/DotNetNuke/DesktopModules/yetanotherforum.net
    /upload/</uploaddir>
    <!--logtomail>email=;server=;user=;pass=;</logtomail-->

    </yafnet>
  4. Add your new domain name to your portal alias: Since DotNetNuke has the ability to run multiple portals we need to tell it which domain name is associated with our current portal. To do this we need to sign on as host (not admin) and navigate to Admin | Site Settings on the main menu. If signed on as host, you will see a Portal Aliases section on the bottom of the page. Click on the Add New HTTP Alias link:
  5. Deploying Your DotNetNuke Portal

Building Websites with VB.NET and DotNetNuke 3.0 A practical guide to creating and maintaining your own website with DotNetNuke, the free, open source evolution of Microsoft's IBuySpy Portal
Published: March 2005
eBook Price: $23.99
Book Price: $39.99
See more
Select your format and quantity:
  1. Add your site alias into the HTTP Alias box and click on Update to finish:
  2. Deploying Your DotNetNuke Portal

  3. Build your portal in release mode:
    The DotNetNuke project when downloaded is set up to be used and debugged in Visual Studio. In order to remove the debug tokens and speed up the response time for each page request, you will need to compile the project in release mode. For this, open up the DotNetNuke solution in Visual Studio, change the build type in the Solutions Configurations dropdown, and build the solution by going to Build Solution on the Build menu:
  4. Deploying Your DotNetNuke Portal

  5. Configure your application to work with the.NET framework 1.1: If you enter HTML into a textbox while using the 1.1 version of the .NET framework, you may get an error message "A potentially dangerous Request.Form value was detected...". To stop this from occurring, set the validateRequest attribute in the web.config file to false:
    <pages enableViewStateMac="true" validateRequest="false" />

Now the code files for your DotNetNuke installation are ready to post to your hosted server. Before that can happen, you need to set up the database on the server.

Setting Up the Database

There are a few ways to get your database set up on the remote server. It all depends on how you want to start your site on the hosted server. If you have set up your localhost site by applying skins, adding modules, and installing forums, generally setting it up how you want to see it on the Web, you probably do not want to have to recreate this information when you post it to your hosted account. On the other hand, you may want to just get DotNetNuke up and running on the hosted server and then set it up how you want it.

We will cover both methods. We covered this when we set up our site locally, but if you set up a fresh install of DotNetNuke on the hosted server, it is important that you change the default admin and host passwords as soon as you have it running.

Backup and Restore Database

We will be using Microsoft’s Enterprise Manager to accomplish this task. If you do not have access to these tools or if you have been using MSDE for you local server there are tools that you can use to accomplish the same tasks. You can use free tools such as DbaMgr (http://www.asql.biz/DbaMgr.shtm) or the command-line interface with Microsoft’s osql utility (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/coprompt/cp_osql_1wxl.asp). Either way, the basic concepts of this procedure will be the same.

If you want to keep the information and setup that is located in your local database, you will need to make a backup copy of the database. To begin, open Enterprise Manager, drill down on the (local) server, and open up the Databases folder. Look for DotNetNuke and right-click on it to bring up the menu. Select All Tasks and Backup Database to begin the back-up procedure.

Deploying Your DotNetNuke Portal

On the General tab, leave all the default settings and click on Add. In the File Name box, enter the location where you would like the backup saved and fill in a name for your backup. It is common to put an extension of .bak at the end of the file name, but it is not necessary. Click on the OK button on the Select Backup Destination dialog and then click on OK again on the General tab. You will receive a message when the backup completes successfully.

Deploying Your DotNetNuke Portal

What you do with the backup file will depend on your hosting provider. Some providers give you the ability to do backup and restore operations on your own; other providers will do the restore for you. Contact your provider to find out how you can restore the database on their server.

Building Websites with VB.NET and DotNetNuke 3.0 A practical guide to creating and maintaining your own website with DotNetNuke, the free, open source evolution of Microsoft's IBuySpy Portal
Published: March 2005
eBook Price: $23.99
Book Price: $39.99
See more
Select your format and quantity:

Build New Database

If you would like to start your site from scratch on your hosted web server, you will need to manually create the database that will hold the tables and stored procedures needed to run DotNetNuke. This procedure will differ depending on your provider. Some may give you web access to your database; others will allow you to use Enterprise Manager to connect to your database server. We will be using the Enterprise Manager to accomplish this task. To get to Enterprise Manager, click on the Start button, go to Programs | Microsoft SQL Server | Enterprise Manager. Drill down on the (local) server by clicking on the plus (+) signs, right-click on Databases, and select New Database.

Deploying Your DotNetNuke Portal

Type DotNetNuke into the name field and click OK.

Deploying Your DotNetNuke Portal

It will take a few moments for your database to be created. This will generate the system tables and stored procedures. The actual tables and procedures needed to run DotNetNuke will be created when you navigate to your portal for the first time.

Note that the web.config connection strings that we discussed earlier will need to be set properly for this to work.

FTP Your Files

The easiest way to transfer your files from your local computer to the hosted server is to use File Transfer Protocol (FTP). You will need to obtain the location of your FTP account from your hosting provider. Once you have this information, you can use any number of tools to send your files. FrontPage XP and Macromedia Dreamweaver both have tools available to FTP files. You can also find free FTP programs such as FTP Commander (http://www.vista.ru/2inter.htm) or SmartFTP (http://www.smartftp.com/download/), which will also help you transfer your files. Once you have uploaded your files to the server, you need to give the appropriate file permissions for your portal to work correctly.

Not all files need to be uploaded to the hosted site. Files with extensions of .vb, .resx , .vbproj, .vbproj.webinfo, .sln, .doc, .bat, and .rsp do not need to be uploaded. There have been discussions of creating a "hosted" version of the code so that unneeded files could be left behind, but as of now, no "hosted" version has been created. My suggestion would be that if you understand enough to remove the unneeded files, do so; if not, leave them there.

The file permissions needed for your portal will differ slightly depending on the type of server on which your account will be hosted.

If your portal will be hosted on a Windows 2000 server using IIS5, the {NameOfServer}/ASPNET user account must have read, write, and change control of the root application directory (this allows the application to create files and folders). This will be the directory that holds all of your files. Your provider will know the folder that needs permissions as it'll be setting up the virtual directory.

If your portal will be hosted on a Windows 2003 server using IIS6, the {NameOfServer }/NetworkService user account must have read, write, and change control of the root application directory.

Some providers give you the ability to set these permissions yourself; others will need to set the permissions for you.

Once the file permissions are set, all that is needed to complete the setup is to navigate to your site. If you are starting from scratch, your database tables and stored procedures will be created and you are ready to start adding content to your portal. As with any software installation, we have not covered all the issues that can arise. If you run into any issues during installation, make a descriptive post in the DotNetNuke forums for additional help (http://www.asp.net/forums/showforum.aspx?forumid=90).

Summary

In this article, we covered the steps necessary to take the site you created from your local machine and post it for everyone to see on the World Wide Web. The tasks needed to accomplish this are not difficult, but may require the assistance of your host provider. With our portal up and running, we will discuss how to run multiple portals from one DotNetNuke installation.

About the Author :


Daniel N. Egan

Over the past seven years, Daniel has held a variety of positions in the information technology and engineering fields. Currently, he is a System Development Specialist for Automated Data Processing's Southern California region working extensively in database applications and Web development. Daniel is an MCP and MCSD.

In addition to his development work, he teaches a VB.NET Certification course at California State University Fullerton as well as serves on its .NET Advisory board. He is also the founder and chief author of Dot Net Doc (http://www.DotNetDoc.com), a .NET and DNN developer resource website built using the DotNetNuke framework. He has written numerous articles on DotNetNuke and the underlying DNN architecture. He is also the founder of the LA/Orange County DNN Usergroup and is currenly working on two DNN Related projects. DNNUsergroup Online (http://www.DNNUGOnline.com), a portal designed to allow usergroups to broadcast their meetings online. DotNetNuke Radio, a live internet radio show about DotNetNuke.

Books From Packt

Building Websites with VB.NET and DotNetNuke 4
Building Websites with VB.NET and DotNetNuke 4

DotNetNuke Skinning Tutorial
DotNetNuke Skinning Tutorial

Building Websites with e107
Building Websites with e107

Drupal 5 Themes
Drupal 5 Themes

Programming Windows Workflow Foundation: Practical WF Techniques and Examples using XAML and C#
Programming Windows Workflow Foundation: Practical WF Techniques and Examples using XAML and C#

Visual SourceSafe 2005 Software Configuration Management in Practice
Visual SourceSafe 2005 Software Configuration Management in Practice

LINQ Quickly
LINQ Quickly

BlackBerry Enterprise Server for Microsoft® Exchange
BlackBerry Enterprise Server for Microsoft® Exchange

 


 

 

No votes yet

Post new comment

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
C
1
f
p
G
Q
Enter the code without spaces and pay attention to upper/lower case.
Code Download and Errata
Packt Anytime, Anywhere
Register Books
Print Upgrades
eBook Downloads
Video Support
Contact Us
Awards Voting Nominations Previous Winners
Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
Resources
Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software