Web Design Tips and Tricks

Setting up a Test Server on Your Own Computer

Setting up a Test Server on Your Own Computer.

When you're developing a website, you need to see it in action on a real server, to see how it will work. While you could upload your pages to your web host every time you make a change, this quickly gets time-consuming and tiresome. Wouldn't it be great if you could have a little test server of your own? Well, the server is nothing but a piece of software – so you can! Please note that, for the purposes of this article, I will assume you're using Windows as your operating system.

Installing an IIS Test Server.

While using IIS isn't recommended, a test server is very easy to install. All you need to do is open 'Add or Remove Programs' in Windows' control panel. All you need to do is click Internet Information Services (IIS), click OK, and you're done.

Of course, there are downsides to this. Many versions of Windows don't come with IIS, and there's no way to install it on them – Windows XP Professional, for example, comes with IIS, but Windows XP Home does not. You might also want to consider that installing IIS on your computer will often make it less secure.

Installing an Apache Test Server.

Compared to installing IIS, installing Apache is hard – Linux distributions all have relatively easy ways of doing it, but Windows wasn't designed for it. To get Apache installed, then, you're going to need to have a little fight with the system.

Note: If you want to skip all the following steps, you might consider using an 'easy installer' version of Apache, such as XAMPP (for Windows), which you can get at www.apachefriends.org/en/xampp-windows.html. The downside to this approach is that you will be relying on them to provide new releases, instead of being able to update things yourself.

First of all, download Apache from http://httpd.apache.org/download.cgi. Make sure you download the Windows Installer (MSI) version. You'll find it easiest to make the server run as a service, as this will make it run automatically – Apache will appear in your system tray (in the bottom-right corner of your screen).

Now, you need to find your Apache configuration file. In the folder where you installed Apache, look for another folder named 'conf', and then a file named 'httpd.conf'. Open this file and look for a setting called DocumentRoot. You should change this to point to a folder on your hard drive, such as 'c:/html'.

Now, you've got Apache, but that's not usually much good on its own. The chances are that you'll want to install PHP and MySQL as well, so here's how:

Download PHP from http://www.php.net/downloads.php. Again, go for the installer. Once you've installed PHP, find its folder, and rename the php.ini-dist file there to php.ini. Find the 'doc_root' setting there, and set it to the same thing you set Apache's to.

Back in Apache's httpd.conf, you should add these lines:

LoadModule php5_module "c:/php/php5apache2.dll"
AddType application/x-httpd-php .php
PHPIniDir "c:/php"

If you didn't install PHP in c:\php, change the lines above to reflect where you put it.

Now, installing MySQL isn't as difficult, because it runs independently of your Apache configuration. Download MySQL from dev.mysql.com/downloads. Again, get the Windows installer version. This installer has a lot of settings, but you'll be fine if you just click Next through them to accept all the defaults.

The only remaining step is to enable MySQL support in PHP. Copy libmysql.dll file from c:\php to your Windows\System32 folder, and then open the php.ini file you created before. Remove the semicolon from the start of the line that says ';extension=php_mysql.dll', and save the file.

Shut down Apache and restart it, and you're done!

Visiting Your Server.

When they've installed a server on their computer, many people wonder how they can access the server they just installed as if they were visiting it over the web. The answer is simple: just open your web browser, and go to this URL: http://localhost (you can also use http://127.0.0.1). This special address means 'the server on this computer'.

You'll know if you installed Apache successfully because you'll see a page congratulating you. When you change your web pages, just use your browser's Refresh button to see the effect.

 

 Article index
 
5-Simple-Steps-to-Accepting-Payments
5-Steps-to-Understanding-HTML
10-Easy-Ways-to-Promote-Your-Website
5-Ways-to-Avoid-the-1998-Look
6-Reasons-Why-You-Need-a-Website
7-Ways-to-Make-Your-Web-Forms-Better
Ads-Under-the-Radar-Linking-to-Affiliates
AJAX-Should-You-Believe-the-Hype
All-About-Design-Principles-and-Elements
An-Introduction-to-Paint-Shop-Pro
An-Issue-of-Width-the-Resolution-Problem
A-Question-of-Scroll-Bars
Avoiding-the-Nuts-and-Bolts-Content-Management-Software
Beware-the-Stock-Photographer-Picking-Your-Pictures.
Building-a-Budget-Website
Building-Online-Communities
Clean-Page-Structure-Headings-and-Lists
ColdFusion-Quicker-Scripting-at-a-Price
Column-Designs-with-CSS
Content-is-King
CSS-and-the-End-of-Tables
Cut-to-the-Chase-How-to-Make-Your-Website-Load-Faster
Designing-for-Sales
Designing-for-Search-Engines
Dont-Be-Scared-Its-Only-Code-HTML-for-Beginners
Dreamweaver-The-Professional-Touch
Encryption-and-Security-with-SSL
Finding-a-Good-HTML-Editor
Focus-on-the-User-Task-Oriented-Websites
Fonts-are-More-Important-Than-You-Think
Free-Graphics-Alternatives
FrontPage-Easy-Pages
Hints-All-the-Way
Hiring-Professionals-5-Things-to-Look-For
How-Databases-Work
How-the-Web-Works
How-to-Get-Your-Website-Talked-About-on-Blogs
How-to-Install-and-Configure-a-Forum
How-to-Make-Visitors-Add-You-to-Their-Favorites
How-to-Run-Ads-Without-Driving-Visitors-Crazy
How-to-Set-Up-Your-Hosting-in-5-Minutes-Flat
IIS-and-ASP-Microsofts-Server
Image-Formats-GIF-JPEG-PNG-and-More
Its-a-World-Wide-Web-Going-International
JSP-Java-on-Your-Server
LAMP-The-Most-Popular-Server-System-Ever
Making-Friends-and-Influencing-People-the-Importance-of-Links
Making-Searches-Simple
Offering-Free-Downloads-on-Your-Website
Opening-a-Web-Shop-with-E-Commerce-Software
Perl-Cryptic-Power
Photoshop-a-Graphic-Designers-Dream
PHP-Easy-Dynamic-Websites
Picking-a-Colour-Scheme
Printing-and-Sending-the-Two-Things-Users-Want-to-Do
Putting-Multimedia-to-Good-Use
Python-and-Ruby-the-Newer-Alternatives
Registering-a-Domain-Name
Registering-Your-Users-by-Stealth
RSS-Really-Simple-Syndication
Setting-Up-a-Mailing-List
Setting-up-a-Test-Server-on-Your-Own-Computer
Some-Places-to-Go-For-More-Information
Taking-HTML-Further
Taking-HTML-Further-with-Javascript
Taking-Your-Website-Mobile
Text-Ads-Unobtrusive-Advertising
The-5-Principles-of-Effective-Navigation
The-Art-of-the-Logo
The-Basics-of-Web-Forms
The-Basics-of-Web-Servers
The-Case-Against-Flash
The-Confusing-World-of-Web-Hosting-Making-Your-Decision
The-Evils-of-PDFs
The-Importance-of-Validation
The-Many-Flavours-of-HTML
Theres-More-than-One-Web-Browser
The-Smaller-the-Better-Avoiding-Graphical-Overload
The-Top-10-Biggest-Web-Design-Mistakes
The-Web-Designers-Toolbox
The-Web-is-Not-Paper
Time-for-User-Testing
Titles-and-Headlines-Its-Not-a-Newspaper
Tracking-Your-Visitors
Understanding-Web-Jargon
Uploading-Your-Website-with-FTP
Using-Flash-Sensibly
Using-Quizzes-and-Games-to-Get-Traffic
VBScript-Javascript-Made-Easy
Websites-and-Weblogs-Whats-the-Difference
What-Do-You-Want-Your-Website-to-Do
What-You-See-Isnt-Always-What-You-Get
Which-Database-is-Right-for-You
Why-Doing-It-Yourself-is-Best
Why-Java-Will-Drive-Your-Visitors-Away
Why-Word-is-Bad-for-the-Web
Why-You-Should-Put-Your-Content-in-a-Weblog-Format
Why-You-Should-Stick-to-Design-Conventions
Working-With-Templates
Writing-for-the-Web
Site Map