Brian Nettles
It's my blog and I share.


 

Changing Domain Names and 301 Redirect

August 2nd, 2008 by Brian Nettles

Affect on Page Rank
Recently for Quest Software, we changed the domain name of one of the communities. It was a fairly new community that had plans to become one of the most prolific communities for Quest Software. Prior to the name change, the site already had the Google Page Rank of 3/10 showing up in the Google Toolbar. Not long thereafter, the new URL was showing up with a Page Rank of 0/10. I was quite ashamed as I was the one who recommended the change to the shorter URL. I felt that I had damaged the site. Then someone from outside of the communities pointed out that my redirects where not 301 redirects, they were 302 redirects.

Frankly, at this time, I had never heard of a 301 redirect. But being open to learn new things, I researched the 301 redirects and found this post by Matt Cutts, http://www.mattcutts.com/blog/seo-advice-discussing-302-redirects/.

In a nutshell, a 301 redirect is a permenant redirect. A 302 redirect is a temporary redirect. The new domain name recieved a 302 redirect from the original domain name and hence a penalty in Google probably for being duplicate content of an existing domain. The original domain name was simply being considered as temporarily offline.

So I dug in and figured out that the redirects I had set up in IIS did not have the “a permanent redirection for this resource” box checked. Problem solved? At least now I have the redirect set up properly.

Here is an example of what a 301 redirect looks like in IIS.

Here are a couple of examples of doing 301 redirects when using Apache / Linux.
http://briannettles.com/2008/07/using-htaccess-to-redirect-a-single-webpage/
http://briannettles.com/2008/05/getting-rid-of-the-www-on-you-website/

It still took another 6 weeks or so for the page rank in the toolbar to change. It remained showing up in the toolbar with a ranking of 0/10 throughout this time. Then finally on July 31, it changed to a ranking of 4/10.

Affect on Search Engine Results
While I do not have clear knowledge of how the Quest site was affected in the search engine results, I do have a second example where I do know how it was affected.

My tire chain website had a name which I chose to get rid of. Originally, this obsolete website was the catalog for my new site. I was reluctant to ditch the orginal name at first for one reason–the placement on the long tail search results for “Rud tire chains” was good. While the results for “Tire Chains” was horrible on the original domain name being on page 35, the results for “Rud tire chains” was perfect in the number 2 spot on page 1–right behind the manufacturer’s web page. Now the new domain name showed up on page 15 for “Tire chains” - much better. However, it as in position 5 on page 1 for “Rud tire chains”. I did not want to lose that number 2 spot which the original domain name had. Also, I had already changed about as many of the links as I was going to get changed to the new domain name and I believe that mostly all of the link changes were already saturated in Google for about a two week time period.

I took a chance to see what would happen if I put up a 301 redirect from the old domain name to the catalog directory of the new domain name and placed all of the contents of the old site into the catalog directory of the new site.

There was no change in Google for about ten days. Then finally the 301 redirect kicked in with Google. The old domain name disappeared as I had expected. Then new domain name jumped up into the coveted number two spot that I was afraid to lose. I even jumped up two pages on Google for the keyword search of “Tire Chains” to where I am now on page 13. This was a total win for me. Now I have the domain name I like, the positive ranking of the old domain name, and improved ranking of the new domain name.

Conclusion
A 301 redirect is a critical piece that all SEO experts must be familiar with. Google appears to handle it very nicely. I have been warned in other blog posts that the other search engines may not be so friendly to the 301 redirect. Since the vast majority of my traffic comes from Google anyways, I am not all that concerned with it.

Gallery2 for Web Based Photo Sharing Software

July 30th, 2008 by Brian Nettles

So I have been looking for a solution so that all of the family photos I have taken over the years could be backed up on a server and viewed when desired. I also thought it would be good to make the photos available to all family members who want them. I also thought it would be good to have a place for all extended family members to share their photos if they choose to do so. So I did some research on the internet and found this software package called Gallery2.

Gallery 2 is a php based software package which is perfect for my Linux / Apache webserver configuration. Installation was simple. Adding albums and photos was simple. Changing my header to make it look like the rest of my blog was simple as well.

The software appears to have a lot of functionality that I will never use. But that is okay. All I care about is the basics which it does very well.

In less than one week, I was able to install the software and upload and organize all of my family photos taken over the past 5 years. Go ahead and check it out. Just click on the link in the left navigation called Family Photos.

Confluence Recently Updated not Updating

July 1st, 2008 by Brian Nettles

Ran into this issue where the section on the main page called Recently Updated was not updating. 

The solution was  to go into Administration -> Content Indexing and Rebuild the Index.

The official instructions for Confluence is that if that does not work, then remove the <confluence-home>/index directory, restart the application server and then rebuild the index.

http://confluence.atlassian.com/display/CONF27/Rebuild+index+from+scratch

Using .htaccess to Redirect a Single Webpage

July 1st, 2008 by Brian Nettles

This will be a very simple entry.  If you need to redirect one web page to another web page and desire to get a 301 redirect, you simply add one line to the .htaccess file.

Redirect 301 /old.php http://domainname.com/new.php

If you do not have an .htaccess file, simply create the file in the directory that holds the html page and add that line.

This solution only works for Linux / Unix based servers.  I use it on the Red Hat flavor of Linux machines.

A Quick Wiki Software Review

June 30th, 2008 by Brian Nettles

My intent in this blog is to help jumpstart someone who is new to wikis and has been tasked to learn or prepare to deploy a wiki. 

1. What is a Wiki?
A wiki is a collaborative tool used to allow a group of people to jointly contribute to a document. Typically, how it works is that say a person wants documentation on a software program. The company will task several individuals to write the documentation. But instead of using Microsoft Word, the IS group puts up a wiki and each of the writers write their content to a wiki page. Now eventually, the jobs of the writers will cross. They may wish to contribute to the pages that the other writers have written because perhaps they know something the original author did not know. The wiki allows all writers to do just that. They can put in thier own two cents wherever they want to in the document.

Now suppose the manager of the document does not like the content of one of the contributors, and he or she feels that the latest changes to the document where really messed up. No problem. The manager of the document will have the ability to roll back the document to any previous version. It is very difficult to break a document in a wiki because the managers always have the ability to take out the trash.

2. Which Software Package is Best
There are some really good potential packages you can use.  This is the list of wikis I have now used.

  • Sharepoint
  • JSPWiki
  • PHPWiki
  • MediaWiki
  • Confluence

Sharepoint - Now Sharepoint is not just a wiki.  Sharepoint is the collaboration tool that Microsoft wants everyone to use.  It is an application that is quite customizable with a lot of out of the box web widgets that can create a really good project managment and organization tool for you.  A Wiki is just one of its available web parts.

Personally, I am quite fond of Sharepoint.  The last opportunity I had to project manage, I used Sharepoint as the team collaboration tool.  All of the writeups for future reference where done with the Sharepoint wiki.  For example, one person was tasked to make this integrate image support into the forums.  After he built the functionality, he had to write up his specifications on a wiki page.  Now, 6 months later, I still have his write up ready for reference.  If things have changed, anyone with access can modify the contents.

The Sharepoint Wiki functionality is good for small groups.  However, it is not near as robust as some of the other available wikis.  What you get is a list of pages and the ability for anybody on the team to edit the page.  There is no further organization of your wiki pages.  If Sharepoint is your existing collaborative tool, I do recommend using it.  However, if you are looking for collaborative wiki for wide scale use with a lot more really useful functionality, I would say that this is not the right tool.

JSPWiki - At first, I was rather impressed with this free open source package built on the Java Platform.  I initially put it up for the Powergui team as a beta to see if it would serve their purposes for a wiki.  We ran into some pitfalls with it.

  • It did not run well on all platforms. It did best in a Linux / Apache / Tomcat environment.  I could not get it to work on Resin.  Lastly, it seemed to cause instability when I combined it on the same tomcat application server with Jive Integrated running on a Windows 2003 server sitting behind IIS. 
  • It was functionality deficient.  You could roll back pages, but it did not have a good diff utility.  Also, you could not set up email notifications for page changes.  The users also complained about the inability to escape certain characters.
  • On the positive side, the support team including Janne Jalkanin ware very helpful even though they were working for free.  My hats off to them.

 Unfortuneatly, we had to scrap using JSPWiki and turn to a different platform.

PHPWiki - After scraping the JSPWiki project, I downloaded PHPWiki and installed it on a Red Hat Linux ES 5.0 server.  This did not go well at all.  PHPWiki required some PHP_DBA functions in order to work.  Those PHP_DBA functions are not in the out of the box RPM installation of PHP on Red Hat.  I searched and searched for the proper RPM packages but could not find it.  In order to get those functions up, I would have needed to uninstall PHP via the RPMs and reinstall php by compiling the source code with all of the required flags to make it work.  That was just too much work for my feeble mind so I said “Screw It”!!!  I have time on my hands, but not that much time. 

MediaWiki - After failing now on two Wikis for the Powergui community, I dug up one called Media Wiki.  Media Wiki claims to be the wiki software used by Wikipedia.  After my frustrations with PHPWiki, this one was a breath of fresh air.  Installation was probably the simplest I have ever seen for any out of the box web application installation.  This wiki is functionality rich having all the items that JSPWiki did not have.  Administration is user freindly.  It has good internationization support as well.  The Powergui Team thus far has been rather pleased with this choice.  I give this application two thumbs up for a wide scale collaborative tool - especially in terms of being an external wiki for documenting a software package.  Also, this software package is a free opensource application.  Nice job!!!

http://mediawiki.org

Confluence - There are certain groups in Quest Software that make use of this Wiki made by Atlassian and I have recently been assigned to take over the administration of this application.  It is a very good platform built on Java and is probably the most functionality rich of all Wikis.  It includes watch support, tree structure organization, rich permission functionality, and even the ability to integrate with your active directory.  It has the best user interface making it simple for anyone to use.  It is very expandable and organizable and works well for large organizations with many teams.  It also supports a rich scripting which for those who have taken the time to learn gives then far greater power at organizing content.   This platform from my perspective is the darling of all wikis.  The only weakness is that it does cost.  Last time I checked it was about $7,500 for an unlimited use external collaboration license.  If that is not a factor to you, you will not go wrong with this one.  http://www.atlassian.com/

In the end, I give two thumbs up for both Media Wiki and Confluence. 

Setup Hibernate in a Swing Application

June 28th, 2008 by Brian Nettles

Hibernate works very well in Swing Applications. This page is intended to help you get started in implementing Hibernate with Swing. This particular example is set up in a database environment using Oracle 10g. However, this setup will work perfectly in other database enviroments by simply modifying the database connection information.

 1. Download the latest Version
Hibernate can be found http://www.hibernate.org/6.html. After you download it, make certain you not only place hibernate.jar in you classpath, you may want to include all of the jar files that are found in the lib directory of the extracted files. While many may not be used in your application, some of them are likely to result in runtime errors if not included in the classpath.

 2. Create the hibernate.cfg.xml file.
This is the primary configuration file that should be placed at the root of your source code.

 <?xml version=“1.0″ encoding=“UTF-8″?>
<!DOCTYPE hibernate-configuration PUBLIC
“-//Hibernate/Hibernate Configuration DTD//EN”
“http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd”>

 <hibernate-configuration>
<session-factory>
     
<property name=“hibernate.connection.driver_class”>oracle.jdbc.driver.OracleDriver</property>
     
<property name=“hibernate.connection.url”>jdbc:oracle:thin:@servername.domainname.com:1521:dbname</property>
     
<property name=“hibernate.connection.username”>username</property>
     
<property name=“hibernate.connection.password”>password</property>
     
<property name=“hibernate.connection.pool_size”>10</property>
     
<property name=“show_sql”>true</property>
     
<property name=“dialect”>org.hibernate.dialect.Oracle10gDialect</property>
     
<property name=“connection.autocommit”>true</property>
     
<!– Mapping files –>
     
<mapping resource=“Entry.hbm.xml”/>
</session-factory>
</hibernate-configuration>

You may need to modify the dialect to match your current version of Oracle. Other available dialects for the Oracle database include OracleDialect (deprecated), Oracle8iDialect, and Oracle9iDialect. It is also important that you set the autocommit property to true if you are not using exlicit transactions in your application. Otherwise, you may get frustrated as you try to look at the database and see that your changes have not been commited to the database. 

3. Create a class to match a given database table.
This example called Entry.java matches a database table called Entry.

package com.utilities.data;

public class Entry
{
   
private int entryID;
   
private int userID;
   
private String title = “”;
   
private long creationDate;

    public Entry(){  }

    public void setEntryID(int entryID)  { this.entryID=entryID;  }        
   
public void setUserID(int userID) { this.userID=userID; }
   
public void setTitle(String title) { this.title=title; }
   
public void setCreationDate(long creationDate) { this.creationDate = creationDate; }

    public int getEntryID()  { return this.entryID;  }        
   
public int getUserID() { return this.userID; }
   
public String getTitle() { return this.title; }
   
public long getCreationDate() { return this.creationDate; }
}

 The corresponding table creation and sequence creation commands are given here as well.

CREATE SEQUENCE Entry_seq MINVALUE 1 START WITH 1 INCREMENT BY 1;
   
CREATE TABLE ENTRY
(
   
EntryID Number Primary Key,
   
UserID  Number Not Null,
   
Title   Varchar2(255),
   
CreationDate Number
);

With this example you can will are shown using int, String, and long datatypes in Hibernate. In this particular application, the architects choose to use the Date.getTime() functionality to store date values.

4. Create the Mapping Resource File.

This particular file is called Entry.hbm.xml. It is stored in the root directory right next to the hibernate.cfg.xml file and is used to bridge the java object values to the database. In many applications, it is prefered to place this file right next to Entry.java. However, it appears that in Swing applications, Hibernate has difficulty finding it unless it is in the root directory.

<?xml version=“1.0″ encoding=“UTF-8″?>
<!DOCTYPE hibernate-mapping PUBLIC
“-//Hibernate/Hibernate Mapping DTD 3.0//EN”
“http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd”>

<hibernate-mapping package=“com.utilities.data”>
   
<class name=“Entry” table=“Entry”>
       
<id name=“entryID” column=“EntryID” type=“int”>
           
<generator class=“sequence”>
               
<param name=“sequence”>Entry_seq</param>
           
</generator>
       
</id>
       
<property name=“userID” type=“int” />
       
<property name=“title” type=“string” length=“255″ />
       
<property name=“creationDate” type=“long” />
   
</class>    
</hibernate-mapping>

5. Populate the class called Entry as you would any other java class.

6. Save the data to the database
From within your DAO class make the following calls. Please pay attention to the following line:

configuration = new Configuration().configure(”/hibernate.cfg.xml”);

In some applications, it is enough to simply call configuration = new Configuration()

Unfortuneately, my swing application required the additional configure method to be called in order to find the configuration file.

 package com.utilities.data;

import org.hibernate.cfg.Configuration;
import org.hibernate.SessionFactory;
import org.hibernate.Session;

public class ImportToolDAO
{

    private Configuration configuration;
   
private SessionFactory factory;
   
private static ImportToolDAO importToolDAO;
   
   
private ImportToolDAO()
   
{
        configuration
= new Configuration().configure(“/hibernate.cfg.xml”);
        factory
= configuration.buildSessionFactory();  
   
}
   
   
public static ImportToolDAO getInstance()
   
{
         
if(importToolDAO==null)
         
{
              importToolDAO
= new ImportToolDAO();
         
}
         
return importToolDAO;
   
}
   
   
public void saveEntry(Entry entry)
   
{
       
Session session = factory.openSession();
        session
.save(entry);
        session
.flush();
        session
.close();
   
}
}

   7. Run the Application.  If you followed everything step by step, it just might work for you the first time. Go check your database and be prepared for a smile.

No connection properties specified - the user must supply JDBC connections

June 26th, 2008 by Brian Nettles

Was trying to get setup with Hibernate and ran into the following error and stack trace:

INFO: using JDK 1.4 java.sql.Timestamp handling
Dec 26, 2007 11:40:40 AM org.hibernate.connection.UserSuppliedConnectionProvider configure
WARNING: No connection properties specified - the user must supply JDBC connections
Exception in thread "AWT-EventQueue-0" org.hibernate.HibernateException: Hibernate Dialect
must be explicitly set
    at org.hibernate.dialect.DialectFactory.determineDialect(DialectFactory.java:57)
    at org.hibernate.dialect.DialectFactory.buildDialect(DialectFactory.java:39)
    at org.hibernate.cfg.SettingsFactory.determineDialect(SettingsFactory.java:426)
    at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:128)
    at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2009)
    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1292)

This error occured as Hibernate was unable to locate the hibernate.cfg.xml file. To fix this, I had to change the way of calling the Hibernate Configuration class. For some reason, in my web based applications, the first example of calling the class worked perfectly. It did not work in my Swing application so I changed to the the second version below:

Version 1:
Configuration configuration = new org.hibernate.cfg.Configuration();

Version 2:
org.hibernate.cfg.Configuration configuration = new org.hibernate.cfg.Configuration().configure(”/hibernate.cfg.xml”);

java.lang.NoClassDefFoundError: net/sf/cglib/proxy/CallbackFilter

June 26th, 2008 by Brian Nettles

Ran across this error while setting up an application using Hibernate. After googling it some, I came across a thread (in Spanish) referencing the need to include the cglib-2.1.3.jar. That may have fixed the problem; nevertheless, the problem had to do with not including all of the hibernate jar files found in the hibernate-3-X-X.ga.zip file. There are more jar files needed than just hibernate.jar. Make certain you include all of jar files that are in the lib folder of the downloaded uncompressed hibernate file. If all of the files are included, you should not run into this error.

org.hibernate.MappingNotFoundException: resource: /Entry.hbm.xml not found

June 26th, 2008 by Brian Nettles

Ran across this error while building the Swing application with Hibernate. Originally, the Entry.hbm.xml file was placed deep in the directory structure next to the java class called Entry.java. Several ways of naming the xml file where tried. The only solution that worked in this case was to move the file outside of the classpath structure and place it in the root directory next to the hibernate.cfg.xml file.

An OSCommerce Review

June 20th, 2008 by Brian Nettles

I give OSCommerce a C rating.
OSCommerce is an open source shopping cart for the web. It is free to download and fairly simple (but not without flaw) to install on a Red Hat Linux machine. I have now done two implementations of OS Commerce. The first was for a site that sells Tire Chains. The second site is one that sells camping gear.

Now, I don’t wish to offend anyone on the development team who spent long hard hours unrewarded without pay. I am using this program on two websites. I greatly appreciate your contributions.

Installation (B)
The installation was mostly straight forward. Create a website space in apache, add a subdirectory called catalog, and unzip the tar file into the catalog subdirectory. Remember to follow the instructions in the README.txt file.

My only issue came after installation, I had issues with certain images not wanting to display. My fix was an undesirable hack be removing some .htaccess files that were blocking access to the path. Check the logs for the paths that are being blocked. There is probably a better fix available - I simply was not able to find it.

Admin Console (B)
The console has a lot of good functionality. You can populate your shopping cart from within this console and manage your users. What I found lacking was the ability to have a backdoor to give discounts to individuals or to create orders bypassing the payment system directly used in the websites. Backdoor approaches for managing orders may have been nice; but not necessary as basic functionality. Working with Images I found to be tricky. I ended up taking a standard templated size for my product images of 428 x 300 and populated all of the product with that size.

Shipping Cost (D)
Certain modules exist out of the box; however, none of them were satisfactory to my needs unless I offered free shipping. I am creating a UPS Module which should most certainly be an out of the box item. My module is not yet ready for production use and it will probably be another two months from now before I will be able to get back to it to perfect it.

Credit Card Processing (D)
The Pay Pal module is very simple to implement. However, there is one huge flaw. If the user does not click on the very final link in paypal, the purchase will not get registered in the OSCommerce system; however, the purchasers credit card will get charged. That is really bad.

I tried signing up for payquake and all they offered was another Authorize.net payment gateway. PayQuake had no knowlege on how to use the out of the box module in OSCommerce and refused to support it. I personally refuse to go with Authorize.net as my experience with their customer service is probably the worst I have seen in a large company in my life-that is a topic for another day.

So I have concluded that I am having to piggybacking off of the out of the box credit card module with my own customizations to make it process credit card transactions in real time.

Basically, most non-programmers will be completely stuck at this point with no good alternative but to either switch shopping carts or pay someone to do some programming for them.

Theme Support (F)
Most open source web applications have strong theme support. This allows you to set up your own look and feel without disturbing application logic. Examples of this are Wordpress, Simple Machines Forum, and PHPBB–all of which have very good separations of display code from the application logic. OSCommerce display logic is very much embedded into the application logic. This causes two problems:

1. If you do know know php, then you will have a very difficult time doing any real customizing to your look and feel.

2. If you wish to upgrade to a newer out of the box version of OSCommerce, your look and feel will have to be redone. Upgrades in wordpress happen often for security reasons. It would be disasterous for the bloggers if thier themes were destroyed during every upgrade.

Customization (B+)
Some of the out of the box open source software programs are very rigid and difficult to customize. This largely depends on how much abstraction has been added. I personally hate overly abstracted programs because it takes longer to learn the abstraction then it does to just change plain old simple code. In my opinion, PHPBB and Media Wiki are examples of overly abstracted programs. Wordpress, Simple Machines Forums, and OSCommerce are not. As a result, it is not difficult to make a lot of basic changes that you or your client may desire in the shopping cart.

Conclusion (C)
If you do not have any PHP programming skills and you have no money to pay for a programmer, I would avoid this platform. Unfortunately, I do not have a good alternative for you. A friend of mine recommended Zencart. If you are a php programmer-or can afford one, with a little bit of effort, you can go a long ways with OSCommerce. It has its flaws, but it does work for me.


Blog Information Profile for Supertramp678