Larry Brouwer

…just my technology sandbox …for my personal amusement only!

Installing DotNetNuke (free Community Edition) on my www.larrybrouwer.com development web server.  My first thought was to use the Web Platform Installer in IIS, however, I opted out of this method as I wanted to gain a better understanding of what was actually occurring. So I downloaded it directly from the codeplex DotNetNuke download site.

There are several packages to choose from, I opted to go with the recommended download, which is the install version (no source code). Since I’ve already downloaded the source on my development workstation, I don’t need it on the server. The current version today is 5.3.1 released on 3/24/2010.

Installation steps:

  1. Downloaded install version from codeplex DotNetNuke download site.
  2. Unzip files to temp directory.
  3. Copy contents of DotNetNuke_Community_05.03.01_Install into newly created web folder.
  4. Open SSMS (SQLServer Management Studio) and connect to local dev database.
  5. Create new database ‘…DotNetNuke’. Bumped up initial storage to 10MB.
  6. Added new login and new database user for ‘…DotNetNuke’. Give new db user ‘db_owner’ role.
  7. Decided to make this my default web site. Used IIS to stop larrybrouwer website. Added DotNetNuke web site on port 80. Used the default application pool.
  8. Attempted to browse homepage. Getting an access denied error.
  9. Changed the application pool to one already defined. Still getting same error.
  10. Current version of IIS is 7.0.6000.16386. OS is Server 2008 SE SP2 32-Bit.
  11. Found that I need to add ‘NETWORK SERVICE’ user with full control to ‘…DotNetNuke’ folder. see here.
  12. Attempted to browse homepage again. This time, getting the Installation Wizard page.
  13. Choosing ‘Typical’ installation.
  14. Getting errors connecting to SQLServer.
  15. So at this point, I’ve decided that I’d like my DotNetNuke to run as a sub-application underneath my main website. This should give me more flexibility if I want to change things around later.
  16. Deleted current installation in progress and copied new install files into ‘…DotNetNuke’ folder.
  17. Deleted Application in IIS7. Added new ‘…DotNetNuke’ application under my main website.
  18. Attempted to browse new DotNetNuke application. Now getting a ‘500 – Internal server error.’ message.
  19. Googled for help. found post here. In Internet Options, de-selected ‘Show friendly HTTP error messages’. Restart IE! Doesn’t take effect until restarting browser.
  20. Now getting the standard ‘Not Found – HTTP Error 404’ message.
  21. Found an installation utility written by Mike van der Meulen. I decided not to use his utility.

At this point, I gave up a manual installation and once again went back into IIS7 and ran the Web Platform Installer. I selected only the components needed (SqlServer dependencies, and DDN). I got it to complete fine, however, when I tried to browse the application, it gave me the same 404 error.

So, I recreated the environment from the manual install and the saga continues below:

  1. Modified the ‘..DotNetNuke/web.config’. Added location tag around ‘<system.web>’ section.
<location path="" inheritInChildApplications="false">
 

Didn’t work. Upon further googling, I discovered that most of these application can’t run as a sub application and have to be ran from a root website.

… At this point the day has ended. I will take this up another day. I’ll keep you posted… so to speak!

Read the first chapter in Microsoft Visual Studio Tips book from Safari Online.

Visual Studio training kits:

Installing DoNetNuke Community Edition on my development machine. Ran into security problems while loading the software. C:\InetPub\ needs security permissions added for ‘IIS AppPool\DefaultAppPool’. See hereand herefor more information.

Here are some notes taken from the book Visual Studio Tipsby Sara Ford.

0-0: Look Up, Change, or Create shortcuts

  • Tools | Options (select all settings) | Environment-Keyboard | (Press shortcut-keys:)

Press the short-cut key you want to know what it does, and it will be displayed in the box below or enter the command in the (Show commands containing:) and it will show the short-cut.

1-1: Not accidentally copying blank lines

  • Tools | Options | Text Editor | All Languages | General | Uncheck the (Apply Cut or Copy commands to blank lines when there is no selection)

This will prevent the editor from clearing the clipboard when you accidentally hit Ctrl+C on a blank line.

1-2: Cycle through the Clipboard ring to paste various things

  • Ctrl+Shift+V will cycle backwards through the last 20 items in your clipboard

1-3: Inserting a line above or below the current line

  • Ctrl+Enter will open a new line above |Ctrl+Shift+Enter will open a new line below

1-4: Selecting the current word

  • Ctrl+W anywhere in a word will select the entire word.

1-5: Deleting the next word and preceding word

  • Ctrl+Del will delete the current word | Ctrl+Backspace will delete the previous word

1-6: Cutting and Deleting the current line

  • Ctrl+L will delete the current line | Ctrl+Shift+L will delete the current line

1-7: Deleting horizontal white space at the beginning of a line

  • Put cursor anywhere in white space area, then Ctrl+K + Ctrl+\ will delete the white space

1-8: Dragging sections of code (or text) to a new location

  • Use mouse to highlight section, then hold Ctrl while dragging with mouse.

1-9: Right-dragging sections of code (or text) to a new location with mouse

  • Use mouse to highlight section, then Right-Click mouse Hold and Drag code to new location
  • This allows for either Move or Copy functions.

1-10: Transposing characters, words, and lines

  • Ctrl+T for characters | Ctrl+Shift+T for words |Alt+Shift+T for lines

1-11: Upper and Lower case characters

  • Ctrl+Shift+U for Upper Case | Ctrl+U for lower case

1-12: Undo and Redo stacks on the Standard Toolbar

  • Ctrl+Z single Undo | Ctrl+Y single Redo | Look for the clockwise and counter-clockwise arrows on the toolbar to select and undo/redo multiple changes at one time

1-13: Using the mouse wheel to scroll in all directions

  • Press and hold the mouse scroll wheel. An icon appears indicating scrolling in all directions. Now move the mouse to what direction you want to scroll, i.e. up, down, right, left. The further away from the icon, the faster it moves.

1-14: Jumping to the top or bottom of the current view without scrolling

  • Ctrl+Shift+PgUp will select text from cursor to top of window
  • Ctrl+Shift+PgDn will select text from cursor to bottom of window

1-15: Hiding the vertical and horizontal scroll bars

  • Tools | Options | Text Editor | General | Display (check or uncheck)

1-16: Using Go-Back Markers to navigate forward and backwards from where you’ve been

  • Ctrl-Minus will navigate back | Ctrl+Shift+Minus will navigate forward
    In the standard Toolbar, locate the Page with Arrows forward and back. You can use these to go forward and backward multiple steps at a time.

I’ve decided to implement BlogEngine.Net on the Harris County Master Gardener website. This is a website I developed as a way for the Master Gardeners to update their profiles and keep track of their volunteer hours.

I use subversion to track changes to the website. It’s free and it works great! You can read all about it here: http://subversion.tigris.org/ There are basically 3 things you need to install to get it going for your development environment:

  1. Download and install Visual SVNon your server or workstation where you’ll want to store your repositories. Install only the free server portion. That’s all you should need to get you started.
  2. Download and install TortoiseSVNeverywhere you will be using SVN. This is the client software, and works great with file explorer.
  3. If you use Visual Studio, download and install AnkhSVNon your development workstation. This will integrate all the SVN features right into VS.
  4. For documentation, here’s a great reference guide: http://svnbook.red-bean.com/

On to the installation. Here’s my installation steps:

  1. Do an SVN update of …Website solution to get current version of solution. Use SVN clean. Keep it clean!
  2. Download latest source version of the blog software from BlogEngine.Netto my desktop. Right click zip file, select properties, and click ‘Unblock’. Otherwise VS might not trust my new project location.
  3. Right click the zip file, and choose ‘Extract files…’. Extract to my project folder ‘C:\…\Visual Studio 2008\Projects\…Blog’
  4. In Visual Studio 2008 Solution Explorer, click on the  ‘BlogEngine.Net’ project, then click ‘Build’ / ‘Add Web Deployment Project…’. Rename the deployment project, ‘…Blog_deploy’. This will add a new project to the solution. It will make deploying a simpler process later.
  5. Open SSMS (Sql Server Mgmt Studio). Connect to Development instance. Add new ‘…Blog’ database.
  6. Create new user login for ‘…Blog’ database. See Installed BlogEngine.Net post.
  7. Run ‘MSSQLSetup1.6.0.0.sql’ setup script inside BlogEngine.Net/setup/SQLServer directory. Altered script at beginning as ‘use …Blog’.
  8. Renamed ‘Web.Config’ in BlogEngine.Net folder to ‘Web.Config.Orig’. Copied ‘SQLServerWeb.Config’ from setup folder as new ‘Web.Config’.
  9. Copied ‘web.config.dev…’, ‘web.config.prod…’ from ‘…Website’ project folder to ‘BlogEngine.Net’ project folder. Alter to change connection strings to work with dev, prod db’s. Also add the files to project with VS file add existing items.
  10. Changed ‘Web.config’ to use a file for specific connectionStrings. This allows me to point to different environments. I’ve learned a lot since I used this method, next time, I’ll try something different.
  11. In Visual Studio, open up the ‘default.aspx’ file and attempt to view in browser. It works! Yea!
  12. Now complete the initial configurations, i.e. set up users, etc. Remember, only working with dev database for now.
  13. Remote log into the Web Server, open Visual SVN. Add a new repository. I need to do this because when I originally created the SVN repository for the website, I didn’t fully understand a proper directory structure. Will be better next time. Also, if I change now, then I have to change it everywhere it is currently cached. So create a new repository called ‘…Blog’. Select Action / Copy URL location.
  14. Using File Explorer go to ‘C:\…\Visual Studio 2008\Projects\…Blog’ directory. Then right click on ‘…Blog’ folder and select TortioseSVN / import. This adds all the project files into SVN.
  15. Paste the URL into the import statement for SVN to import the newly created ‘…Blog’ project. Click Ok. Accept the poor certificate warning message. Enter user credentials, check Save authentication, and click Ok. The files are copied to the repository. Long wait!
  16. Rename the project folder ‘…Blog’ to ‘…Blog.Orig. Then right click on the Projects folder and select ‘SVN Checkout’. Paste in the URL location. Click Ok. Again, wait until all files are added.
  17. Open the ‘…Blog’ in Visual Studio. Choose ‘Release’ ‘Any CPU’. Then right click ‘…Blog_deploy’ project and select Build.
  18. Open File Explorer and navigate to the ‘…Blog_deploy’ folder. Right click and choose ‘SVN Commit…’. Click ‘Select / deselect all’ at the bottom. Press Ok. Now we have a ‘Release’ deployment folder available to us with SVN on the Web Server.
  19. Remote log into the Web Server. Open File Explorer. Navigate to the ‘C:\…\dev\’ folder. The folder where the development Web Application is located.
  20. Open VisualSVN Server. Navigate to the ‘…Blog_deploy\Release’ project folder. Select Action, ‘Copy  URL to Clipboard’.
  21. Using file explorer, right click on the ‘dev’ folder, and select ‘SVN Checkout’. Paste the URL into the URL of repository field. Rename the output folder to ‘…Blog’. Click Ok. The new project folder is created for dev.
  22. Open IIS7 Manager. Navigate to the ‘…Dev’ site. Right click and choose ‘Add Application’. Alias name it ‘Blog’. Browse to the physical path. Choose ‘MSSharePointAppPool’. Click Ok. Restart the ‘…Dev’ Site.

At this point, I ran into some trouble. When attempting to bring up the blog sub-application, I kept getting a yellow screen error: Configuration Error. Upon some time consuming googling, I ran across this post by Colin Cochraneand it quickly solved my problems.

To resolve this issue, in the web.config file of the parent application, I surrounded the system.web section with:

<location path="." inheritInChildApplications="false"> 
 
<system.web>
  …
 
</system.web>
</location> 

and it fixed it nicely!

What’s next? Need to customize the css to make it fit in with the Master Gardener’s website. Then move it all to prod.

Over the past several months, I’ve been wanting to start a journal to keep track of all the encounters of my daily programmer life. Until now, I’ve mainly used Microsoft Outlook’s Journal feature. This works fine, but it doesn’t publish it for all the world to see. What if I actually do discover something useful for others to get some good out of it? I could have taken the easy route and just used an existing blog site or facebook I suppose. But, since I’m in learning mode, why not set up my own website, with my own personal blog? What a cool idea, right? So I set off googling and stumbled upon BlogEngine.Net. This link gives you some more choices of what’s currently out there: http://csharp-source.net/open-source/bloggers It’s a customizable open source ASP.Net blog application written C#. Link to BlogEngine.Net .

For the sake of this blog entry, I’ve already got my environment ready to go.

Steps to installation:

  1. Downloaded the source code from: http://blogengine.codeplex.com/releases/view/39387 (at the time of this posting version 1.6 is current). I downloaded the source because I want to be able to see what’s going on inside.
  2. Extracted the source to my local Visual Studio projects directory. I’m currently using Visual Studio 2008.
  3. Opened the solution in VS2008. I immediately added a "Web Deployment Project" by first selecting the BlogEngine.Net project, then selecting "Build" "Add Web Deployment Project…" from the menu. The Web Deployment feature is not native to VS2008, you need to download and install it if you don’t already have it. Search on "Visual Studio 2008 Web Deployment Projects – RTW"
  4. Rebuild the application. Make sure you choose "Release" from the main menu and not debug (if you’re ready to deploy it). Then select the new deployment project "BlogEngine.NET_deploy", right click and choose build.
  5. Using explorer, go into the project directory, then into the BlogEngine.NET_deploy directory, then into the release directory. Visual Studio has created a nice deployment package for you. So now you can copy all the files from here into your web root directory.
  6. Add the new application into IIS7.
  7. Update the file permissions to the "App_Data" folder to allow for IIS7 to have write permissions.
  8. Finished setup!

Issues:

In step 2, I originally saved the solution as a zip file on my desktop. Then I extracted it with explorer to my project folder. After I extracted the solution, and opened it with Visual Studio, and VS gave me a warning message: "The project location is not trusted". Why would this be? I’ve had this error before, but it was on a file share path to a server. But this project is located on my hard drive. After some googling, I discovered a trick from leedumond.com. I needed to alter the permissions on the zip file first. So right click on the file, then select properties, then in the general tab, click the "Unblock" tab prior to extracting the file.

I had some troubles initially getting IIS7 to display the blog at first. I was getting an error screen. First, to figure out what the problem was, I went into the Web.Config file in the main folder, and changed the customErrors mode="RemoteOnly" to "Off". This allows me to see any errors from any browser, and not just on the server. The problem turned out to be file permissions on the App_Data folder. I used the procedure outlined in the installation instructions, and solved the problem straight away.

Additional thoughts:

If you’re wanting to publish the BlogEngine.Net application to a remote server, you can do it directly in VS 2008 with the Build / Publish Web Site option. You can use FTP or you’ll need the front page extensions loaded on the remote web server. See this great article: Using Visual Studio 2008 with IIS 7. Download the FrontPage 2002 Server Extensions for IIS 7.0here.

So, now, my new blogging application works great! But I wanted to take it that last step further. I wanted to hook it up to my SqlServer database. After reading the instructions, it all looked pretty straight forward. Here are the steps involved:

  1. Open up SSMS (Sql Server Management Studio).
  2. Create a new database. Let’s use blogDb.
  3. Create a new user and grant access to the new database. Let’s use blogUsr. I wanted to create a Sql Server user and not have my application log in as a Windows user. Here is the script:
    use blogDb; 
    go 

    create login blogUsr with password = ‘blogUsr’, check_policy = off 
    go 

    create user blogUsr for login blogDb; 
    go 

    grant alter to blogUsr; 
    go 

    sp_addrolemember ‘db_datareader’, ‘blogUsr’ 
    go 

    sp_addrolemember ‘db_datawriter’, ‘blogUsr’ 
    go

     
  4. Renamed Web.Config to Web.Config.Orig in the BlogEngine.Net project folder, and copied SQLServerWeb.Config in the setup\SqlServer\ directory to Web.Config in the BlogEngine.Net folder.
  5. Edited the connection string in the new Web.Config file to point to the SqlServer database. Here is the connection string used:
    <add name="BlogEngine" connectionString="Data Source=WebServer\MSSQLWEB;User ID=blogUsr;Password=blogUsrs;persist security info=False;initial catalog=blogDb;" providerName="System.Data.SqlClient"/>

  6. Bring up BlogEngine.Net in a browser and reconfigure it. Done!

Final note: I installed a utility called ieSpell which allows me to spell check my posts directly in the browser editor window.

Continuing my quest for knowledge and efficiency, I’ve come across Windows Live Writer. This little program runs quite well with BlogEngine.Net. I also downloaded and installed, Carlos Aguilar Mares’s Colorized Codeplug-in, which I used nicely in the above code section.