Wednesday, July 25, 2007

Subtext, Godaddy and redgreenblur

So here is the start of a new blog about random things that I find interesting.  The most interesting thing going on right now is my battle with getting Subtext working with my Godaddy Economy Hosting account...

I found a blog posting about setting Subtext up with Godaddy over at fallingcanbedeadly.com but still had a couple issues getting up and running. (http://fallingcanbedeadly.com/blog/archive/2007/06/10/just-switched-to-subtext-1.9.5.aspx)   Here is my version of running Subtext on Godaddy:

Start by downloading the latest version of the Subtext Install package from www.subtextproject.com and extracting these files to a temporary folder.

Login to Godaddy and open the hosting control panel for the domain you want to install Subtext on.

Set your Content Root ASP.NET Runtime to version 2.0 with the Directory Management tool.
Create a directory named "blog" with Read, Write, Web, and Setroot permissions.

Using the Database tool create a new SQL Server Database.  You can make the database name, username, and password whatever you want.
After the database setup is complete click the Edit/View Details button, then the Configuration button.  Your going to need to use some of the information from the SqlConnection string.
* SqlConnection (.NET):
* Data Source=YOURSERVER; Initial Catalog=YOURDATABASE; User ID=YOURUSERID; Password='YOURPASSWORD';

Open the Web.config file from the root of the Subtext install package you downloaded and make the following changes:
(line numbers are estimated)

Database connection string-Line 40: 
<add name="subtextData" connectionString="Server=YOURSERVER; Database=YOURDATABASE; User ID=YOURUSERID; Password=YOURPASSWORD; Trusted_Connection=False" providerName="System.Data.SqlClient" />

Email settings for godaddy-Line 168:
<add name="SystemMailProvider" type="Subtext.Framework.Email.SystemMailProvider, Subtext.Framework"
          smtpServer="relay-hosting.secureserver.net"
          username=""
          password=""
          adminEmail="youremail@yourdomain.com"/>


Forgot Admin Password Email-Line 360:
<add key="HostEmailAddress" value="youremailaddress@domain.com"/>

Trust Level-Line 379:
<!--  <trust level="Full" originUrl=".*" /> -->

Custom Errors-Line 410:
<customErrors mode="Off"/>  
<!-- <customErrors mode="RemoteOnly" defaultRedirect="~/SystemMessages/Error.aspx">
      <error statusCode="404" redirect="~/SystemMessages/FileNotFound.aspx"/>
      </customErrors> -->

 
Now you will need to upload your Subtext folder to your Godaddy hosting account using your favorite ftp client.  Place all of the Subtext files and folders into the "blog" folder we created earlier.

Open your browser and go to http://www.yourdomain.com/blog. The Subtext installer will take it from here.

If you want you can make a redirect Default.aspx page in your root folder to forward visitors to the blog.  Just copy and paste the following into a text editor and save it as Default.aspx.  Change "yourdomain" and upload it into your root folder.  Credit goes to Fallingcanbedeadly.com for the following source:

<%@ Page language="c#" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >

<html>
  <head runat="server">
    <title></title>
    <meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
    <meta name="CODE_LANGUAGE" Content="C#">
    <meta name=vs_defaultClientScript content="JavaScript">
    <meta name=vs_targetSchema content="http://schemas.microsoft.com/intellisense/ie5">
  </head>
  <body MS_POSITIONING="GridLayout">
    <form id="Form1" method="post" runat="server">
  <% Response.Redirect("http://www.yourdomain.com/blog"); %>
     </form>
  </body>
</html>