Author: xram net Created: 3/5/2010 7:11 PM RssIcon
Focused on DotNetNuke, .Net, Windows, and computer repair with smatterings from the rest of the technology ecosystem.
By xram net on 8/19/2009 11:48 AM

dnnapppool

Are you running DotNetNuke on your own IIS install?  If you are and have been trying to eek the most performance out of it as you can, you may very well run into the problem I’ve come across.

I can’t begin to describe what kind of a headache it has been.  For the longest time (so long my original DNN forum posts regarding the issue are gone), making any changes to a page on any of our DNN 4.9.x sites would show up half of the time you refresh, and half of the time it would show the original content.  Restarting the web app synced the two random out-of-sync views up, but that’s obviously not a long term solution.

I finally ran across this article on DNN’s support pages talking about scheduler issues in multi-threaded IIS configurations and it hit me: running DNN in a web garden with two or more worker processes AND having the module caching set to memory meant that whichever worker process was told to make or delete a page or change content had the correct data in its cache.  The other worker processes, though, were left in the dark and weren’t being told to flush their cache!  Refreshing the browser would cause IIS to randomly assign a worker process to serve up the page, so half of the time it got it right, and half of the time, it got it wrong.  Restarting the web app flushed the caches, which is why that worked.

The solution?  Either turn module caching to disk or turn off the web gardening by setting the maximum number of worker processes back to 1.  The users are much happier now that the ghost in the machine has been exorcized.  Any other performance issues have you uncovered?  I’ll be moving to DNN 5.1 soon, so any suggestions would be greatly appreciated.

By xram net on 8/11/2009 10:05 PM

batteries

How many people just leave their laptops plugged in all of the time and then expect it to work three years later that they decide to start taking it to the beach?  For gratis, this is a must for laptop owners.  I recommend that people let their batteries drain down fairly low once every five or six months to recalibrate the battery’s internal meters, and this software will keep a history of when you’ve done, as well as giving you detailed information on your batteries’ life span and capacity.  I’m sure graphing the capacity over time isn’t far behind, predicting the number of years until it’s finally time to swap in a new battery.

You can find it on lifehacker or directly on BatteryCare’s website.  They also have a page of info about batteries and how to make them last longer.  And don’t forget to buy the author a beer if you find it useful.

By xram net on 7/28/2009 12:38 PM

DotNetNuke using only Active Directory authentication

I’ve developed a few DotNetNuke 4.9.x sites that use the Active Directory authentication provider, and on the whole, it works quite well.  DotNetNuke caches the given username and password, using that to query the domain when a user attempts to log in.  On the sites in question, having both the standard DNN and Windows login was confusing to the users, so I disabled the DNN login by going to Admin –> Authentication and unchecking Enabled? under DNN Auth Settings.  This cuts out the ability to log in as host, so every time host functionality is needed, the site must be logged into using an AD user with admin privileges, DNN login must be re-enabled, and then you can log back in as host.

However, upon updating my domain password, I noticed that all of the AD-enabled sites broke.  Without being able to log in using the DNN login, and with no AD logins working, what was I to do?

Hidden In The Database

The answers are not clear from any of the DNN forums, but it turns out when you enable Active Directory integration for a portal, a module is created to store the configuration.  The DNN standard login has no settings of its own.  To re-enable DNN login from the database, look through the ModuleSettings table for a ModuleID that has entries prefixed with AD_.  There are two other settings for the same module, prefixed with DNN_.  The setting we’re looking for is DNN_Enabled, which, if you had DNN login disabled, should be false.  Simply changing that back to true should give you back your DNN login ability and get you back onto your site.

Avoiding This Issue In The Future

The best way to avoid this is to create an additional user in your AD with no rights—all it has to do is authenticate as a valid user.  I went with dotnetnuke-ad, but you could chose anything.  Give is a sufficiently difficult password, and set the password to never expire.  This way, you never have to worry about your password changes taking down your DNN site.

By xram net on 7/22/2009 10:32 PM

While working on a client’s site, I used an http handler to call a very well thought-out image resizing class I found via CodeProject.  I removed the ability to use named keys (lines 42, 51-62, & 276-336), opting instead for controlling width and/or height explicitly.  Since it’s a .NET 2.0 app, the Linq code in GetImageDimensions would have had to go anyway.  I didn’t realize how much I’ve come to love LINQ until I went back to write some new SQL code for this project…  Also, I removed the dimension check to prevent the image from being upscaled—I needed it to work both ways (lines 239-246).

With the code in place, the image resizing worked great.  The images resized properly, but after attempting to use a management app located in a subdirectory, I realized that the custom http handlers were being inherited by all of the children, causing all sorts of trouble.  Since one of the apps is a virtual directory controlled by the webhost, editing the individual web.config files wasn’t possible.  I guess the ASP.NET team had run across this before, because they created the location tag and its inheritInChildApplications attribute.

My first attempt to wrap only the httphandlers section didn’t work, but wrapping the entire system.web section did the trick.  Now, all of the sub apps are working well where they’re at, and the images are resizing perfectly.

By xram net on 7/6/2009 9:01 PM

Quest For Tech - in the search for technology, you are never alone

We’ve heard that the internet is the great equalizer, giving everyone access to the sum of humanity’s information.  Internet access supposedly fosters better decision-making regarding our health, wealth, leisure, and every other aspect of our lives.  To anyone who grew up around computers with internet access, this seems obvious.  To people who didn’t, though, the apprehension surrounding sitting down at a keyboard can be terrifying:

  • “What if somebody steals my social security number?”
  • “What if I delete all of my files?”
  • “What if I get so frustrated that I throw it out the window?!”

At a recent non-profit networking event, a colleague of mine and I met a Philly local non-profit whose mission statement, Eliminating the barriers of computer illiteracy, was too good to pass up.  The group, Quest For Tech, is always looking for more teachers who can give a night every week or two to meet with students one-on-one for two hours.

For students, it’s a great deal.  $75 gets you five 2-hour lessons, picking up at your level of experience.  Don’t know how to turn your computer on?  That’s okay.  Want to learn how to send photos to your children or grandchildren?  Not a problem.  The teachers (myself included!) are competent and can handle most, if not all, questions that students can throw at them.

Want to become a student?  Check out Quest For Tech’s website and their Technology Access Program (the class I’m referring to above).  Want to teach?  Head to their site and look at the volunteer information.

By xram net on 5/7/2009 6:19 PM

css

I hate to say this about the framework I love, but it’s true.  Anyone who’s ever spent more than a few minutes developing skins or modules knows it, but so far it hasn’t inspired anyone to step up to the plate and take on refactoring/refining the CSS into a more workable state.  Maybe it’s not as big a deal as I think, but I’m tired of looking through the CSS that gets sent downstream and comparing it to other frameworks that do a tremendously better job of producing clean code.  I’m not a huge fan of reading other people’s rants if they’re not willing to offer suggestions, so here goes.  Please feel free to agree or disagree with any of these points—that’s what comments are for.

Create a consistent CSS naming scheme

Enforce (or at least strongly recommend) that developers use a distinct namespace when creating the CSS for their modules.  Take, for instance, the DotNetNuke Blog module.  IMO, all of the CSS entries should be proceeded by a distinct selector (i.e. .dnnblog) that all of the blog sub-modules are wrapped in.  If I want every blog module on my site to have a certain background image, or use a certain typeface, I should be able to do it in a straight-forward manner.

Zero out default.css

And then add back in any of the available CSS reset files out there.  Yahoo’s, Eric Meyers’s, any of them will do.  After that, define basic styles: headers, paragraphs, etc., using the minimum amount of CSS.  Don’t define font-family anywhere.

If DNN wants the default skin to look polished and awesome, great!  Keep it all in the skin.css—that’s what it’s there for.  But don’t make me hunt down and override items, especially when I'm banging my head against the wall because a div > div > ul > li is displaying in a different font than div > ul > li (remove the font-family definitions from default.css and the problem disappears).

Create an admin.css

All of the administration classes, both in the control panel up top and in the admin pages, should be rolled into an admin.css file that is only included if you’re logged in as an admin.  There is no reason that CSS for the control panel is sent down with every page view.  Also, create a dnnadmin class that it’s all wrapped in.

Get it done for DNN v6

The DotNetNuke skinning team lead, Timo Breumelhof, mentioned that this work was deliberately avoided so as not to introduce any breaking changes for existing installations.  Considering DNN5 broke existing skins and modules, wouldn’t that have been the perfect time to also break the CSS?  I mean, if a developer already has to go back in and update class names, replace depreciated functions, etc., wouldn’t that be the perfect time to do this?  No one ever said a cross-version upgrade would go smoothly (heck, even a lot of minor upgrades don’t go smoothly…), but at some point, we’ve got to bite the bullet and move on.

Allow custom classes to be defined in the module settings

For instance, in a certain text module, let me go into the settings and assign a class to that module that would be injected into the container wrapper.  This is less important with the text module since I could just go in and wrap my text in a classed div, but say I want two surveys on the same page that look entirely different.  True, that can be done now using separate containers, but it seems like it would be a nice advanced option to have.

I’ll be sure to post my portal.css when it’s complete—I’d like to see how much of it I can break apart without breaking DNN.

By xram net on 4/14/2009 6:34 PM

How many people back up their files?  Honestly.  Raise your hand if you do.  Chances are if your hard drive fails, you are one of the vast majority of computer users who would be up a certain creek without a paddle.  Backing up isn't hard to set up, especially now that software like Allway Sync exists.  Follow these instructions and relax in the knowledge that your data is safe.

  1. Visit Allway Sync's download page to download the latest version.  Run the installer once the download is finished.
  2. The default settings are good for this installation—read over it if you like, but most users can click right through.
  3. Allway Sync will run once the installer is complete and will automatically begin the walk-through for creating a new backup job.
    1. Hit Control+R to give your backup a descriptive name (e.g. Nightly Documents Backup)
  4. Choose A Source Folder :: Click Browse on the left-hand side and choose the folder you'd like to backup.  Most users would consider backing up their My Documents folder, but also consider other locations of important files such as accounting software or email.
  5. Choose A Destination Folder :: Where do you want to store your files?  The dropdown list of locations gives you quite a few options.  Not only can you backup to a removable drive or network location, but multiple online storage vendors are also provided so you can backup to an offsite location with ease (OffsiteBox.com gives 50mb for free and Amazon S3 runs $0.15/GB used/mo + $0.10/GB transferred—less than $1.50 a month to maintain 5gb of data for most users).
    1. If you're backing up to an external hard drive, choose Removeable Drive from the list.  Choose the drive from the dropdown list, and make sure that Bind to drive characteristics is checked so that it will continue to backup even if the drive letter changes.  Then, in the path textbox, enter a directory for the backups to go into (e.g. f:\backups\)
    2. If you're backing up to a network location, such as a file server located on your network, choose Network folder.  Click Configure, and enter in the connection details.  For example, if your file server is called super-file-storage, the UNC path to your directory on there may look like \\super-file-storage\files\myusername\backups\ depending on how it’s configured.  If you need to provide a username and password, you can also do that here.
  6. Allway Sync’s default action is to synchronize two folders, which you can see by the middle arrow indicator.  Since you're configuring it for backups, click on the arrow pointing from your source folder to your backup folder (the highlighted choice in the image).  This means that files will only be copied from your source directory to your backup directory, not the other way around.  If you want to guard against accidentally deleting a file, uncheck Propagate deletions.  This will leave all files in your backup, regardless of whether you delete them in your source folder.
  7. Now, you're all set to backup!  Click Analyze to begin the process.  This will tell you that there are substantial differences in the two folders, and that this is normal.  Click Ignore.
  8. Once this is done, click Synchronize.  This will perform the backup while showing you the progress.  Congratulations—you've just backed up your files!  What good is just one backup, however?  We need to set this to run automatically so your backups aren’t dependent on you.
  9. From the menu, click Job –> Properties.  Under your backup job, click on Automatic Synchronization.  The easiest way to set up synchronization is to perform the backup at a specified interval (Through the specified period with a Periodicity of 6 hours).  You could also have it run when the computer is idle for a certain amount of time or when file changes are detected.  Setting the delay for either to 1 hour will make sure Allway Sync doesn't run too often, but it's really up to you.  Make sure you don't leave too many options checked, or you may find that the program runs too often.  Hit OK when you’re done.
    1. For advanced control over when your backups should run, scroll down the list to Use Windows Task Scheduler, then click Configure.  Click New, and set your parameters.  You may, for instance, want to choose Daily at 12:30 PM if you know your work computer will be on and you'll be at lunch.
    2. There are a number of other settings that can be configured, such as what files to include or exclude or retaining multiple versions of important files (in case you made edits you later need to undo).

Backups are useless unless you’re sure that you can get the files back.  Every once in a while, take a look inside your backup folder to make sure that the files you want backing up are there and that they’re being kept up-to-date.

Hope this helps!  Please feel free to ask questions below in the comments.  Remember: a few minutes setting this up will save you days of frustration and/or hundreds of dollars when your hard drive does eventually fail.

By xram net on 4/7/2009 1:13 PM

Space!  The final frontier, in terms of what users need more of.  One of my clients was running a custom-built (read cheap) file server that had a few issues.  The chassis and motherboard are from Norco, a company that creates products for people with plenty of time to kill.  If you need something dirt cheap (and don’t mind getting your hands cut up on the rough edges), this will do quite nicely.  However, the server would randomly reset its BIOS settings across boots, meaning that patching Windows became a fingers-crossed affair to see if the server would come back up gracefully.  Also, the expandability was nil as was the warranty.

With these issues in mind, I recommended a Dell PowerEdge 2900.  I configured it with 2 500gb 7.2k SATA drives in RAID 1 for the system partition, and 6 1TB 7.2k SATA drives in RAID 5 for the file storage.  This setup yields 4.54TB of usable space on the storage virtual drive.  Future expandability would be handled using a PowerVault that would hook into the PERC 6 controller.

I installed this into their rack myself, which wasn’t easy as this thing weighs in at over 100lbs.  Getting it onto the versa-rails was a delicate process, but once it’s in place, the whole thing is solid.  HD Tune gives good numbers, with 250Mbps sustained.  This needs to support roughly 200 users, with quotas managed through Windows 2008 File Server Resource Management.  So far, three virtual machines have also been moved on to the server, as the 2ghz quad-core Xeon and 12gb of RAM have more than enough processing power to handle a few low-load VMs such as an XP developers sandbox, a domain controller, and a test web server.

What are you buying for file storage?  Managed SAN devices?  Traditional file servers like this?  Going straight to the cloud?

By xram net on 3/25/2009 1:01 PM

Facebook Connect

UkNuke has an authentication module for DNN that allows a developer to use the Facebook Connect to allow users to log in to his/her site.  Very cool, except the page they created that is shown to users after returning to your site from the Facebook login page is crowded and a little confusing.  How ‘bout some jQuery hiding that’ll give the user two options: I’m new here (shown by default) or I’ve already have a username here (hidden).

UkNuke’s installation walk-through seems fairly straight forward, and does a good job at warning developers as to potential pitfalls (don’t log out of your host account!)

Has anybody tried this out on a production site?  Now that everyone and their mother (except mine) is on Facebook, this seems like the easiest way to attract visitors without the turnoff of having to go through yet another registration procedure (or yarp, as I like to call them).

By xram net on 2/16/2009 4:46 PM

wrt54g

One of my clients was experiencing some odd wireless dropouts on the computer set up the farthest from the router.  They mentioned that it started around when they gave their wireless key to a neighbor so he could get online.  It seems like a neighborly thing to do, until you consider that this new computer that they have no control over is on the same network as all of their machines, as well as their file server.  I told them I was uncomfortable with that setup, but if they wanted to share their access, I would find a way to make it work.

They have a WRT54G v8 that I had them purchase from NewEgg, on which I decided to swap out the stock firmware with the open-source DD-WRT firmware.  There’s a great walk-through on SimpleHelp.net that covers the additional VxWorks Killer step necessary for the v7 & 8 models.  The DD-WRT firmware gives you near-complete control, especially over things like wireless transmit power (the stock setting is between 20-40mw) which I leave set to DD-WRT’s default setting of 70mw.  After setting up the wireless network and the security, I went back downstairs to find that the signal was now solidly stable.

But what about their neighbors’ access?  Using the extremely well-written guide available from Pennock’s World about setting up multiple BSSIDs using DD-WRT, I was able to get multiple wireless networks running off of one router.  The rules in the firewall section stop any traffic going between the two networks, while still allowing the second network access to the internet.  They can even be set with their own security schemes, so the neighbors can use any old WEP-enabled device while all of the important computers connect via WPA2.