<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>WestHost Blog – WestHost Web Hosting &#187; Web site Development</title>
	<atom:link href="http://blog.westhost.com/category/web-site-development/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.westhost.com</link>
	<description></description>
	<lastBuildDate>Thu, 19 Nov 2009 21:55:49 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>AutoMOD: Customization Magic for phpBB3</title>
		<link>http://www.westhost.com/blog/2009/09/24/automod-customization-magic-for-phpbb3/</link>
		<comments>http://www.westhost.com/blog/2009/09/24/automod-customization-magic-for-phpbb3/#comments</comments>
		<pubDate>Fri, 25 Sep 2009 00:05:49 +0000</pubDate>
		<dc:creator>Cody Erekson</dc:creator>
				<category><![CDATA[Technical Support]]></category>
		<category><![CDATA[Web site Development]]></category>

		<guid isPermaLink="false">http://www.westhost.com/blog/?p=435</guid>
		<description><![CDATA[One of the many site applications we offer is phpBB3, which claims to be “the most widely used open-source bulletin board system in the world.”  Using phpBB3 you can create everything from large discussion forums to small game clan meeting rooms.  It offers the tools necessary for moderation teams to maintain control of [...]]]></description>
			<content:encoded><![CDATA[<p>One of the many site applications we offer is phpBB3, which claims to be “the most widely used open-source bulletin board system in the world.”  Using phpBB3 you can create everything from large discussion forums to small game clan meeting rooms.  It offers the tools necessary for moderation teams to maintain control of your site.  A detailed permissions system also allows access to specific features as you see fit.  </p>
<p><img src="http://www.westhost.com/blog/wp-content/uploads/2009/09/AutoMod.gif" alt="" /><br />
Perhaps the greatest aspect of phpBB3 is the ability to customize it by installing any of a number of available modifications. You’ll see a list of modifications later in the post, but first things first: Installation. </p>
<p><span id="more-435"></span></p>
<p>Unless you are familiar with the PHP coding language, installing these mods can be a daunting task.  That’s where <a href="http://www.phpbb.com/mods/automod/">AutoMOD </a>comes in!  AutoMOD is a mod installation utility that will insert the necessary code into your phpBB3 site quickly and easily.</p>
<p><strong>Five Steps to Install AutoMOD:</strong></p>
<ol>
<li>Upload all of the files and folders from the “upload” directory to your site with the FTP client of your choice.  Ensure that you maintain the correct data structure, i.e., files in includes need to go in the includes folder on your site</li>
<p></P></p>
<li>Once the files are in place, browse to the install directory (http://www.yoursite.com/phpbb/install) to run through the simple and painless installation.  </li>
<p></P></p>
<li>Don’t forget to delete the install folder from the server or phpBB3 will not allow anyone to use the site.</li>
<p></P></p>
<li>To install the mod, upload the mod files and let AutoMOD do the work!</li>
<p></P></p>
<li>After you upload your mod files into the newly created /phpbb/store/mods folder on the server, the mod will be displayed in the AutoMOD tab in the Administration Control Panel.  Next to the name of the available mod is an “Install” link.  </ol>
</li>
<p>AutoMOD will check all of the code changes necessary and alert you if there is a problem; for example you may have already installed a mod that affects the specific code that the current mod needs to change.  In this case, you will be shown the changes that are required for the current installation and you can make the choice to continue or cancel.  </p>
<p>If there are any additional steps needed to complete the installation, AutoMOD will tell you exactly what’s needed.  If you decide in the future that you don’t want the changes implemented by a particular mod, AutoMOD can remove it for you as well. How cool is that!</p>
<p>There are literally hundreds of phpBB3 modifications available.  The <a href="http://www.phpbb.com/community/viewforum.php?f=69">official phpBB site</a> hosts over 300 mods alone, all of which have been reviewed for security flaws and obvious bugs.  You can transform phpBB3 from a simple bulletin board system into a feature rich content management system, a near LinkedIn clone, or even a blog.</p>
<p>Here are some of the more common and useful mods you may wish to look at:</p>
<ul>
<li><a href="http://www.phpbb.com/community/viewtopic.php?f=69&#038;t=1146135">Advertisement Management</a>: Manage your banner ads, create rotating ads &#038; filter viewers of advertisements </li>
<li><a href="http://www.phpbb.com/community/viewtopic.php?f=69&#038;t=1308375">User Blog Mod</a>: Feature rich blogging system that can be available to all of your site members</li>
<li><a href="http://www.phpbb.com/community/viewtopic.php?f=69&#038;t=1726785">phpBB Smartfeed</a>: Creates RSS 1.0, 2.0, and ATOM 1.0 newsfeeds so you can syndicate your site contents</li>
<li><a href="http://www.phpbb.com/community/viewtopic.php?f=69&#038;t=691165">SEO Mod</a>: Optimize your phpBB3 site’s ability to gain ranking within search engines</li>
<li><a href="http://www.phpbb3portal.com/">phpBB3 Portal</a>: Add a front portal page to your forum, effectively converting phpBB3 into a full CMS</li>
</ul>
<p>With all of these mods at your fingertips, the Internet is your oyster!</p>
<p>Cody Erekson<br />
WestHost Technical Support</p>
]]></content:encoded>
			<wfw:commentRss>http://www.westhost.com/blog/2009/09/24/automod-customization-magic-for-phpbb3/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Improving Apache Web Server Performance</title>
		<link>http://www.westhost.com/blog/2009/06/09/improving-apache-web-server-performance/</link>
		<comments>http://www.westhost.com/blog/2009/06/09/improving-apache-web-server-performance/#comments</comments>
		<pubDate>Tue, 09 Jun 2009 16:33:57 +0000</pubDate>
		<dc:creator>Nick Venturella</dc:creator>
				<category><![CDATA[Technical Support]]></category>
		<category><![CDATA[Web site Development]]></category>

		<guid isPermaLink="false">http://www.westhost.com/blog/?p=322</guid>
		<description><![CDATA[
Even to most Internet professionals, the Apache web server software can be as perplexing as it is ubiquitous. Although not as comprehensive as the official 685-page documentation, this post outlines two useful features you can enable in the httpd.conf file to improve the performance of your web server:  persistent connections and gzip compression.
Important note: [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.westhost.com/images/nventurella_poloroid.jpg" style="float: right; margin: -15px 0 0 7px;"/></p>
<p>Even to most Internet professionals, the Apache web server software can be as perplexing as it is <a href="http://news.netcraft.com/archives/web_server_survey.html" target="_blank">ubiquitous</a>. Although not as comprehensive as the <a href="http://httpd.apache.org/docs/2.0/" target="_blank">official 685-page documentation</a>, this post outlines two useful features you can enable in the httpd.conf file to improve the performance of your web server:  persistent connections and gzip compression.</p>
<p>Important note: An error in your Apache configuration can take all of your web sites offline. Please make a backup copy of the <strong>/etc/httpd/conf/httpd.conf</strong> file before you begin making modifications. Also remember that it is necessary to restart your account to apply either of the changes described below.</p>
<p><span id="more-322"></span></p>
<p style="font-size: 14px;"><strong>Persistent Connections (Keep-Alive)</strong></p>
<p>In addition to your web page itself, web browsers must also download each stylesheet, script, image, and other file referenced by your page. Historically, this meant that browsers would connect to a server, download the page, and disconnect. The browser would then initiate a new connection, download the first referenced file, and disconnect, repeating the process to fetch each additional file. As web pages became increasingly complex, they began using more files and the slow connect/download/disconnect method became noticeably time-consuming. This problem was solved with the introduction of persistent connections, as described below in the Apache documentation:</p>
<p style="margin: 0 25px; padding: 0 7px; border-left: solid 1px black;"><em>The Keep-Alive extension to HTTP/1.0 and the persistent connection feature of HTTP/1.1 provide long-lived HTTP sessions which allow multiple requests to be sent over the same TCP connection. In some cases this has been shown to result in an almost 50% speedup in latency times for HTML documents with many images.</em></p>
<p>Under the default settings, persistent connections are enabled on your account, but the <span style="font-family: courier;">KeepAliveTimeout</span> is set to 15 seconds (near line 86 of /etc/httpd/conf/httpd.conf). This means that Apache connections will stay active for 15 seconds after visitors have downloaded (and possibly even left) the web page. Apache connections use server resources and your account has a limited number of Apache connections, so this is generally undesirable.</p>
<ul>
<li><strong>For the best performance on most websites, leave</strong> <span style="font-family: courier;">KeepAlive On</span> <strong>but reduce the</strong> <span style="font-family: courier;">KeepAliveTimeout</span> <strong>to 1 or 2 seconds</strong>. This allows visitors to benefit from faster downloads through persistent connections, but helps prevent Apache from overloading the server and keeping too many connections open at once.</li>
<li><strong>In rare cases, on websites with extremely heavy traffic, turn</strong> <span style="font-family: courier;">KeepAlive Off</span>. Persistent connections guarantee faster page loads for your visitors but come at the cost of increased resource utilization by requiring more Apache connections to remain open concurrently on the server. If you are frequently reaching the maximum number of allowed Apache connections, it is probably necessary to upgrade your hosting package, but turning off persistent connections is one final step you can take to squeeze a little bit more out of your current plan.</li>
</ul>
<p style="font-size: 14px;"><strong>Gzip Compression (mod_deflate)</strong></p>
<p>HTML, CSS, and many other programming languages used on the web are highly redundant, allowing them to be compressed effectively. <span style="font-family: courier;">mod_deflate</span>, Apache’s compression engine, is installed but not enabled by default. To enable automatic gzip compression, add the following lines of code to the end of your httpd.conf file:</p>
<p><code><br />
SetInputFilter DEFLATE<br />
AddOutputFilterByType DEFLATE text/html<br />
AddOutputFilterByType DEFLATE text/css<br />
AddOutputFilterByType DEFLATE text/xml<br />
AddOutputFilterByType DEFLATE text/plain<br />
AddOutputFilterByType DEFLATE text/rtf<br />
AddOutputFilterByType DEFLATE text/javascript<br />
AddOutputFilterByType DEFLATE application/x-javascript<br />
AddOutputFilterByType DEFLATE application/xml<br />
AddOutputFilterByType DEFLATE application/xhtml+xml<br />
AddOutputFilterByType DEFLATE application/rss+xml<br />
AddOutputFilterByType DEFLATE application/atom+xml<br />
AddOutputFilterByType DEFLATE application/rdf+xml<br />
AddOutputFilterByType DEFLATE application/postscript<br />
AddOutputFilterByType DEFLATE application/msword<br />
AddOutputFilterByType DEFLATE application/vnd.ms-excel<br />
AddOutputFilterByType DEFLATE application/vnd.ms-powerpoint<br />
AddOutputFilterByType DEFLATE image/svg+xml<br />
AddType image/svg+xml .svg<br />
</code></p>
<p style="clear: both;">After you have edited the httpd.conf file and restarted your account, <a href="http://www.whatsmyip.org/http_compression/" target="_blank">test whether compression is working properly</a>.</p>
<p>Persistent connections significantly improve loading multimedia-rich sites with large numbers of images and other files, while gzip compression reduces HTML, CSS, JavaScript, and other text by an average of 80 percent, but these two changes are just the beginning! Read <a href="http://developer.yahoo.com/performance/rules.html" target="_blank">Yahoo’s list of Best Practices for Speeding Up Your Web Site</a> for even more ways to make your pages load faster.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.westhost.com/blog/2009/06/09/improving-apache-web-server-performance/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Customizing Zen Cart, Part 2</title>
		<link>http://www.westhost.com/blog/2009/05/19/customizing-zen-cart-part-2/</link>
		<comments>http://www.westhost.com/blog/2009/05/19/customizing-zen-cart-part-2/#comments</comments>
		<pubDate>Tue, 19 May 2009 17:01:29 +0000</pubDate>
		<dc:creator>Kevin Griffiths</dc:creator>
				<category><![CDATA[Technical Support]]></category>
		<category><![CDATA[Web site Development]]></category>
		<category><![CDATA[customizing]]></category>
		<category><![CDATA[e-commerce store]]></category>
		<category><![CDATA[zen cart]]></category>

		<guid isPermaLink="false">http://www.westhost.com/blog/?p=293</guid>
		<description><![CDATA[In part one of customizing Zen Cart (found here) we covered changing the color scheme of your store to better fit your needs. In part two we will be discussing changing some of the main images that Zen Cart uses in the design.

Changing Images
The first image you might want to get rid of is the [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.westhost.com/blog/wp-content/uploads/2009/05/zen-cart-logo1.png" alt="Zen Cart Logo" title="" width="146" height="40" align="right" style="margin-left: 10px;" />In part one of customizing Zen Cart (found <a href="http://www.westhost.com/blog/2009/05/customizing-zen-cart-part-1/" title="Customizing Zen Cart Part 1">here</a>) we covered changing the color scheme of your store to better fit your needs. In part two we will be discussing changing some of the main images that Zen Cart uses in the design.<br />
<span id="more-293"></span></p>
<h2>Changing Images</h2>
<p>The first image you might want to get rid of is the main banner image and replace it with your own. The main banner is actually made up of two parts. The first part is the clouds image. This is referenced again in the CSS file that you have already edited. The CSS file looks like this:<br />
<code><br />
#logoWrapper{<br />
       background-image: url(../images/header_bg.jpg);<br />
        background-repeat: repeat-x;<br />
        background-color: #ffffff;<br />
        height:75px;<br />
        }<br />
</code><br />
To remove the clouds image, you simply removed the reference to the image:<br />
<code><br />
#logoWrapper{<br />
        background-repeat: repeat-x;<br />
        background-color: #ffffff;<br />
        height:75px;<br />
        }<br />
</code><br />
By default Zen Cart uses logo.gif for the name of this image, but you can use you own filename for the logo. Using an image editor, create your new logo and upload it to your server.</p>
<p>After creating your logo you can adjust the height, width and logo name in includes/languages/english/header.php. Also, you will have to change includes/languages/english/classic/header.php.<br />
<code><br />
define('HEADER_ALT_TEXT', 'Powered by Zen Cart :: The Art of E-Commerce');<br />
define('HEADER_LOGO_WIDTH', '192px');<br />
define('HEADER_LOGO_HEIGHT', '64px');<br />
define('HEADER_LOGO_IMAGE', 'logo.gif');<br />
</code><br />
Make the needed changes reflecting the name of your site, and the width, height and filename of your logo that you created. To get rid of that pesky “Sales Message Goes Here” text, you need to modify the header.php file in the path /var/www/var/zencart/includes/languages/english/classic/ .<br />
The rest of the images on the site are banners and those banners can be turned on, off, or deleted. You can do this through the admin panel for your cart. After your images have been modified, your cart should look something like this:</p>
<p> <img src="http://www.westhost.com/blog/wp-content/uploads/2009/05/zencart021.gif" alt="Customize Zen Cart" title="" width="288" height="260" style="margin: 0pt auto; display: block;" /></p>
<p>Congratulations, you are well on you way to creating a shopping cart that will fit your site’s personality.</p>
<p>—————————–</p>
<p>Would you like to perform the above (or more) on your site, but not comfortable with the code? WestHost can help, just fill out a request <a href="https://corp2.westhost.com/designquote" title="free estimate" target="_blank">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.westhost.com/blog/2009/05/19/customizing-zen-cart-part-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Customizing Zen Cart, Part 1</title>
		<link>http://www.westhost.com/blog/2009/05/14/customizing-zen-cart-part-1/</link>
		<comments>http://www.westhost.com/blog/2009/05/14/customizing-zen-cart-part-1/#comments</comments>
		<pubDate>Thu, 14 May 2009 20:29:05 +0000</pubDate>
		<dc:creator>Kevin Griffiths</dc:creator>
				<category><![CDATA[Technical Support]]></category>
		<category><![CDATA[Web site Development]]></category>
		<category><![CDATA[e-commerce]]></category>
		<category><![CDATA[zen cart]]></category>
		<category><![CDATA[zencart]]></category>

		<guid isPermaLink="false">http://www.westhost.com/blog/?p=283</guid>
		<description><![CDATA[One of our more recent Site Application additions has been Zen Cart. This e-commerce solution has many robust features and this article will give some detailed information, giving you the ability to modify the cart with your own look and feel.

The first thing you might want to do to your new store is to modify [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.westhost.com/blog/wp-content/uploads/2009/05/zen-cart-logo.png" alt="Zen Cart" title="zen-cart-logo" width="146" height="40"align="right" style="margin-left: 10px;" />One of our more recent Site Application additions has been Zen Cart. This e-commerce solution has many robust features and this article will give some detailed information, giving you the ability to modify the cart with your own look and feel.<br />
<span id="more-283"></span><br />
The first thing you might want to do to your new store is to modify the CSS to provide the “feel” you are looking for. The templates are located in zencart/includes/templates/. One thing that is of special interest is that Zen Cart has two templates it starts by default. There is the classic template and there is the template_default template. Zen Cart will use the template_default template for most of its features, but any changes to the classic template will override the template_default template. The template_default will render the default CSS and basically is the configuration Zen Cart will have if there were no template installed.  For the purposes of this post, we’ll talk about making changes to the classic template as it is in place after the installation from Site Manager.  The classic template can be found in zencart/includes/templates/classic/css/.. You want to modify the file called stylesheet.css.</p>
<p>Common things I often asked are how colors, widths, heights, and images are changed. The first thing I will start with is the overall color scheme of your store. Your store will look like this when it is first loaded.</p>
<p><img src="http://www.westhost.com/blog/wp-content/uploads/2009/05/zencart01.gif" alt="Zen Cart Customization" title="zencart01" width="288" height="262" style="display: block; margin: 0 auto;" /></p>
<h2>Color Schemes</h2>
<p>Many ask how to change the green color scheme.  To do this, we have to modify the CSS file located in zencart/includes/templates/classic/css/ called stylesheet.css. The green headers are actually small gif images that are referenced in the CSS file. They can be deleted or changed. I have highlighted the specific text in my example below.</p>
<p><code>#navMainWrapper, #navSuppWrapper, #navCatTabsWrapper {<br />
        margin: 0em;<br />
        background-color: #abbbd3;<br />
        background-image: url(../images/tile_back.gif);<br />
        padding: 0.5em 0.2em;<br />
        font-weight: bold;<br />
        color: #ffffff;<br />
        height: 1%;<br />
        }<br />
</code><br />
In my example below you can see that the reference to the image has been removed and I have changed the background color to blue.<br />
<code><br />
#navMainWrapper, #navSuppWrapper, #navCatTabsWrapper {<br />
        margin: 0em;<br />
        background-color: #000CFF;<br />
        padding: 0.5em 0.2em;<br />
        font-weight: bold;<br />
        color: #ffffff;<br />
        height: 1%;<br />
        }<br />
</code><br />
The image is referenced in four other tags throughout the CSS file.  To completely change this look, you will need to remove or possibly change the reference.  The tags that need to be changed are listed below. Simply look for the exact tags in the file and remove the image reference.<br />
<code><br />
#navMainWrapper, #navSuppWrapper, #navCatTabsWrapper {<br />
#navEZPagesTop {<br />
.leftBoxHeading, .centerBoxHeading, .rightBoxHeading {<br />
.productListing-rowheading {<br />
</code><br />
It would probably be a good time to save your changes and take a look at the impact you have had on Zen Cart.  Save your work and take a look at your cart in your browser.  For those of you falling asleep at this point, you may need to hit refresh in your browser.  Now, you may notice some throwbacks to the green theme at the bottom of each element in the browser. You can change this heavy green line by modifying the CSS file on the lines outlined below.<br />
<code><br />
.leftBoxContainer, .rightBoxContainer {<br />
        margin: 0em;<br />
        border: 1px solid #9a9a9a;<br />
        border-bottom: 5px solid #336633;<br />
        margin-top: 1.5em;<br />
        }<br />
</code><br />
If you want to make the width the same as the rest of the lines and change the color of the borders to match your header, you would set to it something like this:<br />
<code><br />
.leftBoxContainer, .rightBoxContainer {<br />
        margin: 0em;<br />
        border: 1px solid #000CFF;<br />
        margin-top: 1.5em;<br />
        }<br />
</code><br />
Now the store should look something like this:<br />
<img src="http://www.westhost.com/blog/wp-content/uploads/2009/05/zencart02-284x300.gif" alt="Customizing Zen Cart" title="zencart02" width="284" height="300" style="display: block; margin: 0 auto;" /></p>
<p>Read Customizing Zen Cart Part 2 by <a href="http://www.westhost.com/blog/2009/05/customizing-zen-cart-part-2/">clicking here</a>.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>Would you like to perform the above (or more) on your site, but not comfortable with the code? WestHost can help, just fill out a request <a href="https://corp2.westhost.com/designquote" target="_blank">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.westhost.com/blog/2009/05/14/customizing-zen-cart-part-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Apache Tomcat 101</title>
		<link>http://www.westhost.com/blog/2009/04/23/apache-tomcat-101/</link>
		<comments>http://www.westhost.com/blog/2009/04/23/apache-tomcat-101/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 18:29:17 +0000</pubDate>
		<dc:creator>Dustin Olson</dc:creator>
				<category><![CDATA[Technical Support]]></category>
		<category><![CDATA[Web site Development]]></category>

		<guid isPermaLink="false">http://www.westhost.com/blog/?p=260</guid>
		<description><![CDATA[
To all Tomcat users out there, I’m sure many of you have had questions on how to get things up and running; questions like ‘Is Apache Tomcat the same thing as Tomcat?’, and ‘How do I get the :8080 to go away?’
What is Apache Tomcat? 
Apache Tomcat and Tomcat are the same thing. Apache, in [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.westhost.com/images/tomcat_logo.jpg" alt="Apache Tomcat" title="Apache Tomcat" style="float:left; margin-right:20px;"/></p>
<p>To all Tomcat users out there, I’m sure many of you have had questions on how to get things up and running; questions like ‘Is Apache Tomcat the same thing as Tomcat?’, and ‘How do I get the :8080 to go away?’</p>
<p><strong>What is Apache Tomcat? </strong></p>
<p>Apache Tomcat and Tomcat are the same thing. Apache, in this case, is simply the parent project and does not refer to the Apache web server. Apache Tomcat acts as a <a href="http://en.wikipedia.org/wiki/Servlet_container#Servlet_containers" target="_blank">servlet container</a> that processes Java servlets/JSP pages. There are some specifications that can be made within the Apache web server to let Apache know whether or not to handle the request or pass it on to Tomcat for processing. These specifications are located in the mod_jk.conf (sometimes just jk.conf) file in the /etc/httpd/conf.d directory. </p>
<p><span id="more-260"></span></p>
<p><strong>Great! So how do I get Apache Tomcat to find my JSP pages?</strong> </p>
<p><img src="http://www.westhost.com/images/dolson_blog.jpg" alt="Dustin Olson" title="Dustin Olson" style="float:right; margin-left:15px; margin-top:-8px;"/></p>
<p>While a number of specifications can take place in the mod_jk.conf file, the most relevant is the JkMount directive. This is the option that tells Apache whether or not to pass the request on to Tomcat. If you create a new folder in the /var/tomcat5/webapps directory for your Java related content, which is where is should be, Apache will not know about it by default. If the folder is called ‘test’, for example, then you would be able to access the folder by going to http://yourdomain.com:8080/test/ but it would not work by going to just http://domain.com/test/ which is, of course, what most of you will want. To get this functionality, a JkMount directive would have to be used inside the jk.conf file. It would look as follows:</p>
<p>JkMount /test/* ajp13w</p>
<p>Once this change is made and Apache is restarted (notice, Tomcat does NOT need restarting in this case because it was an Apache directive in an Apache configuration file that was altered) then http://yourdomain.com/test/ will come up fine and will be handled by Tomcat, as desired. If you are familiar with SSH, you can use the ‘apachectl graceful’ command to restart Apache. Otherwise you can go in through your Site Manager under the Restart Account section and restart that way. </p>
<p><strong>What if I want my Java web application to show up at http://yourdomain.com instead of http://yourdomain.com/folder/?</strong> </p>
<p>In this scenario, you will create a folder called ROOT (all upper case) inside the /var/tomcat5/webapps directory and put all of your java content in there. You will then setup the JkMount directive as follows and then restart Apache as mentioned above:</p>
<p>JkMount /* ajp13w </p>
<p>Now your Java web application is all up and running. That’s all it takes!</p>
<p><strong>A few more tidbits for those who want to understand what all that means:</strong></p>
<p>The ‘ajp13w’ entry above refers to a user specified in the /etc/httpd/conf/workers.properties file and stands for Apache JServ Protocol. To find out more on this protocol and its functions, see <a href="http://tomcat.apache.org/connectors-doc/ajp/ajpv13a.html" target="_blank">http://tomcat.apache.org/connectors-doc/ajp/ajpv13a.html</a>. That should give you a good understanding of what role a Tomcat worker plays and how and why Tomcat processes are spawned and resources are used. A Tomcat worker is a Tomcat instance that is waiting to execute servlets or any other content on behalf of some web server. For example, we can have a web server such as Apache forwarding servlet requests to a Tomcat process (the worker) running behind it. In WestHost&#8217;s case, ajp13 and ajp12 are the only workers setup, ajp13 being the default worker, and the preferred worker due to it being configured to use sockets as it’s communication channel (see above link for further detail.) When the JkMount directive is used, it is assigned to the ajp13 worker as the entry specifies.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.westhost.com/blog/2009/04/23/apache-tomcat-101/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Simple and Clean Menus with jQuery</title>
		<link>http://www.westhost.com/blog/2009/03/25/simple-and-clean-menus-with-jquery/</link>
		<comments>http://www.westhost.com/blog/2009/03/25/simple-and-clean-menus-with-jquery/#comments</comments>
		<pubDate>Wed, 25 Mar 2009 16:05:18 +0000</pubDate>
		<dc:creator>Chris Michaelis</dc:creator>
				<category><![CDATA[Web site Development]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[menus]]></category>

		<guid isPermaLink="false">http://www.westhost.com/blog/?p=231</guid>
		<description><![CDATA[Creating a nice-looking menu can be a challenge. You want something that&#8217;s clean, that looks good, and that fits into your site. These aren&#8217;t such demanding things to ask for in a menu, but if you search the Internet for &#8220;html menu&#8221;, you get all sorts of strange selections, varying in degrees of complexity, and [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.westhost.com/blog/wp-content/uploads/2009/03/jquery-menus00.jpg" alt="jQuery" title="jquery-menus00" width="200" height="54" align="right" />Creating a nice-looking menu can be a challenge. You want something that&#8217;s clean, that looks good, and that fits into your site. These aren&#8217;t such demanding things to ask for in a menu, but if you search the Internet for &#8220;html menu&#8221;, you get all sorts of strange selections, varying in degrees of complexity, and usually designed for a specific site layout or color scheme.</p>
<p>What if you could have a very recognizable menu system &#8211; like the one that Windows Explorer™ uses, shown here?</p>
<p><img src="http://www.westhost.com/blog/wp-content/uploads/2009/03/jquery-menus01.jpg" alt="Windows Explorer menus" title="jquery-menus01" width="399" height="297" /><br />
<span id="more-231"></span><br />
Thanks to jQuery and its multitude of useful plug-ins, you can have just that. The SimpleTree plug-in takes only seconds to create a menu system that nearly every computer user will immediately recognize and feel comfortable with. What’s shown below is the default icon theme that the plug-in includes, but you can always edit or replace the images to change the computer icon, the folder icons, or the &#8220;leaf&#8221; icons to suit your needs.</p>
<p>If you&#8217;re not familiar with jQuery, see some of our previous posts on the topic:<br />
<a href="http://www.westhost.com/blog/2009/01/dynamic-websites-with-jquery-and-extjs/" target="_blank">http://www.westhost.com/blog/2009/01/dynamic-websites-with-jquery-and-extjs/</a><br />
<a href="http://www.westhost.com/blog/2009/03/more-jquery-blockui-plug-in/" target="_blank">http://www.westhost.com/blog/2009/03/more-jquery-blockui-plug-in/</a></p>
<p>Check out our simple menu below, or the complete example: <a href="http://cmichaelis.whsites.net/whblog/jquery-simpletree/" target="_blank">http://cmichaelis.whsites.net/whblog/jquery-simpletree/</a></p>
<p><img src="http://www.westhost.com/blog/wp-content/uploads/2009/03/jquery-menus02.jpg" alt="jQuery menus" title="jquery-menus02" width="200" height="141" /></p>
<p>In order to create this menu, we need only a small bit of JavaScript code, placed in your jQuery &#8220;ready&#8221; function:<br />
<code><br />
simpleTreeCollection = $('.simpleTree').simpleTree({<br />
  autoclose: true,<br />
  afterClick:function(node){<br />
    $.blockUI({ message: 'You clicked on:&lt;br/ &gt;' + $('span:first',node).text() + '&lt;br /&gt;&lt;br /&gt;&lt;a href="javascript:void(0)" onclick="$.unblockUI()"&gt;Click here to dismiss.&lt;/a&gt;'});<br />
  },<br />
  animate:true,<br />
  drag:false<br />
});<br />
</code></p>
<p>We also need to define the menu items themselves. This will be done with an unordered list (ul) element which has the class &#8220;simpleTree&#8221;:</p>
<p><code><br />
&lt;ul id="browser" class="simpleTree"&gt;<br />
 &lt;li class="root"&gt;&lt;span&gt;Contents&lt;/span&gt;<br />
 &lt;ul&gt;<br />
  &lt;li class="open" id="item1"&gt;&lt;span&gt;This is the first item...&lt;/span&gt;<br />
   &lt;ul&gt;<br />
    &lt;li id="subitem1"&gt;&lt;span&gt;Sub Item #1&lt;/span&gt;&lt;/li&gt;<br />
    &lt;li id="subitem2"&gt;&lt;span&gt;Sub Item #2&lt;/span&gt;&lt;/li&gt;<br />
   &lt;/ul&gt;<br />
  &lt;/li&gt;<br />
</code><br />
<code><br />
  &lt;li class="open" id="item2"&gt;&lt;span&gt;This is the second item...&lt;/span&gt;<br />
   &lt;ul&gt;<br />
    &lt;li id="subitem3"&gt;&lt;span&gt;Sub Item #3&lt;/span&gt;&lt;/li&gt;<br />
    &lt;li id="subitem4"&gt;&lt;span&gt;Sub Item #4&lt;/span&gt;&lt;/li&gt;<br />
   &lt;/ul&gt;<br />
  &lt;/li&gt;<br />
&lt;/ul&gt;<br />
</code></p>
<p>When your jQuery ready event runs, it will convert the unordered list into the menu. That&#8217;s all there is to it!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.westhost.com/blog/2009/03/25/simple-and-clean-menus-with-jquery/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>More jQuery (BlockUI plug-in)</title>
		<link>http://www.westhost.com/blog/2009/03/03/more-jquery-blockui-plug-in/</link>
		<comments>http://www.westhost.com/blog/2009/03/03/more-jquery-blockui-plug-in/#comments</comments>
		<pubDate>Tue, 03 Mar 2009 17:52:13 +0000</pubDate>
		<dc:creator>Chris Michaelis</dc:creator>
				<category><![CDATA[Web site Development]]></category>
		<category><![CDATA[blockui]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://www.westhost.com/blog/?p=174</guid>
		<description><![CDATA[&#8220;The page at www.yoursite.com says…&#8221;
Does that look familiar? If you use alert() or confirm() from JavaScript in your web page, some browsers display a standard, boring window with that title, and your message in it.
A few weeks ago, I introduced jQuery, a powerful tool for writing dynamic and engaging websites quickly. Today I’d like to [...]]]></description>
			<content:encoded><![CDATA[<p>&#8220;The page at www.yoursite.com says…&#8221;</p>
<p>Does that look familiar? If you use alert() or confirm() from JavaScript in your web page, some browsers display a standard, boring window with that title, and your message in it.</p>
<p>A few weeks ago, I introduced jQuery, a powerful tool for writing dynamic and engaging websites quickly. Today I’d like to take a brief moment of your time to introduce BlockUI, a plug-in for jQuery. Beyond the power of jQuery itself, you can accomplish much using jQuery plug-ins. Many common tasks are taken care of and abstracted into easy to use, feature-rich plug-ins &#8211; a full list can be found at <a href="http://plugins.jquery.com/">http://plugins.jquery.com/</a>.<br />
<span id="more-174"></span><br />
BlockUI (<a href="http://malsup.com/jquery/block/">http://malsup.com/jquery/block/</a>) is a small plug-in that will allow you to change a boring prompt into a nice-looking one.</p>
<p>Turn this:  <a href="http://cmichaelis.whsites.net/whblog/jquery-blockui/boring.html">http://cmichaelis.whsites.net/whblog/jquery-blockui/boring.html</a></p>
<p><img src="http://www.westhost.com/blog/wp-content/uploads/2009/03/blockui-1.gif" alt="" title="blockui-1" width="352" height="198" /></p>
<p>…into this: <a href="http://cmichaelis.whsites.net/whblog/jquery-blockui/better.html">http://cmichaelis.whsites.net/whblog/jquery-blockui/better.html</a></p>
<p><img src="http://www.westhost.com/blog/wp-content/uploads/2009/03/blockui-2.gif" alt="" title="blockui-2" width="482" height="172" /></p>
<p>The BlockUI plug-in allows you to place the message over the whole page, or over just a particular block element (like a &#8220;div&#8221; tag).  You can specify a message to display, or you can even have a complex piece of your page hidden (with style=&#8221;display: none&#8221;) and display it in this fashion.</p>
<p>Visit <a href="http://malsup.com/jquery/block/">http://malsup.com/jquery/block/</a> to download it, and to view more examples &#8211; and bring your website’s messages up to the next level.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.westhost.com/blog/2009/03/03/more-jquery-blockui-plug-in/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>E-commerce checklist</title>
		<link>http://www.westhost.com/blog/2009/02/17/e-commerce-checklist/</link>
		<comments>http://www.westhost.com/blog/2009/02/17/e-commerce-checklist/#comments</comments>
		<pubDate>Tue, 17 Feb 2009 17:09:54 +0000</pubDate>
		<dc:creator>Jason Norris</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Marketing & Advertising]]></category>
		<category><![CDATA[Web site Development]]></category>
		<category><![CDATA[cart]]></category>
		<category><![CDATA[e-commerce]]></category>
		<category><![CDATA[ecommerce]]></category>
		<category><![CDATA[shopping]]></category>
		<category><![CDATA[store]]></category>

		<guid isPermaLink="false">http://www.westhost.com/blog/?p=169</guid>
		<description><![CDATA[So you are thinking of setting up an e-commerce store
There are many things to take into account when setting up an online store front. Below is a list of some of the major items. You will want to thoughtfully consider and research each of these options before beginning the actual work of getting your site [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.westhost.com/blog/wp-content/uploads/2009/02/ecommerce-checklist1.jpg" alt="ecommerce checklist" width="144" height="199" align="right" /><em>So you are thinking of setting up an e-commerce store</em></p>
<p>There are many things to take into account when setting up an online store front. Below is a list of some of the major items. You will want to thoughtfully consider and research each of these options before beginning the actual work of getting your site built and running.<br />
<span id="more-169"></span></p>
<p>&nbsp;</p>
<p><strong>Domain Name Registration</strong><br />
A Domain name is one of those must haves for any site. Without it you can not have a site. When you are deciding on a domain name for your site consider the following.</p>
<ul>
<li>How easy is it to remember?</li>
<li>Is it easy to misspell?</li>
<li>Does it adequately portray your store?</li>
<li>Is it too long?</li>
</ul>
<p>You can search for available domain names using this handy tool available at <a href="http://www.westhost.com/domainreg/">http://www.westhost.com/domainreg/</a>.</p>
<p>&nbsp;</p>
<p><strong>Web Hosting Solution</strong><br />
Again, this is a must have in order to get your site online. The basic rule here is to make sure that the plan offers what you need.</p>
<ul>
<li>Does it include a ready to install shopping cart solution that meets your needs?</li>
<li>How is the hosting company? What type of reviews do they get from existing clients?</li>
</ul>
<p>(If you select a hosting company and plan simply based on the cheapest price more often than not you will get what you pay for when something goes wrong and you need the hosting company to assist you.)</p>
<p>WestHost offers three standard e-commerce oriented hosting plans (Business Value, Business Pro, and usually the current special). You can compare their features and pricing at the link below.<br />
<a href="http://www.westhost.com/business-hosting-compare.html">http://www.westhost.com/business-hosting-compare.html</a></p>
<p>&nbsp;</p>
<p><strong>Shopping Cart Solution</strong><br />
The best way to approach this is to start with a list of the features that you would like your shopping cart to have (coupons, product options, etc.). Once you have this list you will know what to look for in the shopping cart software. As you look for a shopping cart solution you will also want to look into what level of support you can expect from the shopping cart company, your hosting company, or your Web designer/developer in regards to the shopping cart.</p>
<p>Another important thing to consider is how flexible your shopping cart is. Can features be added in the future as you grow and need to offer new functionality?</p>
<p>&nbsp;</p>
<p><strong>SSL Certificate</strong><br />
If you are taking credit card payments online through your site then this is a must have. Even if you are not, it is most definitely a very strong ‘should have’. An SSL certificate is what secures the personal data of your customers as it is transferred from their computer to your server. Customers will look for your site being secure when you ask them for their personal information. They want to know that you are watching out for their best interest and security.</p>
<p>There are options in selecting your SSL certificate. I am not going to get into all of the details here regarding SSL certificates, but you can read up on them a bit at the links below.<br />
<a href="http://members.westhost.com/ssl-web-hosting.html">http://members.westhost.com/ssl-web-hosting.html</a><br />
<a href="http://www.westhost.com/e-commerce-hosting.html">http://www.westhost.com/e-commerce-hosting.html</a><br />
<a href="http://www.westhost.com/faq/ssl/index.html">http://www.westhost.com/faq/ssl/index.html</a></p>
<p>&nbsp;</p>
<p><strong>Merchant Account/Payment Gateway</strong><br />
The merchant account gives you the ability to take and process credit card payments. Your payment gateway is what connects your merchant account to your Web site. As you shop around for a merchant account and payment gateway you will find that each company’s fees and charges will vary. WestHost has partnered with two different payment processing services to help offer you the best service for your money. You can review these payment processing options here <a href="http://www.westhost.com/e-commerce-hosting.html">http://www.westhost.com/e-commerce-hosting.html</a>.</p>
<p>The biggest thing when choosing your payment processing solution is to make sure that it is compatible with your chosen shopping cart. Find out what payment gateways your merchant account supports and make sure that the shopping cart you select supports the same gateway.</p>
<p>&nbsp;</p>
<p><strong>Shipping Options</strong><br />
This item, along with what tax rates you need to charge, is often overlooked until the last minute.</p>
<p>First of all, are your products shippable? Second, how will they be shipped and how do you want your shipping charges determined in the shopping cart. Determining the best shipping is often a balancing act between not loosing money on shipping and not charging so much that your customers go elsewhere.</p>
<p>Most shopping cart solutions will offer multiple options for determining shipping charges. They will range from a simple table based shipping (based on either total order price or weight) to live rates from the major shipping vendors. If you leave this decision until the cart is ready to go live you might find yourself in a corner with no desirable solution. You want to make sure your chosen shopping cart will support or can be modified to support (usually through the use of modules) the type of shipping setup that you need.</p>
<p>&nbsp;</p>
<p><strong>Tax Rates</strong><br />
Most states have their own rules as to who needs to charge tax to whom. You will want to become familiar with these rules so that you do not get into trouble. The other reason for taking this into consideration is to make sure that your shopping cart solution will accommodate the way you need to have your taxes set up to meet your local law requirements.</p>
<p>&nbsp;</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>Approaching your new e-commerce site from the right angle will help to eliminate headaches along the way. Feel free to add to the list below or give your own insights into setting up an e-commerce Web site.</p>
<p>Please share any tips that you have for setting up an e-commerce site.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.westhost.com/blog/2009/02/17/e-commerce-checklist/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>MySQL optimizations: indexes</title>
		<link>http://www.westhost.com/blog/2009/01/20/mysql-optimizations-indexes/</link>
		<comments>http://www.westhost.com/blog/2009/01/20/mysql-optimizations-indexes/#comments</comments>
		<pubDate>Tue, 20 Jan 2009 22:28:10 +0000</pubDate>
		<dc:creator>Morgan Smith</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Technical Support]]></category>
		<category><![CDATA[Web site Development]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Optimization]]></category>

		<guid isPermaLink="false">http://www.westhost.com/blog/?p=153</guid>
		<description><![CDATA[Many of us use MySQL to power our websites. Using a database is necessary for many common applications like Wordpress, Joomla, and phpBB due to the amount of information which they serve. A database backend is a natural choice for a website which becomes more complex as it allows for a more efficient storage and [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.westhost.com/blog/wp-content/uploads/2009/01/logo_mysql.gif" alt="MySQL Logo" title="logo_mysql" width="114" height="68" align="left" hspace="15" />Many of us use MySQL to power our websites. Using a database is necessary for many common applications like Wordpress, Joomla, and phpBB due to the amount of information which they serve. A database backend is a natural choice for a website which becomes more complex as it allows for a more efficient storage and organization of data as well as an easy way to retrieve and serve content. </p>
<p>Information inside a typical MySQL database is stored in tables. Information is retrieved by querying these tables, usually with some criteria so that we receive only the information which we want. In order to fulfill a query and return the right information, MySQL must examine all rows in the tables and see which one’s match our criteria. This can be a resource intensive process which can slow down a website’s performance depending on the amount of data which must be examined.</p>
<p>MySQL has a great feature which can help speed up queries. Enter table indexes.<br />
<span id="more-153"></span><br />
An index for a MySQL table is similar to the index of a book in that it’s a quick way to find the information we&#8217;re looking for. Instead of reading through an entire table to find the information we want, MySQL can consult the table index which greatly increases the speed of the search. Pretend we have this table named eyeColor:</p>
<pre>mysql> describe eyeColor;
+-----------+---------+
| name      | color   |
+-----------+---------+
| Morgan    | Hazel   |
| David     | Hazel   |
| Paul      | Blue    |
| Cameron   | Green   |
| Matt      | Brown   |
+-----------+---------+</pre>
<p>I would like to query this table to see who has blue eyes. My query would look something like this:</p>
<pre>mysql> select name from eyeColor where color = 'blue';</pre>
<p>In this query, &#8220;color = &#8216;blue&#8217; &#8221; is my criteria for the search. I only want to see who has blue eyes and this limits the information which is returned to those who only have blue eyes. I can gain some information about this query by asking MySQL to explain it:</p>
<pre>mysql> explain select name from eyeColor where color = 'Blue';</pre>
<p><a href="http://www.westhost.com/blog/wp-content/uploads/2009/01/mysql_explain.gif" style="text-decoration: none;"><img src="http://www.westhost.com/blog/wp-content/uploads/2009/01/mysql_explain.gif" alt="" title="mysql_explain" width="525" /><br />Click to Enlarge</a></p>
<p>See how there are NULL values for many of the above fields? This looks like a simple query in the table eyeColor. The type is ALL, meaning that a full table scan is performed. This is the slowest type. The possible_keys and key values are NULL, meaning no indexes could be or were used. According to the rows information, 5 rows had to be examined to fulfill this query.</p>
<p>Now I’m going to create an index using the first 3 characters of the items in the color column:</p>
<pre>mysql> create index index_color on eyeColor( color(3) );</pre>
<p>This time, when I ask MySQL to describe my query we should see that things have changed:</p>
<pre>mysql> explain select name from eyeColor where color = 'Blue';</pre>
<p><a href="http://www.westhost.com/blog/wp-content/uploads/2009/01/mysql_explain21.gif" style="text-decoration: none;"><img src="http://www.westhost.com/blog/wp-content/uploads/2009/01/mysql_explain21.gif" alt="" title="mysql_explain21" width="525" /><br />Click to Enlarge</a></p>
<p>Again, this is a simple query in the eyeColor table. This time the type is ref, indicating that an index will be referenced. The possible_keys and key values show that my index index_color was used in this query. According to the rows information, only 1 row had to be examined to fulfill this query. </p>
<p>This shows that without an index, every row in the table must be examined to fulfill a query. Some sites have tens of thousands to several million entries in a table. You can see that without an index that there is a lot of work which must be done. Major website softwares like Wordpress, Joomla, and phpBB create indexes in their databases. If you design your own site using MySQL then you may wish to start using indexes to increase the efficiency and speed of your site.</p>
<p>Have some more ideas on optimizing MySQL to speed up your Web site, please share.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.westhost.com/blog/2009/01/20/mysql-optimizations-indexes/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Dynamic Websites with jQuery and extJS</title>
		<link>http://www.westhost.com/blog/2009/01/13/dynamic-websites-with-jquery-and-extjs/</link>
		<comments>http://www.westhost.com/blog/2009/01/13/dynamic-websites-with-jquery-and-extjs/#comments</comments>
		<pubDate>Tue, 13 Jan 2009 16:33:11 +0000</pubDate>
		<dc:creator>Chris Michaelis</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Web site Development]]></category>

		<guid isPermaLink="false">http://www.westhost.com/blog/?p=137</guid>
		<description><![CDATA[Is your site too plain? Do you want to add a bit of spark or flair to the visual appearance of your site? Maybe you&#8217;re looking for some creative ways to work with menus or display contextual information. Perhaps pop-up blockers have made you rethink how to design your site, but you dislike constant page [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.westhost.com/blog/wp-content/uploads/2009/01/jquery-extjs-logos.gif" alt="" title="jquery-extjs-logos" width="200" height="116" align="right" />Is your site too plain? Do you want to add a bit of spark or flair to the visual appearance of your site? Maybe you&#8217;re looking for some creative ways to work with menus or display contextual information. Perhaps pop-up blockers have made you rethink how to design your site, but you dislike constant page reloads as visitors navigate your site, and you&#8217;re looking for a solution.</p>
<p>All of these concerns can be addressed by using JavaScript to make your site more dynamic, inviting, and engaging.</p>
<p>In this article, I&#8217;ll introduce you to two tools that can help you transform a plain site into a modern, good-looking and engaging site. The disadvantage, which I&#8217;ll tell you up front, is that your visitor must have a JavaScript-capable browser. This does rule out some older mobile browsers, but even mobile devices are becoming more widely JavaScript capable (e.g., Opera Mini).<br />
<span id="more-137"></span><br />
In our example, we&#8217;ll start out with a simple site: a resume or curriculum vitae for our well-beloved John Doe. Such a dynamic site might be considered overkill for a simple resume page, but consider if John Doe is a web designer. What would a plain, uninviting site say about him?</p>
<p>For our starting point, please see our first example:<br />
<a href="http://cmichaelis.whsites.net/whblog/jquery-extjs-1/example1.html" target="_blank">http://cmichaelis.whsites.net/whblog/jquery-extjs-1/example1.html</a></p>
<p>In addition to using tables, which are generally frowned upon now, it lacks any paragraph (<code>&lt;p&gt;</code>) tags or any real styling information. All of the information is displayed at once, with no personal feel and no interactivity. While this is generally what you want for a resume, since it&#8217;s printable and contains all information in one place, assume for a moment that this was a site detailing a product you&#8217;ve begun selling, or a documentation interface. This would be too much information for a potential customer to take in all at once, and is somewhat bland.</p>
<p>Now, take a look at our second example:<br />
<a href="http://cmichaelis.whsites.net/whblog/jquery-extjs-1/example2" target="_blank">http://cmichaelis.whsites.net/whblog/jquery-extjs-1/example2</a></p>
<p>Much better! It could still use some graphic embellishment, but is a great start to improving the site. There are all sorts of possibilities here for layout and functionality that you can use to make the site more usable and more modern.</p>
<p>This example is adapted from the &#8216;complex&#8217; example included in the extJS distribution. extJS (<a href="http://extjs.com/" target="_blank">http://extjs.com/</a>) is a JavaScript library designed to help develop web sites that look much better than a typical web site, even resembling desktop applications. In our example, we also used jQuery (<a href="http://jquery.com/" target="_blank">http://jquery.com/</a>), a somewhat smaller JavaScript library which is intended to vastly simplify common web programming tasks. We&#8217;ll address each library in turn, and then explain how the components of the second example work together. In future blog postings, I&#8217;ll be covering some of the unique functionality of each of these two libraries in more depth &#8211; there is far too much there to explore in one blog posting! Hopefully this introduction will whet your appetite for more.</p>
<p><strong>extJS</strong></p>
<p>extJS is a complete application framework for developing web sites. Many JavaScript coders will caution you against using monolithic third-party libraries, stating that you never know what&#8217;s actually in them and whether it&#8217;s secure. I stand by the idea that you should always understand what you&#8217;re putting up on your site before you use it. Notwithstanding this caution, extJS seems to be a powerful, well written, and secure framework with a great community behind it.</p>
<p>It includes dozens of components somewhat like &#8220;controls&#8221;, for those familiar with desktop application development, which enable rapid construction. The library features grid components, tab panels, window managers, tree layout managers, checkbox managers, toolbar systems and menu layout systems, data grids that tie into databases, and dozens of other handy items. All of them are themable and flexible for your needs! </p>
<p><strong>jQuery</strong></p>
<p>jQuery is a tool that allows you to accomplish more, with less coding and less time. For instance, we frequently need to transfer data without a refresh to make a smooth interface. Suppose that you had a div element called &#8220;content&#8221;, and you wanted to have a link update it with more information, without a page refresh. This could be done like:</p>
<p><code>&lt;div id="content"&gt;Click &lt;a href="javascript:void(0)" id="showmorelink"&gt;here&lt;/a&gt; for more!&lt;/div&gt;</code></p>
<p><code>&lt;script language="text/javascript"&gt;<br />
$('#showmorelink').click(function() { $('#content').load('/secondpage.html'); });<br />
&lt;/script&gt;</code></p>
<p>This small code segment illustrates a few of the interesting features of jQuery. Events can be tied to objects in your document easily &#8211; we assigned an inline function to the click event of the &#8220;showmorelink&#8221; anchor with one quick statement. Frequently, setup steps like this are done in the $(document).ready event &#8211; this event is called when the page has loaded fully, including all images.</p>
<p>The $(&#8217;#content&#8217;) statement is referred to as a &#8220;selector&#8221;, meaning that it grabs one or more document elements so that you can work on it. We then use the function load() to replace the HTML of the &#8220;content&#8221; div element. We could also have used .after() to place new content after that div.</p>
<p>A selector can grab multiple elements, which is particularly useful when working with CSS classes. The pound symbol (#) indicates that you&#8217;re selecting by an ID; you can also select by CSS class by using a period. Something like $(&#8217;.popupimage&#8217;).hide(&#8217;fast&#8217;); could be used to select every item in the document with the class popupimage and hide it with a &#8220;fast&#8221; animation. This is useful, for instance, with an image gallery full of pop-up images.</p>
<p>jQuery can be used to accelerate development dramatically, as well as increasing readability and maintainability.</p>
<p><strong>Bringing it all together: Example 2</strong></p>
<p>Our second example started with the &#8220;complex&#8221; example in the extJS distribution (<a href="http://extjs.com/products/extjs/download.php?dl=extjs22" target="_blank">http://extjs.com/products/extjs/download.php?dl=extjs22</a>). We removed a few pieces that weren&#8217;t needed, and added a couple of small items.</p>
<p>First off in the page, we load the extJS libraries:<br />
<code>&lt;script type="text/javascript" src="js/adapter/ext/ext-base.js"&gt;&lt;/script&gt;<br />
&lt;script type="text/javascript" src="js/ext-all.js"&gt;&lt;/script&gt;</code></p>
<p>Next, we get jQuery libraries:<br />
<code>&lt;script type="text/javascript" src="js/jquery-1.2.2.pack.js"&gt;&lt;/script&gt;<br />
&lt;script type="text/javascript" src="js/jquery.simple.tree.js"&gt;&lt;/script&gt;</code></p>
<p>Finally, we pick up some stylesheets:<br />
<code>&lt;link rel="stylesheet" type="text/css" href="css/style.css" /&gt;<br />
&lt;link rel="stylesheet" type="text/css" href="css/jquery.simple.tree.css" /&gt;</code></p>
<p>We now have everything we need to work with extJS and jQuery here. Now, we enter a large section of JavaScript code. First, we have:<br />
<code>var tabpanel;</code></p>
<p>Setting this as a global variable (outside of a function definition) allows us to refer to the tab panel collection from any function or code segment, which is handy to allow links to add tabs.</p>
<p>Next, we set up the extJS environment. Here, we configure the tab panel with an initial item &#8211; the welcome page &#8211; and attach it to a particular content element in the document with the variable &#8220;contentEl&#8221;.  Next, we set up the viewport component, which defines a north, south, east and west section. We give each a height and width, and associate each with a content element.</p>
<p>The next section is recognizable as jQuery code &#8211; we set up a document ready function, and use this event to initialize the navigation tree seen in the left of the web page. This is a jQuery plug-in, by Peter Panov and the IKEEN group, released under an open source (BSD) license. It makes it trivial to create tree-style menus. Here, we just indicate the element that needs to be turned into a tree view, and it takes care of it. The most important part of this code segment is the afterClick event, which is assigned an inline function to load an HTML file of the same name as the node that was clicked on, putting the contents into the &#8220;welcome&#8221; tab.</p>
<p>Next in the JavaScript code section is a function called addPanel. This will just add a new tab to our tab panel in the center of the web page, and load it with data from the specified location. Due to browser security restrictions, this can only be a page from the same web domain as the current page you&#8217;re viewing, so when we do load content with this we&#8217;ll load &#8220;loadpage.php&#8221;, which will load the actual content we care about from the remote server for us (after validating that the passed location is allowed). Verification is important to prevent abuse and &#8220;phishing&#8221;.</p>
<p>Last in the page, we define all of the div elements that were attached to the various extJS viewport elements. We also define an unordered list which will become our lefthand navigation menu &#8211; the jQuery TreeView plug-in component will convert these lists into treeview menu items where, as mentioned earlier, each corresponds to an html file. Examining the first, objective.html, we see nothing particularly special except for the link to Wikipedia:<br />
<code>&lt;a href="javascript:void(0);" onclick="javascript:addPanel('loadpage.php?a=http://en.wikipedia.org/wiki/Goal');"&gt;the Wikipedia page for Goal&lt;/a&gt;</code></p>
<p>Here, the OnClick event calls the previously defined addPanel function, passing it through the local loadpage.php script to get past the browser security restraints. Again, ensure that you validate addresses passing through here for security purposes.</p>
<p>This is a simple example, clearly beyond the needs of a resume &#8211; but the techniques described here are very useful for building many different types of dynamic websites. In future posts, we&#8217;ll be digging deeper into the individual capabilities of jQuery and extJS.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.westhost.com/blog/2009/01/13/dynamic-websites-with-jquery-and-extjs/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
