Installation Wiki

DotNetNuke

From InstallationWiki

Jump to: navigation, search
DotNetNuke (DNN)
Official Page
Project Documentation
Download
Source Book
Building Websites with VB.NET and DotNetNuke 4
Building Websites with VB.NET and DotNetNuke 4
ISBN 978-1-904811-99-2
Publisher Packt Publishing
Author(s) Michael Washington, Daniel N. Egan, Steve Valenzuela

DotNetNuke is an open-source Web Application Framework ideal for creating and deploying projects such as commercial websites, corporate intranets and extranets, online publishing portals, and custom vertical applications.

DotNetNuke is provided as open-source software, licensed under a BSD agreement. In general, this license grants the general public permission to obtain the software free-of-charge. It also allows individuals to do whatever they wish with the application framework, both commercially and non-commercially, with the simple requirement of giving credit back to the DotNetNuke project community.

DotNetNuke is built on a Microsoft ASP.NET (VB.NET) platform, and is easily installed and hosted. With a growing community of over 440,000 users, and a dedicated base of programming professionals, support for DotNetNuke is always close at hand.

In previous versions of DotNetNuke (version 3.0), whether you were a developer or just wanted to set up a quick and easy website, you needed to download the entire code base and install all of it up to your server. While the ability to download the code has not disappeared, the core team also allows you to download a slimmed-down version that only contains the files that are needed to upload and work with a basic DotNetNuke site.

In this article we cover the steps necessary to set up a non-developer version of the website on your local machine. We will show you how to set up the DotNetNuke portal and database by using Microsoft SQL Server 2005 Express Edition. Finally, we will log in as an administrator and change the default passwords.

Contents

[edit] Installing DotNetNuke (Local Version)

Before you begin installing DotNetNuke, you will need to determine if you have the .NET 2.0 Framework installed. The easiest way is to browse to the following location C:\WINDOWS\Microsoft.Net\Framework and look for a folder that starts with V2.0 (for example: v2.0.50727). If you do not see this folder, then you will have to download the 2.0 version of the .NET Framework. You can find the files at the .NET Framework home site. For our examples, we will be using Windows XP Professional, IIS 5.1, and version 2.0 of the .NET Framework.

Note. In this section of the book, we will only be using the Install Package, which only contains the items that are needed to deploy to a web host: we will be using IIS to host our site. IIS stands for Internet Information Services and is the web server application that will run our web portal. If you have downloaded the Source Package and use Visual Studio 2005 then you do not need IIS to work with DotNetNuke. We will also be using SQL Server 2005 in this discussion. DotNetNuke will work easily with SQLExpress. We will discuss installing and working with the Source Package and SQLExpress when we discuss building custom modules. If you havent installed IIS then make sure that it is installed prior to the .NET Framework.

[edit] Clean Installation

If this is the first time you are installing DotNetNuke, or you do not want to upgrade from a previous version, then you will want to perform a clean installation. This means that you will have to build your DotNetNuke instance from scratch. This article will walk you through all the steps necessary to accomplish this task. If you wish to upgrade DotNetNuke from a previous version, please refer to Upgrading.

[edit] Downloading the Code

Before we start installing our web portal, we need to download the source code. Go to the DotNetNuke website. You will be required to register before you can download the code. This step is simple, just click on the Register link in the upper right-hand corner, and fill in the required information. Provide a working email address, as the registration process will send an email that includes a verification code.

Once you receive the email you may continue to the DotNetNuke site, log in, and download the code. You will find the DotNetNuke source by clicking on the Downloads icon. If you want the documentation that comes with DotNetNuke, you will need to download both the Install Package and the Documentation Package. While the file is downloading, take time to explore what the DotNetNuke site has to offer. You will find information that will help you as you build your portal.

Note. When you are downloading, you will also see a Starter Kit for DotNetNuke. The Starter Kit is used to help Visual Studio Developers work with DotNetNuke.

Once you have the Install Package downloaded from the site, you can double-click on the ZIP file to extract its contents. Where you extract the file is entirely up to you. Most of the documentation you come across will assume that you extract it to C:\DotNetNuke so for consistency's sake we will do the same.

[edit] Setting Up a Virtual Directory

After you unzip the files, you will need to set up a virtual directory in IIS. If IIS is not already installed on your system, you can install it by going to Control Panel | Add Remove Programs | Add Remove Windows Components.

Note. For more information on installing and using IIS, see IISFaq (which utilizes the DotNetNuke framework for its portal).

A virtual directory is a friendly name, also called an alias, that allows you to separate a physical folder from a web address and defines the application's boundaries. A virtual directory is needed if your files are not located in the home directory. The home directory for IIS is found at C:\Inetpub\wwwroot (if installed at the default location). The virtual directory, or alias name, is used by those accessing your website. It is the name they type in the browser to bring up your portal so select a simple name.

The following table shows examples of mapping between physical folders and virtual directories. As you can see, we will need to set up a virtual directory for DotNetNuke since its location is outside the home directory, in C:\DotNetNuke.

Physical Location Alias URL
C:\Inetpub\wwwroot home directory (none) http://localhost
\\AnotherServer\SomeFolder Customers http://localhost/Customers
C:\DotNetNuke DotNetNuke http://localhost/DotNetNuke
C:\Inetpub\wwwroot\My WebSite None http://localhost/MyWebSite


There are two different ways of setting up the virtual directory:

[edit] Using Windows Explorer (the Easy Way)

If you are using Windows XP then the easiest way for you to set up you virtual directory is to go to C:\DotNetNuke, right-click on the folder, and select Sharing and Security.

This will open up the DotNetNuke Properties dialog. Click on the Web Sharing tab and select Share this folder.

This will present you with the Edit Alias dialog box. The dialog box will default to the name of the folder it is in, so if you extracted your file to C:\DotNetNuke, then your virtual directory will be called DotNetNuke. Leave all the default permissions and click OK to save the settings.

[edit] Using the Virtual Directory Creation Wizard

In this first step, you will set up your virtual directory using the IIS Manager and the Virtual Directory Creation Wizard. You will find the IIS Manager in the Control Panel | Administrative Tools section. Once you have IIS open, drill down until you see Default Web Site, right-click and select New | Virtual Directory.

Click Next to begin the wizard. Then, enter an alias for your website. Type in DotNetNuke and then click Next.

The next dialog box will ask you for the physical location of your DotNetNuke files. This is how IIS matches the virtual directory alias name to the web application files.

Type C:\DotNetNuke in the Directory: field and click Next. On the Access Permissions page, leave all the default permissions and click Next to save the settings.

Click Finish to exit the wizard.

[edit] Verifying Default Documents

Default documents allow you to access a web page by typing in just the folder name. DotNetNuke uses default.aspx as its default page when running the portal. To ensure default.aspx is specified as a default document for your virtual directory, scroll down in IIS until you find the DotNetNuke Virtual Directory. Right-click and select Properties.

Select the Documents tab and confirm that you see default.aspx (in addition to default.asp) in the box. If you see it, click OK to close the properties box.

If default.aspx does not exist, click on the Add button to type it into the Default Document Name box and click OK. This will successfully complete the setup of the virtual directory for DotNetNuke.

Note. If you have both versions of the .NET framework (1.x and 2.x) installed on your computer, you will need to tell IIS which framework to use with this website. On the ASP.NET tab you will need to change the ASP.NET version to the 2.x version of the framework as shown below.

[edit] Setting Security Permissions

ASP.NET web applications will usually run using the built-in ASPNET account. To allow the extensive file uploading and skinning features in DotNetNuke, you will have to set some security permissions before they start working correctly. To change these permissions, open up Windows Explorer and browse to your DotNetNuke folder (usually C:\DotNetNuke). Right-click the folder, select Sharing and Security from the menu, and click on the Security tab. Add the appropriate user account and set permissions as discussed below.

If you are using Windows 2000 (IIS5) the account that needs permissions on the DotNetNuke folder is the {Server}\ASPNET user account, where {Server} is the name of your machine running the DotNetNuke installation. It must have read and write permissions for the DotNetNuke folder. If you are using Windows 2003 (IIS6), then instead of the ASPNET account you will need to give permissions to the NT AUTHORITY\NETWORK SERVICE user account. Again, it must have read and write permissions for the folder. Also, if you use Windows authentication, you need to give the full control permissions to the local user.

Note. On an XP machine formatted to NTFS that is not part of a domain, the security tab may not be visible by default. To reveal the Security tab, open Windows Explorer, and choose Folder Options from the Tools menu. On the View tab, scroll to the bottom of the Advanced Settings and clear (click) the checkbox next to Use Simple File Sharing. Click OK to apply the change. You should now have a Security tab when viewing the properties of a file on an NTFS volume.

[edit] Setting up the Database

With DotNetNuke 4.3.3, you have a few options available to you when creating your database. If you are using SQL Server 2005 Express edition, you do not need to set up the database manually, since the DotNetNuke database will be attached during the installation process. To create the database for DotNetNuke to store data about our site, we will be using Microsoft SQL Server 2005 Express Edition. We will be using the SQL Server Management Studio to accomplish this task. For the Management Studio, click on the Start button, and go to Programs | Microsoft SQL Server 2005 | SQL Server Management Studio. Sign on to your server and drill down the (local) server by clicking on the plus (+) signs, right-click on Databases, and select New Database.

Type DotNetNuke into the Database name field and click OK.

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 run the program for the first time. Once you create your database shell, you will need to rename and modify your web.config file to connect to SQL Server. Browse to C:\DotNetNuke and find a file named release.config. Select this file and rename it to web.config.

Note: In earlier versions of DotNetNuke the web.config file could be found in the main DotNetNuke folder (C:\DotNetNuke in our setup) but to avoid the accidental overwriting of this file when doing an upgrade, you will find that the file will be given an initial filename of release.config.

When renaming is complete, use Notepad to open up the web.config file. We will explore this file in detail while discussing the DotNetNuke architecture; for now we are only concerned with a few sections of the code. The web.config file is an XML-based file so be careful while working with this file.

Within the web.config file, locate the <connectionStrings> section. In this section you will notice that there are two <add> tags, which are both named SiteSqlServer. The first one (the default) is for SQL Server Express. To use SQL Server Express, you would need to comment out the second key. Commenting in the web.config file is done using the opening tag . The example below shows the original <connectionStrings> section in the web.config.

 <connectionStrings>
 <add
 name="SiteSqlServer"
 connectionString="Data Source=.\SQLExpress;Integrated Security=True;User Instance=True;
 AttachDBFilename=|DataDirectory|Database.mdf;" providerName="System.Data.SqlClient" />
 </connectionStrings>

We then need to enter the data for our SQL Server. Add the server name (Server=), database name (Database=), user ID (uid=), and the password (pwd=) so that our application knows how to connect to our server. This information will be based on how you have set up your SQL Server.

For additional help, please refer to the following websites:

Next, we need to find the <appSettings> section and modify some more keys. The first thing you will notice is that the SiteSqlServer key is in this section as well. In order for our modules to connect to the database, you will need to fill out the information in these keys as well. For SQL Server Express 2005 you will again need to comment out the SQL Server 2005 version. Make sure you add the server name (Server=), database name (Database=), user ID (uid=), and the password (pwd=) so that our application knows how to connect to our server.

<appSettings>
 <add key="SiteSqlServer" value="Data Source=.\SQLExpress;Integrated Security=True;User Instance=True;
 AttachDBFilename=|DataDirectory|Database.mdf;"/>

The next set of keys in the <appSettings> section is for the template that is used when setting up your site for the first time. A template is used to create the default look and feel of your site. By default, the base DotNetNuke template is used to create your site. If you would like to use any of the other templates, you will need to replace (comment/uncomment) the appropriate key.

 <add key="InstallTemplate" value="DotNetNuke.install.config" />

We will be using the default DotNetNuke template so we will not modify this section.

There are a few other optional settings that we may be concerned about at this time:

  • The AutoUpgrade key: This is set to true by default and is used to determine if the upgrade/install process will run automatically.
  • The UseDNNConfig key: This key is set to true by default and tells the installation if it should look in the database or the install file located in the install folder to determine if it should upgrade. This is implemented to reduce the number of calls to the database and improve performance.
  • The InstallMemberRole key: This key is set to true by default and is used to determine whether or not to install the Membership Provider database tables for our installation. If you are sharing a database with another application that uses these tables then you would want to set this to false. We will leave it set to true for our installation.

There are many other settings located in the web.config file but for our basic implementation, we only need to be concerned with the items above. .

Once this is complete save the web.config file and you are ready to run DotNetNuke for the first time.

To do this, navigate to http://localhost/DotNetNuke in your browser. The first time you access your portal it might take a few moments to come up. This is because it is running the database scripts required to set up your SQL Server database.

While the install process is proceeding, you will see a step-by-step explanation of the process appear on your screen.


Once all the scripts have run, you will see the message below:


Once you click on the Click Here To Access Your Portal link you should finally see your DotNetNuke Portal.

[edit] Upgrading

If you already have a DotNetNuke portal and would like to upgrade from version 3.x to version 4.x, a few steps are required. The amount of modification you have made to your installation will affect the amount of time required to complete your upgrade. Since there are distinct changes to the structure of the DotNetNuke files, the best resource for upgrading your site is the DotNetNuke Installation Guide, which can be found on the downloads page once you download the Documents Package. This will walk you through the steps necessary to upgrade your site.

[edit] Upgrade Checklist

While upgrading, there are a couple of things you will need to be aware of:

  • Do you have any custom modules, either built by you or purchased? Since versions of DotNetNuke above version 4.0 employ a few changes to the module structure, some of these custom modules may no longer work. You will need to check to see if an updated version of the module is available and upgrade each module.
  • Have you made any modifications to the core architecture in the previous version? Since we will be using the code from the new ZIP file, any changes you made to the old code will no longer be available. You will need to redo those changes in the updated framework after you update the files. For this reason, it is strongly recommended that you make no modifications to the core architecture itself.
  • Make sure you DO NOT overwrite your old web.config file! One of the reasons that the web.config file is named release.config in the install package when it is downloaded is so that you do not accidentally overwrite your current web.config file. You will need to make sure that the MachineKeys in your new web.config file are exact copies of the MachineKeys in your old web.config file. If these are incorrect, your site will not work.

So if you have not done much to your site except use the standard modules then the steps to upgrade are fairly straightforward.

[edit] Back Up Your Database

1. For the Management Studio, click on the Start button, and go to Programs | Microsoft SQL Server 2005 | SQL Server Management Studio. Sign on to your server and drill down the (local) server by clicking on the plus (+) signs, right-click on Databases, look for DotNetNuke, and right-click on it to bring up the menu. Select Tasks and Backup to begin the backup procedure.


2. 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.

3. It is common to put an extension of .bak at the end of the file name, but here it is not necessary. Click the OK button on the Select Backup Destination dialog and then click OK again on the General tab. You will receive a message box when the backup completes successfully.

[edit] Back up Your DotNetNuke files

Whenever you are about to make changes to your site it is always a good idea to back up the physical files located at C:\DotNetNuke. Make a copy of this folder and store it in a safe place. This will allow you to revert back to your old site if something goes wrong.

[edit] Logging In as Admin and Changing Passwords

There are two user accounts that allow you to maintain your portal. They are the admin account and host account. This makes changing the default passwords for the admin and host accounts one of the most important steps to take once you have your site up and running. The first page you see when you start up DotNetNuke gives you all the information you need to sign on.

First, we will log in as admin. For this, click on the Login icon in the upper right portion of the site. This will give you the Account Login screen. Enter admin for the username and dnnadmin as the password. When you do this, you will notice a few changes to the site.

There is now an admin tool pane, and most text has a pencil icon next to it. You will now be able to edit the site. Now we want to change the default password. In the upper right corner, just below where you clicked the login icon, you will see a link for Administrator Account. Click on this to bring up the account screen for the admin account.

To change the password, click on the Manage Password link.

Fill out the Current Password, the New Password, the Confirm New Password, and all the other sections that are required (marked with an *). When finished filling out the information, click on the Change Password link to save your changes.

Note. You may remove some of the required registration items by unchecking the boxes next to them. Note this means that these items will no longer be required for any user of your portal.

When you are finished, log out of the admin account by clicking on the logout icon in the right-hand corner of the page. You can then change the host password by signing in as host, and following the same steps we followed to change the admin password.

[edit] Summary

In this article, we have installed a local version of DotNetNuke using Microsoft SQL Server 2005 Studio and covered how to set the correct permissions on our machine as well as where to find the procedures needed to upgrade from previous versions of DotNetNuke. We finished by changing the default passwords for the Host and Admin accounts. In the chapters that follow, we will explore all the features that are available to you as an admin or host user of the site. We will cover the modules and standard features that make DotNetNuke one of the fastest-growing web portals on the market today.

[edit] Source

The source of this content is Chapter 2: Installing DotNetNuke of Building Websites with VB.NET and DotNetNuke 4 by Steve Valenzuela, Michael Washington, and Daniel N. Egan (Packt Publishing, 2007).

[edit] Additional References

For instructions on adding styles in DotNetNuke, click here