With all the troubles I’ve had with hosting plans throughout the years, I’ve always wondered how to avoid those same problems for a second time.  Of course, I’d love to avoid them for the first time, so I Google them first.  No, not the problem, but how to avoid problems doing something “odd” with my service.  Let’s say I want to do something really strange like cancel a server or hosting service.  I know, it’s way out there, but please bare with me…I ask the Service Provider what I need to do, after starting with the on-line FAQs, help, forums, etc.  and they say go to this “special” site for canceling service.  OK, it must be “intuitive” or they would have given me more details, right!?  The stand-up comic in me wants to draw this out to its proper conclusion…lots of laughs; but the software developer, architect, infrastructure novice and business owner in me wants to lend a hand.

What Problem was actually resolved?

There are way too many scenarios to list in one sitting, but I can probably link to them from here later, or answer specific questions in comments if I see them.  But my most recent issue was due to the fact that I wanted to upgrade a 1and1.com VPS account to one that was half the price I was paying (for 3 months…and I highly recommend this.)  That wasn’t the deal maker though. It was for the same ‘everything’ except a faster server, with 8 cores, and 4 times the memory.  The problem: It was the SAME service level, VPS III, so they could not do an “upgrade” for me" as they had done before from VPS II to III.  They couldn’t just expand the memory, or copy the virtual server to a new disk.  This seems like simple work, but only from a guy who works with Virtual PC, Virtual Server, VM ware Workstation, and Hyper-V all day.  So when asked what I need to do, this was what they told me.  I need to order a NEW server, then move everything to that server…then cancel the old server.  It was said as if I was moving a TV into the other room and then locking the door behind me.

Here are the issues:

  • e-mail accounts
  • external domains
  • DNS changes take time to propagate
  • paying for 2 servers
  • primary domain (free with your server)
  • GoDaddy is my domain registrar

Here are the pluses:

  • 1and1 has easy to use tools.
  • I can do the work myself ;)

DNS, domains and e-mail

In order cancel a domain, or more precisely an “external domain”, you need to go to “cancel.1and1.com”.  Seems obvious, right!? :)  Then you select the domain, and select when to cancel it.  I shouldn’t need screen shots, but let me know.  An external domain is one that is registered elsewhere and hosted by your 1and1 server or hosting service.  You use 1and1’s name servers and they allow you to point the domain at your server or service.  DNS is not fun work, and there are several tricks I get to use to REALLY simplify the process, so I have to use this service.  However, when you cancel, you still have to wait to reuse it.  If I was moving my domain hosting to a different service, I could configure that hosting service to handle the domain, then point at the name servers.  When DNS propagated, it would already be in place.  However, this isn’t the case when moving between contracts at 1and1.  So, cancel, wait impatiently, re-configure on the new server or hosting account.  If e-mail is truly important, you should move your e-mail to another service entirely, or at least while the move takes place.  I didn’t do this, but will look at it for the next time.

While waiting for domains to become “canceled” I configured the new server for the applications it will host.  When ready, I re-add the “external domains” to the new account and the web applications are ready.  If all went well, the name servers never changed, only the ip address so finding the new server is instantaneous.

Since some of the work takes up to a week of waiting, I wanted to do it in manageable chunks.  But now that I know what lies at the end of the path I can say the correct way to handle my situation, not withstanding the e-mail process I didn’t follow, was to move my applications and then cancel all the “external domains” at once, then cancel the “package” or contract.  This would have allowed me to transfer the free domain I needed back to my other registrar (GoDaddy.com).  I also will not, and have not chosen a useful “free” domain that I will rely on in the future so I don’t have to worry about losing it or depending on it.  A month or so later, I’m still not finished…or should I say, I’m still waiting!?  How much did this move ultimately cost me?  I can’t say since at worst, it’s a wash.  But since I gained on the technology side I had to do it even if the server was NOT discounted.  So I’m happy with the result, just Ticked I had to spend so much brute-force time on something so theoretically simple. If 1and1 should read this, please ask for my quote to solve this problem on your end.  I can make it mutually beneficial. :D

In my spare time, (yeah right!!!) I’ll build some tools to automate this not-too-straightforward process.  Or search for something already built. :)

The BlogEngine.NET Multi-Blog angle

The major plus allowed me to complete an upgrade project of BlogEngine.NET Multi-blogging capabilities.  It moves things quite far along from where it began.  I’m still hopeful Jacob Proffitt continues his work on the SqlBlogProvider so BlogEnigne.NET can handle more people’s large scale needs.

 

DateTime Format for Blog Posts for BlogEngine.NET

...or wherever you want to standardize output formatting.

Here is a rather simple solution to my issue of Date Time formatting on my blog posts.  I noticed that as of a recent version of BlogEngine.NET, the Date looked something like this: "29. June 2008 09:00"  I wanted to change it to something more readable to my target readers, some very local, such as: "Sunday, June 29, 2008 09:00 AM".  Well, I might want to change it sometime, AND I would like to drop it into multiple Themes, so I decided to place the format in Web.Config AppSettings. I looked up my specific Format and added an appSetting.  Then I just replaced the code used in "PostView.ascx" and tested away.

Here's what you can do to implement this yourself.

  1. Go to .NET Framework Developer's Guide, Custom Date and Time Format Strings and/or locate your format string.
    • I used "dddd, MMMM dd, yyyy hh:mm tt"
  2. Create an appSettings key such as: Custom.DateFormat and assign your format to the value.
    • <add key="Custom.DateFormat" value="dddd, MMMM dd, yyyy hh:mm tt" />
  3. Now add the code to use the format string.
    • <%=Post.DateCreated.ToString(ConfigurationSettings.AppSettings["Custom.DateFormat"])%>
    • original: <%=Post.DateCreated.ToString("d. MMMM yyyy HH:mm") %>

 


This is what it looks like:

Web.Config ...

    <add key="Custom.DateFormat" value="dddd, MMMM dd, yyyy hh:mm tt" />
    </appSettings>
    

PostView.ascx ...

    <span class="author">by <a href="<%=VirtualPathUtility.ToAbsolute(" mce_href="<%=VirtualPathUtility.ToAbsolute("~/") + "author/" + Post.Author %>.aspx"><%=Post.AuthorProfile != null ? Post.AuthorProfile.DisplayName : Post.Author %></a></span>
    <span class="pubDate"><%=Post.DateCreated.ToString(ConfigurationSettings.AppSettings["Custom.DateFormat"])%></span>
    

DateTimeSnippet

 

You can add appSettings directly in Web.config, from IIS Manager, if ASP.NET configuration is available, or from "ASP.NET Web Site Administration Tool".  Although this solution was quick and dirty, the best answer may be to role localization into BlogEngine.NET using cultures.  This is not a specialty of mine so I would appreciate any suggestions on this topic.  It is likely only a few more lines of code for a "quick and dirty" approach but I'd rather make sure to do it right.

clip_image001

A simple way to adjust or tweak a theme to your liking can be as simple as a few lines of css code in styles.css.  I made a couple very minor changes to achieve the affect of a new background color, content on the right when it was always on the left, and a font color change to go along with the background better.  This is what it looked like:

/* I replace the Standard body formatting:
body {
    background-color: #F1F1F1;
    color: #444444;
    font-family: Verdana;
    font-size: 11px;
    margin: 0 auto;
    width: 980px;
    position: relative;
}*/

/* With the following: */
body {
    background-color: #6699FF;
    color: #444444;
    font-family: Verdana;
    font-size: 11px;
    margin: 0 auto;
    width: 980px;
    position: relative;
}

 

image

/* I replaced these lines:
#content {
    float: left;
    width: 70%;
}

#sidepanel {
    float: right;
    width: 28%;
}

    With this...   */

#content {
    float: right;
    width: 70%;
}

#sidepanel {
    float: left;
    width: 28%;
}

 

/* I replaced these lines:
#header span {  font-weight: normal;   letter-spacing: 4px;

color: silver; margin: 0px; }

#header a { text-decoration: none;  color: white;  }

    With this...*/

#header span {  font-weight: normal;  letter-spacing: 4px;

color: #0000CC;  margin: 0px; }

#header a { text-decoration: none; color: #0000CC; }

Then there was the slight issue with the Date Time format on the Blog post.  This is an example of a minor inconvenience and a quick and dirty solution.  I'll describe an alternative approach later.

image

Notice the formatting for June 29, 2008.  This date can probably be localized, but today it's hard coded in PostView.aspx.

clip_image001[11]

Note: I changed

    <%=Post.DateCreated.ToString("d. MMMM yyyy HH:mm") %>

To...

    <%=Post.DateCreated.ToString("dddd, MMMM dd, yyyy hh:mm tt") %>

To get the following results:

image

Yeah, I know this wasn't earth shattering.  But the premise is simple.  If there's a theme you want to use, except for a couple small items, change them.  The next step from here is to create a BlogEngine.NET theme for version 1.4.5, using an open source.  The Widget Zone needs a little tweaking on some of the older 1.2 and 1.3 themes, but we've already done that once (It's just about time for a new theme and BlogEngine.NET 1.4).  I hope everyone tries that once so we can have a few more themes right away.

Here's the new theme.  I'll call it nonStandard since I'm not a marketing guy: nonStandard.zip (6.28 kb) .  Enjoy!!!

It's already mid-August and I just finished a round of BlogEngine.NET updates to take advantage of the new features in 1.4.5.x.  For a lot of folks, the need to Blog is what makes this platform so valuable.  But my clients, and my own interests also include adding Extensions and Advertising.  Now that there's  a Text box Widget, I can add simple ads like an Amazon link, Google AdSense, and affiliate links right in the Widget Zone without any special code.  Maybe this can be improved to target this medium, but I have to admit, if it works, I'm going to use it as is.  But there are a few things I'd like to see sooner than later.

Multiple Blog Support

What if I had 15 Blogs on different topics and some of them included overlapping authors?  I would like to support this configuration with One code base, One server or service layer, connecting to a Single SQL database or SQL Server farm.  I know I'd want this because I want it now and I have 8 Blogs, with 8 Web Apps, 4 AppPools, and 8 sets of XML Data.

SQL Server Express wouldn't cut it since my server started running into resource issues.  Not because of SQL Server but because I need 8 databases the way this configuration is setup.  Even if I upgrade my server (or hosting platform) to allow for more capacity, it doesn't scale.  Also, I will spend more time maintaining Blogs than writing for them.  So more Blogs = Less Blogging.  That's not a positive goal for me. :(

See BlogEngine.NET on CodePlex: Multiple blogs in one BlogEngine.NET instance
See Also: SQL BlogEngine.NET and Multi-Blogging

I'm following the instructions from "Setting up BlogEngine.NET 1.4 to use SQL Server" so I can review the Provider and see if this seems practical.  I'll have to report back and add on here when complete.

Advertising the manual way

Anyone can now use a BlogEngine.NET 1.4.5 compatible theme and add a Text Box widget to the Widget Zone.  Then you can place and ad within, so long as it fits the box cleanly.  Don't forget colors, borders, iframe constraints., etc.  But this is still very clean compared with the alternative.

Using AdsenseInjector should place an AdSense ad within each blog post. I'm having problems when more than one AdSense block is configured on a page.  I still need to debug my specific issues, but it may stem from the fact that I messed with the Master file in the theme to place AdSense "elegantly" where I wanted it...of course this was just for testing the theory.  So, AdsenseInjector is a good start so I can't knock it.  It's certainly something I thought about but did no think through so now I have the benefit of someone else's labor.  However, I still would like to get it to work along side other Ads on my page.

Hacking various themes to produce Ad Friendly pages or posts may be the only way to get what I need.  Another way of looking at this could be to use the Widget or Webpart approach to building and organizing themes.

This was merely an exercise in describing what one blogger needs, but at the same time, setting in motion my attempts to achieve this and report back my R&D results.

I'd really like to see some more BlogEngine.NET themes take advantage of the new WidgetZone and cool features of version 1.4.  To that end, I wanted to see how difficult it would be to do this myself.  As a .NET architect and developer I haven't found myself doing a lot of css and UI interface work recently, but figured if I can do BizTalk, SharePoint, EntLib, SQL, WinForms and even ASP.NET development, HTML and css might be possible.  Besides, I'm only adding on to what other artists and geniuses have already done.

Here is my first attempt at modifying an existing BLogEngine.NET 1.3 theme to handle 1.4 functionality.  I went after one of my favorites: MWRT-002.

This is my update for BlogEngine.NET 1.4: MWRT-002-14.zip (23.24 kb)

Please critique, and let me know if you made any improvements that I had missed.  I'll be working on a few really nice themes from various locations over the next several weeks including one I'll be using on this site.  I'll try to show an example site soon.