Your Local Development Environment
For many web designers making the transition from static HTML web design to dynamic, database driven web development the most daunting task they initially face is setting up a local development / test environment.
What is a local development environment?
This is where you set up a system where you can run and test your dynamic, database connected web pages on your own system so you can test and see if your code works as you go. Here are the elements involved...
Web Server (IIS, Apache, Tomcat etc)
The web server handles basic HTML requests, in other words your browser requests an .htm or .html page, the web server finds it and sends it to the browser... That's it. If you have just been doing static HTML pages setting up local web server hasn't been necessary because your OS and browser can handle this for you without an actual web server being present. So why add one now? Because your next step is to install an Application Server, which works with and requires a Web Server.
Application Server (ColdFusion/Railo - PHP)
When a Web Server receives a request from a browser that is not an HTML page, such as a .cfm or .php page it hands it off the the appropriate Application Server if one exists. The Application server then executes the code and gathers the requested data and variables and compiles this information into an HTLM page and hands it back to the Web Server. Now that the page is in HTML format the Web Server knows what to do with it, and sends it along to the browser.
Database / Database Server (MySQL)
The third element is the database, this can be a database file such as MS Access - File based databases are not a viable choice for eCommerce website. A Web Database Server such as MySQL is far more robust and secure solution and are the only type of database Cartweaver supports. Currently MySQL is the supported database, for the ColdFusion version MS SQL Server support will be added soon. Contact support if you need MS SQL Server support for your Cartweaver 4 ColdFusion site.
Why Develope and Test Locally?
Now you know the elements involved in setting up a local development environment. You may ask yourself, why bother? Why not just test on your host server? There are a number of very good reasons.
- It saves time. - Having to upload to the server every time you want to preview and test your work becomes a real pain, quickly. Add up the amount of time this takes over the course of anything but the smallest project, and you'll see this cost you money, pure and simple!
- Keeps you out of trouble. Uploading and running untested code to a shared sever is both inconsiderate and unprofessional. What if you code cause the server to lock or crash? You will bring down not only your site but every other site on the server. This can make you VERY unpopular.
- Helps track down the problems. If you have thoroughly tested your code locally and everything works, then you upload it to your host server and it doesn't, you can feel very confident that it is not your code. This is very helpful in dealing with your host i tracking down configuration issues.
Even though it takes some effort, and there is the initial learning curve to climb, resolve yourself here and now to set up and use a local development environment. Doing so will make the rest of your journey to dynamic web development a much more rewarding one.
The good news is, setting up your local environment is the steepest part of the learning curve - once this is done you'll be pleased to discover that the "Cartweaver part" of the process is by far the easiest!