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: a href="http://localhost" target="_blank"http://localhost (you can also use a href="http://127.0.0.1)." target="_blank"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.
|
|
Web Design
Home Page
Content Is King.
All About Design: Principles And Elements.
Hints All The Way.
When Is The Right Time To Redesign?
How To Install And Configure A Forum.
How To Have Websites Built For You The Cheap Way
The Importance Of A Sitemap
The Art Of The Logo.
Avoiding The Nuts And Bolts: Content Management Software.
|
Web Design
5 Steps To Understanding HTML.
... have one extra tag before it. This is the doctype, and it must be present right at the top of your document for it to be valid HTML. There are only really two doctypes that you really need to know about. The HTML4 doctype looks like this: Read Full Article
AJAX: Should You Believe The Hype?
... originally invented and implemented by a Microsoft team who were working on a web mail application, and it's been around for a while now (since 1999, in fact). The reason it has suddenly come to prominence now is that Google used it in three projects, Gmail, Google Suggest and Google Maps, and in each ...
Using Quizzes And Games To Get Traffic.
... about current events are surprisingly appealing across age ranges, but have a limited shelf life. If you want more significant long-term traffic, then an excellent area to look at is innovative puzzle games: if you can come up with something simple but addictive in the style of PopCap Games (www.popcap.com), ...
Good Design Practices
... it's like the headquarter of an offline company. Hence, it is important to practise good design principles to make sure your site reaches out to the maximum number of visitors and sells to as many people as possible. Make sure you have clear directions on the navigation of your website. The navigation ...
CSS And The End Of Tables.
... that space that's all you need to do to create CSS. Useful CSS Rules. CSS rules look like this: rule-name: setting; Here are some of the most useful rule names and the different settings that can be applied to them. background-color. Lets you set a page's background colour using HTML colours (they look ...
| |