Friday, January 21, 2011

how to Installing DotNetNuke (DNN)



Welcome to my first contribution to the Seablick Consulting blog! When Tom Kraak first asked me to write a “how-to style” blog post, I was thinking to myself, “what can I offer in regards to DotNetNuke? I’m a newbie!” Then I began to realize how much I have learned in a very short amount of time. I also realized that I am looking at DNN from a different point of view than someone with years of experience. So I may (and will) ask a lot of questions and I DO like feedback. One thing that I was very impressed with right from the beginning was the community’s assistance and reassurance of my success. So for my first post, I decided to detail my experience of learning how to do a local DNN install.
Installation is murky when you are new. As a developer, I like to know what is going on, where it’s going on and who it’s going on with. At first, I didn’t understand how the database “fit” into the architecture of a DNN site. Once I had a clean install up and running, I was able to go into SQL Server Management Studio (or the like) and actually look at the tables, select on them and see what the install had created. That’s when I began to get a bigger picture of how DNN works.
My local setup consists of a Windows XP Pro machine running IIS 5.1, SQL Server 2005, and the .NET 2.0 Framework.
There are 5 basic steps to a clean install. I will cover each individually in more detail below.
  1. Download the .zip file from dotnetnuke.com.
  2. Create the database and a SQL Server login
  3. Create the website folder and unzip the downloaded .zip file.
  4. Create virtual directory in IIS and configure the website
  5. Run the DNN install wizard in your favorite web browser.
1. Download the .zip file from dotnetnuke.com.
After you have logged into dotnetnuke.com, navigate to “Downloads”, select the desired file and save to your C: drive (for our example, I selected and downloaded the 4.5.3 INSTALL (DotNetNuke_04_05_03_Install.zip.)
2. Create the Database, SQL Server Login, and Database User
There are two things you need to do in SQL Server Management Studio. First, create a database. Second, create the SQL Server login for that very same database. Make sure that your database server runs in “mixed authentication mode” (SQL Server and Windows Authentication mode” is checked.) You can find this setting by right-clicking on your server (first node in the SQL Server Management Studio tree on the left), then Properties | Security.
Create the Database
  • Open SQL Server Management Studio
  • Select your desired server from the drop-down list and connect
  • Expand the tree on the left-hand side so you can see “Databases”
  • Right-click on "Databases"
  • Select “New Database”
  • In the "Database Name" field enter a name for your database and click OK. For this example, I entered “DNN453”
  • You now have an empty database called DNN453
Creating a login for your database:
  • Expand the Security node of your server
  • Right-click on Logins
  • Select “New Login”
  • Enter your desired login name. You must remember this login name and password as we will use it later. For my purposes here, I’ve entered “DNN453Login” (without the quotes) as my login name.
  • Select “SQL Server Authentication” and enter a password. I entered “test” as my password.
  • Uncheck “Enforce Password expiration/User must change password at next login”
  • Click “User Mapping” on the left
  • Select/Check the new database you created in the top grid “Users mapped to this login:”
  • Select/Check db_owner in the bottom list “Database role membership for: “
  • Click OK
  • Now look in the Security node under your database (DNN453) and you will see a newly created database user listed, meaning we also created a new database user by mapping our SQL Server login to our database.
The database portion is now complete.
Create the site folder and unzip the downloaded .zip file.
In this step, we create a folder and unzip the DNN install .zip file to this directory. You can put it directly under C:\inetpub\wwwroot or C:\foldername. For this example, I used C:\DNN453.
  • In Windows Explorer, create a new folder called DNN453 on your C: drive. This will be the folder where your website files will live.
  • Extract (unzip) the DotNetNuke_04_05_03_Install.zip file that you downloaded earlier into your desired folder (C:\DNN453 in our example)
  • After extraction is complete, the folder contains a web.config file that needs to be modified. Remember how I stated in the beginning that DotNetNuke and the database “fit” together? We must now tell DotNetNuke which database our website is using. We do this in the web.config file. The default web.config file even gives us “samples” of connection string entries so that we only need to modify these based on our database setup.
  • Open the web.config file and find the <connectionStrings> tag. You can use Notepad, Visual Studio or any other text editor to accomplish this. There you see two entries of connection string statements – one for SQL Server Express and one for SQL Server 2005. By default, DNN uses SQL Server Express. The connection string for SQL Server 2005 is commented out. For our example (we are using SQL Server 2005), we must reverse this and comment out the SQL Server Express statement and “uncomment” the SQL Server 2005 statement. After that, we need to enter the correct values for server, database, uid and pwd according to the database we set up above. In the below screenshot, XP1234 is my machine/my local SQL Server (please note, if you are using server instances, it is entered as: XP1234\MYINSTANCE where MYINSTANCE is the name of the SQL Server instance). DNN453 is the database name (as specified in step 2.) Enter "DNN453Login" and “test” for uid and pwd, respectively.
  • We must also modify the key for the “SiteSqlServer” under the <appSettings> tag. Again, SQL Server Express is the default, with SQL Server 2005 commented out. We must comment out SQL Server Express and uncomment SQL Server 2005 and again, enter the correct values for server, database, uid and pwd for our database.
  • Save and close the web.config file
  • Lastly, you must change the access permissions of your folder. The Windows account that is used to access your site must have full control over your DNN root folder. To set this, right-click on the root folder of your site (C:\DNN453). Click Sharing and Security. Click the Security tab. If you do not see the Security tab, you must “turn off” simple file sharing for the folder. To do this, select the root folder (C:\DNN453) in Windows Explorer. Click Tools | Folder Options. Select the View tab. Uncheck “Use simple file sharing.” Click OK. You can now right-click the folder and access the Security tab.
  • On the Security tab, you will see a list of users who have access to your folder. Windows XP uses the ASPNET account and Windows 2003 uses the NETWORK SERVICE account. Add the account and give it full control permissions.
4. IIS – create virtual directory and set-up
Now that the database and file system are in place, we can create the virtual directory in IIS.
  • Open IIS and expand the tree to see “Default Web Site”. (You can find IIS in Start | Control Panel | Administrative Tools.)
  • Expand the "Default Web Site" node.
  • If you have placed your DNN root folder under C:\inetpub\wwwroot, you will already see your website and can bypass this step. If not, you will need to add a virtual directory.
  • Right-click on "Default Web Site"
  • Click New | Virtual Directory
  • Enter an alias – "DNN453" will do
  • Click Next and enter/browse to the path to the root folder of your website.
  • Click Next and leave access permissions as is (should be set to Read/Run Scripts.)
  • Click Next and Finish
Now that a virtual directory is in place, you’ll need to modify its properties.
  • Click on the "Documents" tab
  • An entry for “default.aspx” needs to be added. Add default.aspx and move it to the top of the default documents list.
  • Click on the "Directory Security" tab
  • In the “Anonymous access and authentication control” group box, click "Edit"
  • Make sure that “Anonymous Access” is checked as well as “Integrated Windows authentication”
  • Next, click on the "ASP.NET" tab and make sure that “2.0.50727” is select for the ASP.NET version
  • Click OK to save your changes
5. Run the DNN install wizard in your favorite web browser to complete the installation process.
The very last step is to initiate the DNN install via a web browser. The install wizard takes over. In doing so, it creates tables and stored procedures in your database and adds the needed data rows to these tables to house your site. You will be prompted to test your folder’s permissions, test the database connection and lastly, enter your desired user name and password for your host and admin user. Write these down!
  • Open your web browser of choice and navigate to http://localhost/DNN453 (replace DNN453 with the name of your IIS virtual directory)
  • You will be guided through an install wizard. Test your folder permissions when requested.
  • Verify your database connection when asked.
  • You will see the wizard running the script for each version.
  • On successful completion, click on “Access your Portal” and your new DNN-based website appears.
I hope that this tutorial offers DNN newcomers a better understanding of the DotNetNuke installation process on Windows XP Pro and SQL Server 2005.

No comments:

Post a Comment