Using the Web Test Environment
(Page 1 of 4 )
Once you have your Apache web server installed you’ll want to configure it as closely as possible to your actual web server so that you have a realistic test environment. This will allow you to create and test web pages and applications locally, in real-time, and upload them later.
At this point XAMPP will have installed virtually everything you need. You can further customize this any way you like. Don’t use MySQL? Install the database system of your choice. Need to add support for Python? That’s no problem either.
XAMPP installs a lot of useful components. You should check their web site to see what’s included in the version you installed. The latest version at the time of this writing even includes Zend Optimizer. They are constantly adding components to make it as useful as possible.
It should be fairly obvious at this point that your domain is not going to be pointing to this server. Hopefully you’re accustomed to using relative file paths. If not, or for any other direct link, you’ll need to substitute http://localhost for your own http://www.yourdomain.com.
Alternatively, you can leave everything the same and add the following entry to your hosts file. (C:WindowsSystem32driversetchosts)
127.0.0.1 www.yourdomain.com
This will redirect all requests for yourdomain.com to 127.0.0.1 which is the address of your local network adapter.
The term ‘localhost’ is actually the hostname assigned to 127.0.0.1. They can be used interchangeably.
This method is by far the best for cross-compatibility. You won’t need to change any of the references in your code when you move them between hosts. The drawback is that you will not be able to access the “live” site at yourdomain.com because your browser will always redirect them locally.
Next: Executing CGI scripts >>
More BrainDump Articles
More By Nilpo/Developer Shed Staff Writer