JavaScript appears to be disabled. We recommend you enable JavaScript while visiting this site.

(All original content on this site is licensed under the Creative Commons License Attribution-Noncommercial-No Derivative Works 3.0.)

Setting up WordPress on a local Web server

Note: This guide should work equally well for WordPress 2.0.2 and above. For a guide on upgrading this 2.0.1 install, see Upgrading (our local install of) WordPress.

In our previous tutorials, we setup an Apache-based Web server, on a Windows XP home computer. The Web server is also running PHP and MySQL, as well as ColdFusion MX. This time, we'll be installing WordPress onto our local Web server. This installation will require us to work with both PHP and MySQL, and we'll be able to setup any number of WordPresses after we have completed this one.

Downloading WordPress

First, we'll need to download the latest version of WordPress, from http://wordpress.org/download/. As of this writing, that version is 2.0.1.

Once we've downloaded WordPress, we can extract the zip file into the same folder that we downloaded the zip to (in my case, c:\home\downloads\). Now move the wordpress folder from within this folder, to c:\home\. Once you've done this, the path to the license.txt should be something like c:\home\wordpress\.

Configuring localhost

Now that we've extracted the WordPress installation, we'll want to point a quick URL to this folder. We'll use http://wordpress.localhost/ to do this.

First, open the httpd.conf file using your shortcut, or the Start menu. At the bottom of this file, we'll need to add a new VirtualDirectory for wordpress.localhost. My addition looked like the below.

<VirtualHost 127.0.0.5>
ServerName wordpress.localhost
DocumentRoot c:\home\wordpress
ErrorLog logs/wordpress-error.log
TransferLog logs/wordpress-access.log
</VirtualHost>

Now, save this file and close it.

Next, open the hosts file, using a shortcut, or by scrolling to it. At the end of this file, add a new entry for the VirtualDirectory we just created.

127.0.0.5 wordpress.localhost

Again, save this file and close it.

Finally, we'll need to restart Apache in order for our change to take effect, using the Services control panel.

Configuring MySQL: Creating the WordPress user and database

Now that WordPress is extracted, and we've setup http://wordpress.localhost/, we'll need to create a MySQL user account and database for WordPress to use. First, start up MySQL Administrator. Type in the root password, and click on User Administration. Press the New User button. Fill in the MySQL User and Password fields, and Apply changes. The user name I used was simply wordpress. Right click on this new user name, select Add Host From Which This User Can Connect, and type localhost in the window. Press OK.

Next, click on the Catalogs item, right click on an empty area in the Schemata area, and select Create New Schema. For the Schema name, I once again simply used wordpress.

Now that we've setup a database, we'll need to associate the wordpress item with it. Click on User Administration, then on wordpress, then on localhost beneath it. Next, click on the wordpress Schemata, and move all available privileges to assigned privileges. Select Apply Changes.

Note that we could have done this in a different order if we would have liked. Namely, we could have first setup our database/catalog, and then created our user.

Now that we've created our user, we'll have to do the work-around to get the password correct. Open the Command Prompt and type the following.

mysql -u root -p

Press enter, and type in the root password. Finally, we'll change the password for wordpress for all hosts.

UPDATE mysql.user SET Password = OLD_PASSWORD('your_password') WHERE User = 'wordpress';
FLUSH PRIVILEGES;

Remember to substitute your_password with the password you would like to use. Once you've done this, log on to phpMyAdmin to verify that the password works as expected, and you can view the wordpress database. http://phpmyadmin.localhost/.

Setting up the WordPress configuration file

Now that we've created our MySQL user and database, we'll need to setup a configuration file for WordPress. Navigate to c:\home\wordpress\, and copy the wp-config-sample.php file. Now, rename our copy to wp-config.php. Finally, open this file in Notepad.

If you look at the top of this file, you'll notice four fields that start with "define". We'll need to add the relevant information into the first three fields. First, verify that the DB_NAME is what you just setup in MySQL Administrator. The default is wordpress, which is what I setup above. Change DB_USER appropriately – in my case, wordpress is again used. Finally, change DB_PASSWORD to your password. Yes, we are entering this information into a text file. However, visitors won't be able to see this information, so long as you keep this file a PHP file.

Save the wp-config.php file, and close it, once you have made these changes.

Installing WordPress

That we've created the wp-config.php file, we can visit http://wordpress.localhost/ to get a link to actually install WordPress. Otherwise, you can visit the installation file directly, at http://wordpress.localhost/wp-admin/install.php.

On the installation page, click the First Step link. Now, enter a Weblog title, and your email address. I used wordpress and my email, accordingly. Click to the next step.

Now, it will give you a username, admin, and a password, which should be random. Make a note of both of these, and do what it suggests – log in. http://wordpress.localhost/wp-login.php

Now that you've logged in, there's two things to do. The first is to setup your profile and change you password (the second bullet), and the second thing is to write a test post.

Once you do so, you'll have two posts on your site, one from the installation, and one from the user you just setup. To view you post, visit http://wordpress.localhost/.

Congratulations – you've successfully setup WordPress. Now, you can remove the installation's post and comment, and begin working on creating a unique style.

At this point, I should also point out the boon of creating a local WordPress. Backing up your WordPress is one of the best things that you can do. If you setup a WordPress, using the same username/password as the one you actually use on the Web, with the same database information (if you know that), you can backup your WordPress, and be able to work with your actual content when you work on style revisions. Killing two birds with one stone is always enjoyable.

In a later guide, we'll walk through backing up your WordPress installation, and when a new version of Wordpress is released, we'll walk through upgrading our installation. Until then, have fun playing around with WordPress.

View all of the steps to creating a local Web server, for development.

Tags: , ,

Categories: tutorials/guides

(All original content on this site is licensed under the Creative Commons License Attribution-Noncommercial-No Derivative Works 3.0.)

Installing ColdFusion on a local Windows-based, Apache, server

Note: For information on installing, or upgrading to ColdFusion MX 7.0.1, see Installing ColdFusion MX 7.0.1 on a local Windows-based, Apache, server.

In this tutorial, we'll be working through an installation of ColdFusion MX 6.1, Developer's Edition, on a local, Windows-based, Apache server. On this server, we've setup Apache, PHP, and MySQL, but will also want to have the ability to work with ColdFusion code (however, not necessarily on the same sites that we'll be using PHP). We'll be doing this to experience a more corporate Web-programming language – corporate primarily because of the costs associated with ColdFusion.

From the marketing, we see that "the [ColdFusion MX 6.1] Developer Edition, [is] a fully functional server for local development purposes only that helps you learn ColdFusion MX 6.1 or deploy to third-party hosting providers. Access is limited to localhost and one remote IP address.".

We can download the Developer's Edition directly from Macromedia/Adobe - http://www.macromedia.com/software/coldfusionmx61/. However, you should know that the size of the download is over 150 MB. Also, as the above blurb notes, you most certainly cannot use the Developer's Edition on anything but a development machine. However, the code we write will work in a production environment.

Also note that you could download and install the current 7.x version of ColdFusion (again, Developer Edition) instead of ColdFusion 6.1. I'll be installing 6.1 simply because I'd like to work in the older environment for purposes of getting help, and helping others. Also, ColdFusion 7 is said, by Macromedia/Adobe, to be an easy upgrade. So, if 7 becomes the one we want to develop for, we can always make the switch.

Installing ColdFusion MX 6.1 Developer Edition

Once you've downloaded the beast of an installation file, you'll need to install it to use the installed and running Apache Web server. Once you launch the installer, you'll be able to choose a language (English in my case). Read the introduction, and read and agree to the license agreement.

On the next screen, Configure Installer, it will prompt you for a serial number, or will allow you to run the Developer Edition. On the next screen, we'll select Server configuration, followed by a screen asking us where to install ColdFusion MX. Leave this at the default directory of C:\CFusionMX.

Now, we'll have to select a Web server. We'll be configuring ColdFusion to use Apache here, so select Add. Select Apache, if it isn't already selected. In the Configuration Directory field, you'll want the conf folder in the Apache folder, which is probably something like C:\Program Files\Apache Group\Apache\conf. In the third field, Directory and file name of server binary, you'll need to tell CF where to find the Apache.exe, which is probably at C:\Program Files\Apache Group\Apache\Apache.exe (if you are using Apache 1.3.x). Click Ok now that the three fields are filled out, followed by a Next.

Now, we'll have to select the web root location for ColdFusion MX Administrator. This is used by ColdFusion to, interestingly enough, administer ColdFusion. We'll change this directory to our C:\home folder (which is what you've set the DocumentRoot value to, if you've been following along).

If you set DocumentRoot to something else, you'll want to make sure that you use that directory here as well.

If you're not sure what you're using for your directory, go to the Apache install directory and open the conf\httpd.conf file. For example, C:\Program Files\Apache Group\Apache\conf\httpd.conf. Next, do a search for DocumentRoot.

While you're here, you can also verify that this same directory is referred to a couple of lines down, which is "<Directory "c:/home">", where 'c:/home' is your DocumentRoot directory.

Thanks to Mike Bryce for pointing this out.

Finally, you'll be able to review the installation. Note that ColdFusion MX is going to take over 500 MB of space on your hard drive. This is, by far, the most demanding installation on our local Web server. Click Install to begin the installation.

Around two hours later (or actually in less than five minutes), ColdFusion MX 6.1 will be up and running. You'll probably notice a hit to the memory, because ColdFusion is quite the memory hog. We'll discuss this before we close this post.

Once you see the Installation Complete message, you'll be given the ColdFusion MX Administrator location. If you try to get to it now, however, you may be asked if you want to download the CFM file. Whoops – not a good thing. What we'll need to do is configure Apache to recognize CFM files.

Configure Apache for ColdFusion

Hopefully, you should be able to just restart Apache via the Services panel, and then visit http://localhost/CFIDE/administrator/index.cfm one more time. If you don't see the Configuration and Settings Migration Wizard, then you'll need to open the httpd.conf file (using either the Start menu or a shortcut you may have created), and do a search for mod_jrun. Verify that the line that contains this text, and "LoadModule", is not commented out with a # as the first character. If it is, remove the pound sign, save the file, and restart Apache. Hit http://localhost/CFIDE/administrator/index.cfm once again.

You can now do a search for DirectoryIndex, to verify that index.cfm has been added as a directory index. While you're here, you may also want to move it's placement up to after index.php, or even before if you'd like.

Configure ColdFusion

Now, visit http://localhost/CFIDE/administrator/index.cfm, and log in. You'll now be configuring ColdFusion settings. First, you'll have the option to disable RDS, which means absolutely nothing to me. An article on sitepoint, http://www.sitepoint.com/article/install-coldfusion-mx-windows/3, says that there's little harm on allowing this on a development server. For the widest experience, we'll leave this as is, and use the same password we just created, for simplicity's sake.

ColdFusion will then install ODBC Services, followed by asking you if you'd like to install example applications. Since this may be helpful, we'll go ahead and do so. These are installed in C:\home\cfdocs\exampleapps\. And with that, setup is complete. Press OK to load the ColdFusion Administrator (http://localhost/CFIDE/administrator/index.cfm).

At this point, if you've been doing so, you may want to make a backup copy of the httpd.conf file (in C:\Program Files\Apache Group\Apache\conf\). However, this is your call.

Now that we've installed ColdFusion, we can go about creating sites were we'll be developing with CF files. Remember that to do this you may want to add VirtualDirectory items into your httpd.conf file, and new IP mappings in your hosts file. For now, have some fun looking at the example applications.

Finally, before I close this conversation, one point to add. As I mentioned above, you may have noticed a hit to your available memory after installing ColdFusion MX 6.1. If you open Windows Task Manager and take a look at the processes, you may notice that jrun.exe is using well over 50 MB. If you open up Services and Stop ColdFusion MX Application Server, you'll notice that this item disappears.

Depending upon your system, and how often you'll be working with ColdFusion (or Apache for that matter), you may want to disable ColdFusion MX from beginning when your computer starts up.

If you're interested in doing this, open the Services panel. Next, right click on the item you would like to stop from starting up on startup, and select Properties. Here, on the General tab, change Startup type from Automatic to Manual (not Disabled). This will ensure that this service only starts up when you manually start it. Note that if I manually start ColdFusion it takes about 30 seconds. If I let it start on startup, it increases my startup time by a little more than that. Again, if you won't be doing heavy development with ColdFusion, or if you restart your computer on a regular basis, think about changing ColdFusion, or Apache, to startup when you start them.

On one final note, you may even want to stop these services when you're not actively developing with them. Not only will it save memory, it will also close any security holes that these programs may have – not that that is of major concern.

In a future post, we'll discuss how to hook up MySQL with ColdFusion.

View all of the steps to creating a local Web server, for development.

(All original content on this site is licensed under the Creative Commons License Attribution-Noncommercial-No Derivative Works 3.0.)

A local, Apache Web server, on a Windows XP computer

My intention is to write a number of guides that will help someone build a functional Web server for testing purposes. Since Windows is fairly popular, I've decided to outline how to install Web server programs on it. Since Apache is both powerful and free, I've opted to use it as the core, instead of IIS, or the like.

I also plan on keeping the various technologies up-to-date, yet continuing to provide the instructions for past versions used, just in case. I do have copies of the versions I've installed below, and would be happy to provide those copies that no longer exist elsewhere; just ask.

Our local Web server uses the following technology.

The following upgrades are planned for addition (in no particular order):

  • MySQL 4.1.21
  • phpMyAdmin 2.9.1.1
  • PostgreSQL 8.1.5
    • pgAdmin III 1.6.0

The following information is planned for expanding the tutorials, in no particular order:

  • World's simplest, but professionally functional, Web page
  • MagpieRSS
  • how to restore WordPress/MySQL using phpMyAdmin
  • how to setup a CMS (Joomla and possibly Mambo)
  • AWStats
  • FusionReactor
  • sending mail
  • FTP?

As new pages are added, I will add additional links and items to the above. If you would like me to cover a particular program, please let me know - any possible additions to this list would be appreciated.