<?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>All Forces&#187; web-development</title>
	<atom:link href="http://allforces.com/tag/web-development/feed/" rel="self" type="application/rss+xml" />
	<link>http://allforces.com</link>
	<description>Design, Music &#038; Mac Geekery</description>
	<lastBuildDate>Mon, 17 May 2010 12:20:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Under Construction Redux</title>
		<link>http://allforces.com/2008/05/09/under-construction-redux/</link>
		<comments>http://allforces.com/2008/05/09/under-construction-redux/#comments</comments>
		<pubDate>Fri, 09 May 2008 21:48:45 +0000</pubDate>
		<dc:creator>Melvin Rivera</dc:creator>
				<category><![CDATA[Web Dev]]></category>
		<category><![CDATA[social-web]]></category>
		<category><![CDATA[web-development]]></category>

		<guid isPermaLink="false">http://allforces.com/?p=358</guid>
		<description><![CDATA[  View my &#8220;Be Right Back&#8221; page Enough of this blank &#8220;Be Right Back&#8221; pages we usually throw together when we need to do website updates. It is time for a nicer, more web 2.0 savvy under construction. Next time I do an update to WordPress, I&#8217;ll be replacing my index.php file with this one, [...]]]></description>
			<content:encoded><![CDATA[<p><span style="color: #0000ee; -webkit-text-decorations-in-effect: underline; text-decoration: underline;"><img class="alignnone size-full wp-image-361" title="Be Right Back Page" src="http://allforces.com/wp-content/uploads/2008/05/brb-450.jpg" alt="Be Right Back Page" width="450" height="512" /></span></p>
<p> </p>
<p><a href="http://allforces.com/index-brb.php" target="_blank">View</a> my &#8220;Be Right Back&#8221; page</p>
<p>Enough of this blank &#8220;Be Right Back&#8221; pages we usually throw together when we need to do website updates. It is time for a nicer, more web 2.0 savvy under construction. Next time I do an update to WordPress, I&#8217;ll be replacing my index.php file with this one, and then switch back when all is ready to go.</p>
<p><strong>Here&#8217;s what I have:</strong></p>
<p>1. Links to my other web sites and web services.</p>
<p>2. Flickr gallery via the flickr.com&#8217;s <a title="link to flickr make a badge" href="http://www.flickr.com/badge.gne">Make a Badge</a> tool</p>
<p>3. Twitter updates via twitter.com&#8217;s <a title="link to twitter badge tool" href="https://twitter.com/badges">Make a Badge</a> tool</p>
<p>4. Last.fm gallery via Jeroen&#8217;s <a title="link to last.fm records script" href="http://dirkie.nu/projects/lastfmrecords/">Last.fm Records</a> standalone version which grabs images from amazon.com. I actually copied the whole script and included it in the PHP file so that it is not dependent in other files. I also disabled album art caching since this page is really going to be up for a few minutes. If you are going to use it for longer, then you should consider enabling caching the images. Consult the original script for more info on this.</p>
<p>To do this yourself:</p>
<p>1. <a href="http://allforces.com/download/index-brb.php.zip">Download</a> my &#8220;Be Right Back&#8221;. Note, PHP 5 is required for the Last.fm portion to work. </p>
<p>2. Open it in a file editor and change the following items:</p>
<ul>
<li>The page title</li>
<li>The site links should point to your of course</li>
<li>The Flickr user number in the Flickr javascript link. It might be best to create your own Flickr badge, grab the javascript and replace this one.</li>
<li>The Twitter username in the javascript url.</li>
<li>The last.fm username in the PHP code, right after $lfm-&gt;username.</li>
<li>The footer info.</li>
</ul>
<div>That&#8217;s all, it would be great if soe of you designer do some other designs and start posting them to share.</div>
<img src="http://allforces.com/?ak_action=api_record_view&id=358&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://allforces.com/2008/05/09/under-construction-redux/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Creating a custom WordPress database error page</title>
		<link>http://allforces.com/2006/06/18/custom-wordpress-errors/</link>
		<comments>http://allforces.com/2006/06/18/custom-wordpress-errors/#comments</comments>
		<pubDate>Mon, 19 Jun 2006 06:31:24 +0000</pubDate>
		<dc:creator>Melvin Rivera</dc:creator>
				<category><![CDATA[Web Dev]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[web-development]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://allforces.com/2006/06/18/creating-a-custom-wordpress-database-error-page/</guid>
		<description><![CDATA[This is a quick tutorial on how to have WordPress show a custom error page when there&#8217;s a database connection error. This tutorial covers WordPress 2.0.1. The database connection error occurs when WordPress tries o connect to the database but does not succeed at it. When you are first installing WordPress, it can mean that [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://allforces.com/wp-content/uploads/2006/06/wp-db.jpg" alt="a better looking databse error in wordpress" title="a better looking databse error in wordpress" /></p>
<p>This is a quick tutorial on how to have WordPress show a custom error page when there&#8217;s a database connection error. This tutorial covers WordPress 2.0.1.</p>
<p><span id="more-156"></span><br />
<a href="http://allforces.com/wp-content/uploads/2006/06/wp-db-error-1.jpg" rel="lightbox[dberror]" title="default wordpress error page"><img src="http://allforces.com/wp-content/uploads/2006/06/wp-db-error-1-t.jpg" alt="default wordpress error page" /></a></p>
<p>The database connection error occurs when WordPress tries o connect to the database but does not succeed at it. When you are first installing WordPress, it can mean that your settings are incorrect. i.e. the username/password are wrong. However, if your WordPress installation is running smoothly but for some reason MySQL goes down on your server then WordPress will show that huge &#8220;WordPress, Error Establishing a Database Connection&#8221; error page that looks nothing like the rest of your site. The error page is great when you are first setting up WordPress but it is not the most ideal for a professional website. It creates confusion for the visitor that might not even know what WordPress is. What&#8217;s worst, the web developer might not even find out for hours.</p>
<p>We&#8217;re going to solve this by doing a very small hack to WordPress that will tell it to show a static page instead of the default WordPress page. And we&#8217;ll also have it send an email to the administrator alerting with the error. Don&#8217;t get scared away by the word hack. Hacking is part of the WordPress culture and even encouraged. And besides, a hack is the only way around this because plugins are detected by settings stored in the database that we can not access to begin with. </p>
<p><strong>STEP 1: Hack WordPress</strong></p>
<p>Note: If you are running WordPress 2.0.1 you can download the hacked file <a href="http://allforces.com/download/wp-db.zip">here</a> and just replace original &#8216;/wp-includes/wp-db.php&#8217; and skip to step 2.</p>
<p><a href="http://allforces.com/wp-content/uploads/2006/06/Picture%203-2.jpg" rel="lightbox[dberror]" title="wordpress hack"><img src="http://allforces.com/wp-content/uploads/2006/06/Picture%203-2-t.jpg" alt="wordpress hack" /></a></p>
<p>Open &#8216;wp-includes/wp-db.php&#8217; in a code editor. If you don&#8217;t have one, you can try the free <a href="http://www.barebones.com/">Text Wrangler</a> or my favorite, <a href="http://www.skti.org/skEdit.php">SKEdit</a>. This file is the one that handles the database connections that WordPress makes. We&#8217;ll look at the last function around line 305. This function is called bail and it is called when a database connection error is found. It does what it&#8217;s name implies, it bails out and displays an error. Now, the error it shows follows up but before it gets to that point, we&#8217;ll have it show a custom page we created and have it email us the error found. Enter the code bellow as pictured above. </p>
<p><code>/* custom error page hack<br />
shows a custom error page and emails error instead of<br />
showing the default wordpress database error page	*/</p>
<p>	include('wp-content/themes/themename/dbase-error.php');<br />
	$error = ( !$this->show_errors ) ? '' : $this->show_errors ;<br />
	mail('webmaster@domain.com', 'WordPress Error', $error);<br />
	die;</p>
<p>	/* end custom error page hack */</code></p>
<p>The code Explained</p>
<p><code>include('wp-content/themes/themename/dbase-error.php');</code><br />
This tells it to include the page dbase-error.php located in your theme folder. Replace the themename with the folder name of your theme. </p>
<p><code>$error = ( !$this->show_errors ) ? '' : $this->show_errors ;<br />
mail('webmaster@domain.com', 'WordPress Error', $error);</code><br />
This emails the webmaster with the actual database error if there is one. Replace webmaster@domain.com with the email address of the webmaster.</p>
<p><code>die;</code><br />
This tells the script to end and not execute anything further, like the default error it  normally outputs.</p>
<p><strong>STEP 2: Create the error page.</strong></p>
<p>Create a custom error page that contains no WordPress code, name it &#8216;dbase-error.php&#8217; and save it in your theme folder. </p>
<p>The whole point of this tutorial is for you to have an error page that looks like the rest of your site. But that really depends on what theme you use. In this example I started by duplicating &#8216;index.php&#8217; from my theme folder and naming it &#8216;dbase-error.php&#8217;. Then I replaced the header, sidebar and footer code with the actual code found in the header, sidebar and footer. To do this, first open &#8216;header.php&#8217; in a text editor, copy all it&#8217;s content and paste in &#8216;dase-error.php&#8217; replacing < ?php get_header(); ?>. Do the same for the sidebar and footer.</p>
<p>Now proceed to remove all WordPress code since WordPress does not have access to your database it doesn&#8217;t know the website name or what theme to use. To help you out, I&#8217;ve included a custom error page for the default WordPress template. You can download it <a href="http://allforces.com/download/dbase-error.zip">here</a> and just change a few things like the website name and description. Pictured below is the one I used on the <a href="http://mosaic.org">Mosaic</a> site.</p>
<p><a href="http://allforces.com/wp-content/uploads/2006/06/new-wp-db-error.jpg" rel="lightbox[dberror]" title="new custom error page"><img src="http://allforces.com/wp-content/uploads/2006/06/new-wp-db-error-t.jpg" alt="new custom error page" /></a></p>
<p><strong>STEP 3: TEST</strong></p>
<p>To test this, there&#8217;s no other way than to put your site down temporarily. First upload the new wp-db.php file then the new custom error page. Now, edit &#8216;wp-config.php&#8217; so that it has the wrong database name and upload the file. Once you upload the edited config file, check your site through your browser. You should now see your new error page and receive a new email shortly alerting you there was a database error. Your can re-edit the config file and re-upload to bring your site back up.</p>
<p><strong>CONCLUSION</strong></p>
<p>Hopefully WordPress will create an easier way to do this, perhaps by including a new setting in the settings file. But for now, hacking it is our best choice. But do remember, when you upgrade WordPress for the next version you will need to reapply the hack. </p>
<p><strong>FILES USED:</strong></p>
<p><a href="http://allforces.com/download/wp-db.zip">WordPress Hack</a><br />
<a href="http://allforces.com/download/dbase-error.zip">Custom Error</a></p>
<img src="http://allforces.com/?ak_action=api_record_view&id=156&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://allforces.com/2006/06/18/custom-wordpress-errors/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>skEdit 3.6 Released</title>
		<link>http://allforces.com/2006/02/19/skedit/</link>
		<comments>http://allforces.com/2006/02/19/skedit/#comments</comments>
		<pubDate>Sun, 19 Feb 2006 19:08:02 +0000</pubDate>
		<dc:creator>Melvin Rivera</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[skedit]]></category>
		<category><![CDATA[web-development]]></category>

		<guid isPermaLink="false">http://allforces.com/2006/02/19/skedit-36-released/</guid>
		<description><![CDATA[Let&#8217;s face it, Mac applications are cool. Even when the task is as geeky as editing html files by hand, we do it with style. There are many apps out there that do this job on the Mac, and I will probably be in the eternal hunt for the perfect one, but for now skEdit [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://allforces.com/wp-content/uploads/2006/02/skedit.jpg" alt="skEdit 3.6" title="skEdit 3.6" /></p>
<p>Let&#8217;s face it, Mac applications are cool. Even when the task is as geeky as editing html files by hand, we do it with style. There are many apps out there that do this job on the Mac, and I will probably be in the eternal hunt for the perfect one, but for now <strong>skEdit</strong> is probably the closest I&#8217;ve gotten to it. I must admit, I do end up launching <strong>TextWarngler</strong> for the occasional trip to edit hidden files or to edit actionscript files but for the most part I use skEdit for all my PHP/HTML/CSS editing.<br />
<span id="more-101"></span><br />
I&#8217;ve been enjoying beta testing the new version for a whie and I&#8217;m happy to share that it is finally out and it&#8217;s a sweet update. Some of my personal favorite features include code completion, hinting and highlighting (extremely useful for css), html tidy integration, snippets (on steroids), code navigation(customizable through regular expression), user scripts, integrated ftp/sftp/webdav and site view. And let&#8217;s not forget the option to edit using Lucida Grande instead of Courier. Fixed width fonts, although practical for editing, cramp my style.</p>
<p>skEdit is the brain child of <a href="http://www.skti.org/journal.php">Sean Kelly</a>, a computer science student who was lucky enough to intern at Apple last summer. So go give skEdit a try and give Sean some love.</p>
<p><img src="http://allforces.com/wp-content/uploads/2006/02/_images_screens_mini_siteview.jpg" alt="site view" title="site view" /><img src="http://allforces.com/wp-content/uploads/2006/02/_images_screens_mini_remotefiles.png" alt="integrated ftp" title="integrated ftp" /><img src="http://allforces.com/wp-content/uploads/2006/02/_images_screens_small_search.jpg" alt="search" title="search" /><br />
<img src="http://allforces.com/wp-content/uploads/2006/02/_images_screens_mini_tidy.png" alt="html tidy integration" title="html tidy integration" /><img src="http://allforces.com/wp-content/uploads/2006/02/_images_screens_small_editprefs.jpg" alt="preferences" title="preferences" /><img src="http://allforces.com/wp-content/uploads/2006/02/_images_screens_small_new.jpg" alt="new document helper" title="new document helper" /><br />
<img src="http://allforces.com/wp-content/uploads/2006/02/_images_screens_small_preview.jpg" alt="browser preview" title="browser preview" /><img src="http://allforces.com/wp-content/uploads/2006/02/_images_screens_small_sitemanager.jpg" alt="site manager" title="site manager" /><img src="http://allforces.com/wp-content/uploads/2006/02/_images_screens_small_userscripts.jpg" alt="user scripts" title="user scripts" /><br />
<img src="http://allforces.com/wp-content/uploads/2006/02/_images_screens_mini_codenav.png" alt="code navigation" title="code navigation" /><img src="http://allforces.com/wp-content/uploads/2006/02/_images_screens_mini_snippets.png" alt="code snippets" title="code snippets" /><img src="http://allforces.com/wp-content/uploads/2006/02/_images_screens_small_syntaxhighlighting.jpg" alt="syntax highlighting" title="syntax highlighting" /></p>
<p>Link: <a href="http://skti.org/">skti.org</a></p>
<img src="http://allforces.com/?ak_action=api_record_view&id=101&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://allforces.com/2006/02/19/skedit/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>WordPress on Mac Part 3: Installing WordPress</title>
		<link>http://allforces.com/2005/08/25/wordpress-on-mac-install/</link>
		<comments>http://allforces.com/2005/08/25/wordpress-on-mac-install/#comments</comments>
		<pubDate>Thu, 25 Aug 2005 22:28:24 +0000</pubDate>
		<dc:creator>Melvin Rivera</dc:creator>
				<category><![CDATA[Web Dev]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[web-development]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://allforces.com/?p=51</guid>
		<description><![CDATA[This guide will help you run WordPress(the blog app that runs this website) in your own personal Mac for testing purposes or for backing up your blog. On WordPress on Mac &#8211; Part 1: PHP &#038; Mysql we covered installing PHP and MySQL. On WordPress on Mac Part 2: Sub-Domains we covered setting up local [...]]]></description>
			<content:encoded><![CDATA[<p>This guide will help you run WordPress(the blog app that runs this website) in your own personal Mac for testing purposes or for backing up your blog. On <a href="/2005/08/22/wordpress-on-mac-phpandmysql/">WordPress on Mac &#8211; Part 1: PHP &#038; Mysql</a>  we covered installing PHP and MySQL. On <a href="/2005/08/23/wordpress-on-mac-subdomains/" title="link to step 2">WordPress on Mac Part 2: Sub-Domains</a> we covered setting up local sub-domains. On Step 3 we&#8217;ll cover how to install WordPress.</p>
<p><img src="http://allforces.com/wp-content/uploads/2005/08/22/wplocal-defaultblog-1.jpg" alt="Installing WordPress" title="Installing WordPress" class="" /></p>
<p>The steps we&#8217;ll take:</p>
<p>Step 1: Download and Install CocoaMySQL<br />
Step 2: Create Database<br />
Step 3: Download WordPress<br />
Step 4: Install WordPress<br />
Step 5: Permalinks<br />
<span id="more-51"></span><br />
<strong>Step 1: Download and Install CocoaMySQL</strong></p>
<p>WordPress will create the necessary database tables but we do need to create a database for it to do this. We&#8217;ll do this with CocoaMySQL, a cocoa application for editing the MySQL database content.</p>
<p>Download CocoaMySQL<br />
Go to <a href="http://cocoamysql.sourceforge.net/download.php" title="link to cocoamysql">CocoaMySQL&#8217;s website</a> and choose the latest binary file for download. On the next page, choose the file icon to download the file from the closest server.</p>
<p><img src="http://allforces.com/wp-content/uploads/2005/08/22/wplocal-cocoasite.jpg" alt="CocoaMySQL website" title="CocoaMySQL website" class="noborder" /> <img src="/wp-content/files/grub/wplocal-cocoaserver.jpg" alt="CocoaMySQL Server Downloads" title="CocoaMySQL Server Downloads" class="noborder" /></p>
<p>Once downloaded, double click the disk image file if it hasn&#8217;t mounted yet. From the mounted disc, drag the CocoaMySQL application icon to your Applications folder, unmount the disk icon from the sidebar and delete the disk image you downloaded.</p>
<p><img src="http://allforces.com/wp-content/uploads/2005/08/22/wplocal-cocoadisk.jpg" alt="CocoaMySQL Mounted Disk" title="CocoaMySQL Mounted Disk" class="" /></p>
<p><strong>Step 2: Create Database</strong></p>
<p>From the Application&#8217;s folder in the Finder, double-click CocoaMySQL to launch it.</p>
<p><img src="http://allforces.com/wp-content/uploads/2005/08/22/wplocal-cocoaicon.jpg" alt="CocoaMySQL Application Icon" title="CocoaMySQL Application Icon" class="" /></p>
<p>The firs this you&#8217;ll see once you launch CocoaMySQL is the connection window. To connect to your local MySQL database use the following settings.</p>
<p><img src="http://allforces.com/wp-content/uploads/2005/08/22/wplocal-cocoaconnect.jpg" alt="CocoaMySQL Coonection" title="CocoaMySQL Coonection" class="" /></p>
<blockquote><p>host: localhost<br />
user: root<br />
password: blank (unless you password protected it)</p></blockquote>
<p>CocoaMySQL is a very cool app but for now, all we need to do is create a database. From the Databases area, clik on the &#8220;Add database&#8221; on the right. From the pop up window, write the name you would like for your database. I&#8217;m using wordpress for this example but I usually use the name of my project if the database will hold all things regarding a project, not just wordpress. Once you add the new database, quit the CocoaMySQL.</p>
<p><img src="http://allforces.com/wp-content/uploads/2005/08/22/wplocal-cocoabutton-2.jpg" alt="CocoaMySQL Add Database Button" title="CocoaMySQL Add Database Button" class="" /> <img src="http://allforces.com/wp-content/uploads/2005/08/22/wplocal-cocoadbname.jpg" alt="CocoaMySQL Database Name" title="CocoaMySQL Database Name" class="" /></p>
<p><strong>Step 3: Download WordPress</strong></p>
<p>Point your browser to the <a href="http://wordpress.org/download/" title="link to wordpress">WordPress website</a> and download the latest version of WordPress (1.5.2 at the moment).</p>
<p><img src="http://allforces.com/wp-content/uploads/2005/08/22/wplocal-wpsite.jpg" alt="WordPress website" title="WordPress website" class="" /></p>
<p>Move the contents of the WordPress folder to the location you specified in the sub-domain. Check out <a href="http://allforces.com/2005/08/23/wordpress-on-mac-subdomains/" title="link to step two of this guide">WordPress on Mac Part 2: Sub-Domains</a> if you haven&#8217;t read it yet. In our example, we created a sub-domain called http://wordpress.localhost and linked it to the folder &#8220;/Users/myusername/Sites/Projects/wordpress&#8221;. So all the wordpress files go in that folder.</p>
<p><img src="http://allforces.com/wp-content/uploads/2005/08/22/wplocal-wpfolder.jpg" alt="WordPress Location" title="WordPress Location" class="" /></p>
<p><strong>Step 4: Install WordPress</strong></p>
<p>First, we&#8217;ll need a proper configuration file. In the WordPress folder, find the file &#8220;wp-config-sample.php&#8221; and rename it to &#8220;wp-config.php&#8221; and open it for editing. You can edit this file in TextWrangler or any other text editing app. The part we&#8217;re concered about is the MySQL settings area. In there enter the database name, database username, password and host like the example bellow.</p>
<blockquote><p>// ** MySQL settings ** //<br />
define(&#8216;DB_NAME&#8217;, &#8216;wordpress&#8217;);     // The name of the database<br />
define(&#8216;DB_USER&#8217;, &#8216;root&#8217;);     // Your MySQL username<br />
define(&#8216;DB_PASSWORD&#8217;, &#8221;); // &#8230;and password ( if you protected mysql )<br />
define(&#8216;DB_HOST&#8217;, &#8216;localhost&#8217;);     // 99% chance you won&#8217;t need to change this value</p></blockquote>
<p><img src="http://allforces.com/wp-content/uploads/2005/08/22/wplocal-config.jpg" alt="WordPress Configuration File" title="WordPress Configuration File" class="" /></p>
<p>Now, point you browser to your sub-domain. In my example it&#8217;s &#8220;http://wordpress.local&#8221;. The browser will give you the following statement:</p>
<blockquote><p>It doesn&#8217;t look like you&#8217;ve installed WP yet. Try running <span style="color:#0080ff;text-decoration:underline;">install.php</span><span style="color:#0080ff;">.</span></p></blockquote>
<p>Click on the install.php link to begin the installation of the WordPress database.</p>
<p><img src="http://allforces.com/wp-content/uploads/2005/08/22/wolocal-firststep.jpg" alt="WordPress Installation: First Step" title="WordPress Installation: First Step" class="" /></p>
<p>Enter the title of your Blog an the admin&#8217;s email address. This can all be changed later.</p>
<p><img src="http://allforces.com/wp-content/uploads/2005/08/22/wplocal-title.jpg" alt="WordPress Enter Title" title="WordPress Enter Title" class="" /></p>
<p>This screen tell you weather the installation of the database was successful or not. If it was successful it will give you the username and password for the admin. These can be changed once you log in as well.</p>
<p><img src="http://allforces.com/wp-content/uploads/2005/08/22/wolocal-success.jpg" alt="WordPress Install Success" title="WordPress Install Success" class="" /></p>
<p>Click on the Login link to go to the admin login window.</p>
<p><img src="http://allforces.com/wp-content/uploads/2005/08/22/wplocal-login.jpg" alt="WordPress Login Window" title="WordPress Login Window" class="" /></p>
<p>That&#8217;s it. WordPress is installed! Click on the &#8220;Back to Blog&#8221; link to view your blog.</p>
<p><img src="http://allforces.com/wp-content/uploads/2005/08/22/wplocal-defaultblog.jpg" alt="WordPress Default Installation" title="WordPress Default Installation" class="" /></p>
<p>Your blog address is the sub-domain you selected. In our example it&#8217;s &#8220;http://wordpress.localhost&#8221;. To go to the WordPress admin area, add wp-admin to the URL &#8220;http://wordpress.localhost/wp-admin&#8221;.</p>
<p>On the next installment, we&#8217;ll cover configuring WordPress. Until then, happy blogging.</p>
<img src="http://allforces.com/?ak_action=api_record_view&id=51&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://allforces.com/2005/08/25/wordpress-on-mac-install/feed/</wfw:commentRss>
		<slash:comments>34</slash:comments>
		</item>
		<item>
		<title>WordPress on Mac Part 2: Sub-Domains</title>
		<link>http://allforces.com/2005/08/23/wordpress-on-mac-subdomains/</link>
		<comments>http://allforces.com/2005/08/23/wordpress-on-mac-subdomains/#comments</comments>
		<pubDate>Tue, 23 Aug 2005 16:02:33 +0000</pubDate>
		<dc:creator>Melvin Rivera</dc:creator>
				<category><![CDATA[Web Dev]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[web-development]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://allforces.com/?p=50</guid>
		<description><![CDATA[This guide will help you run WordPress(the blog app that runs this website) in your own personal Mac for testing purposes or for backing up your blog. On WordPress on Mac &#8211; Part 1: PHP &#038; Mysql we covered installing PHP and MySQL. On part two we&#8217;ll cover setting up local sub-domains. What is a [...]]]></description>
			<content:encoded><![CDATA[<p>This guide will help you run WordPress(the blog app that runs this website) in your own personal Mac for testing purposes or for backing up your blog. On <a href="/2005/08/22/wordpress-on-mac-phpandmysql/" title="link to part one">WordPress on Mac &#8211; Part 1: PHP &#038; Mysql</a>  we covered installing PHP and MySQL. On part two we&#8217;ll cover setting up local sub-domains. What is a sub-domain and why do I need one? Sub-domains are websites with absolute URLs that are accessed via a prefix to the url i.e.the server mail.earthlink.net is a sub-domain of earthlink.net. Why do I want to do this locally? Because it will make it possible to mimic your website structure locally. In other words, it&#8217;s all about file paths. If you set it up your images and link will work, if not, you&#8217;ll have broken links and images.</p>
<p><img src="http://allforces.com/wp-content/uploads/2005/08/22/wplocal-wpsubdomain.jpg" alt="WordPress on sub-domain" title="WordPress on sub-domain" class="" /></p>
<p><span id="more-50"></span><br />
<strong>Step 1: Setting up Apache</strong></p>
<p>Apache comes as part of Mac OS X and it can be easily activated by the click of a button. However there are a few tweaks we need to do to Apache before we can use it for WordPress. To modify the Apache settings we need to edit some configuration files that are in some hidden folders. Now here a nerd will tell you to open the command line and edit the files in some DOS looking environment. But since we&#8217;re not nerds here, just cool geeks, we&#8217;ll use the free text editing application Text Wrangler which allows you to edit hidden text files and takes care of file permissions when saving.</p>
<p>Download <a href="http://www.barebones.com/products/textwrangler/" title="link to bare bones site">Text Wrangler</a>.</p>
<p><img src="http://allforces.com/wp-content/uploads/2005/08/22/wplocal-text-wrangler.jpg" alt="Text Wrangler" title="Text Wrangler" /></p>
<p><strong>User Apache file</strong></p>
<p>First we&#8217;ll edit your apache user file so that we can use ModRewrite in WordPress. ModRewrite is what translates search friendly URLS to the true url. From Text Wrangler, select &#8220;File > Open Hidden&#8230;&#8221; , make sure you enable &#8220;All Files&#8221; and navigate to the folder &#8220;etc/httpd/users/&#8221; then open the file of the current logged in user. In my case it&#8217;s &#8220;melvin.conf&#8221;.</p>
<p><img src="http://allforces.com/wp-content/uploads/2005/08/22/wplocal-open-hidden.jpg" alt="Open Hidden File" title="Open Hidden File" /></p>
<p><img src="http://allforces.com/wp-content/uploads/2005/08/22/wplocal-open-user.jpg" alt="Open Apache User File" title="Open Apache User File" /></p>
<p><img src="http://allforces.com/wp-content/uploads/2005/08/22/wplocal-user.jpg" alt="Apache User File" title="Apache User File" /></p>
<p>Comment out these lines within the directory lines by adding the # symbol at the beginning of the lines:</p>
<blockquote><p>#Options Indexes MultiViews<br />
#AllowOverride None</p></blockquote>
<p>Then Add the following lines</p>
<blockquote><p>AllowOverride All<br />
Options Indexes MultiViews ExecCGI FollowSymLinks Includes<br />
Order allow,deny<br />
Allow from all</p></blockquote>
<p>Close the file.</p>
<p><strong>Mod-Rewrite Log</strong></p>
<p>Now we&#8217;ll specify where to log any errors for Mod Rewrite. From Text Wrangler, select &#8220;File > Open Hidden&#8230;&#8221;  and navigate to &#8220;etc/httpd/httpd.conf&#8221;. Go to the end of the file and add the following code:</p>
<p><img src="http://allforces.com/wp-content/uploads/2005/08/22/wplocal-open-httpd.jpg" alt="Open Apache Config File" title="Open Apache Config File" class="" /></p>
<p><img src="http://allforces.com/wp-content/uploads/2005/08/22/wplocal-rewrite.jpg" alt="Rewrite Log" title="Rewrite Log"  /></p>
<blockquote><p># begin custom edit<br />
# mod_rewrite<br />
RewriteLog /var/log/httpd/rewrite.log<br />
RewriteLogLevel 9<br />
#end custom edit</p></blockquote>
<p>Keep the file open for the next step.</p>
<p><strong>Local Sub-Domains</strong></p>
<p>Next we&#8217;re going to set up a local sub-domain. This will allow our site URl to be &#8220;http://blog.localhost&#8221; instead of &#8220;http://localhost/~username/blog&#8221;. A local sub-domain will allows us to set up our local blog in the same way we would if we had it hosted at a public server. For example we use absolute URLs like &#8216;/images/header.jpg&#8217; and that code will work on both local or public servers. It also makes for a very short and manageable URLs.</p>
<p>From Text Wrangler, add the following code after the Rewrite segment we just added but before the &#8220;#end custom edit&#8221; line.</p>
<p><img src="http://allforces.com/wp-content/uploads/2005/08/22/wplocal-virtualhosts-1.jpg" alt="Virtual Hosts" title="Virtual Hosts" /></p>
<blockquote><p># virtual hosts<br />
NameVirtualHost 127.0.0.1</p>
<p># localhost<br />
<virtualhost 127.0.0.1><br />
ServerName localhost<br />
DocumentRoot /Users/<span style="color:#007f00;">melvin</span>/Sites/<br />
</virtualhost></p>
<p># <span style="color:#ff0000;">wordpress</span>.localhost<br />
<virtualhost 127.0.0.1><br />
ServerName <span style="color:#ff0000;">wordpress.localhost</span><br />
DocumentRoot /Users/<span style="color:#007f00;">melvin</span>/Sites/<span style="color:#4077e6;">Projects/wordpress</span><br />
</virtualhost></p></blockquote>
<p><span style="color:#ff0000;"># change the sub-domain name to your desired sub-domain name</span><br />
<span style="color:#007f00;"># change to the name of your home folder</span><br />
<span style="color:#4077e6;"># change to the path of your project folder from the Sites folder</span></p>
<p>The first part will link &#8220;localhost&#8221; to your personal &#8220;SItes&#8221; folder. The second part is to specify the sub-domain. In this case I want the sub-domain &#8220;http://wordpress.localhost/&#8221; to test a custom version of wordpress, however you can rename this to whatever you want. Replace the path of DocumentRoot to the path to your site. In my case I put all my projects in a folder called Projects in the Sites folder in my home folder. For this example I am using the folder name wordpress but you can rename it according to your project name. Repeat this second block for each sub-domain needed.</p>
<p>Close the file.</p>
<p><strong>Hosts File</strong></p>
<p>Next we&#8217;ll add the sub-domains to the list of hosts. From Text Wrangler, select &#8220;File > Open Hidden&#8230;&#8221;  and navigate to &#8220;etc/hosts&#8221;. Add the following line to the list. Make sure you specify the same sub-domain you did in the previews step:</p>
<p><img src="http://allforces.com/wp-content/uploads/2005/08/22/wplocal-hosts-file.jpg" alt="Open Hosts File" title="Open Hosts File" /></p>
<p><img src="http://allforces.com/wp-content/uploads/2005/08/22/wplocal-add-hosts.jpg" alt="Add Hosts" title="Add Hosts" /></p>
<blockquote><p>127.0.0.1 wordpress.localhost</p></blockquote>
<p><strong>Restart the Apache Server</strong></p>
<p>From the Finder select &#8216;Apple > System Preferences > Sharing > Services&#8217; and Start &#8216;Personal Web Sharing&#8217;. Quit System Preferences.</p>
<p><img src="http://allforces.com/wp-content/uploads/2005/08/22/wplocal-websharing-1.jpg" alt="Restart Apache" title="Restart Apache" /></p>
<p>Now point your browser to http://wordpress.localhost or whatever sub-domain name you chose.</p>
<p><img src="http://allforces.com/wp-content/uploads/2005/08/22/wplocal-notfound.jpg" alt="Not Found Error" title="Not Found Error" /></p>
<p>If you don&#8217;t have anything in the folder you specified in the previews step you will get this 404 Not Found Error. This means it&#8217;s working. You can move any html files to that folder for testing. Or as we&#8217;ll do in the next Step of this tutorial, download WordPress and place the files on that folder.</p>
<img src="http://allforces.com/?ak_action=api_record_view&id=50&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://allforces.com/2005/08/23/wordpress-on-mac-subdomains/feed/</wfw:commentRss>
		<slash:comments>47</slash:comments>
		</item>
	</channel>
</rss>
