Now comes the fun part: configuring. Don't let it intimidate you, it really isn't too bad. No, its not click and go, but its not difficult either.
In your \apache©onf directory there is a file "httpd.conf". Make a quick backup of that file to something like "httpd.conf.bak" just in case.
Now open the "httpd.conf" file up in an editor. Scroll down to the line that says "ServerName" and put in localhost:
Now lets make sure Apache works.
Start apache. Execute apache.exe.
>start >run c:\apache\apache.exe
It should open a window showing you it is running. Just minimize the window.
Open your browser and type in the address:
You should get a page saying "it worked".
shut down apache with:
Think k for kill.
Now lets go do some more configuring.
Open back up httpd.conf and edit these lines:
point that at the root of your website. At this point I should mention, that you should have your offline website setup Identical to your online website. For instance, my root directory here on this server is /www/searchengineworld/. So on my home box, I have those two directories setup and the remainder of the site is a perfect file and directory match to what I have here.
My documentroot line on apache reads:
(remember this is a unix program really, use foreslashes instead of backslashes in directories). So, set the documentroot to match your setup.
Right under the document root section of the httpd.conf file is a section on setting directories. Use this for now:
And also add this (replace the /a1/web with your document root directory)
Allow from all
Next, add this line about half way down the httpd.conf file somewhere: (there is a section on scripts, look for it)
AddHandler cgi-script .cgi
or whatever you need for scripts to match your own webserver.
You'll probably want server side includes at some point, so enabled them with:
AddType text/html .htm
AddHandler server-parsed .htm
AddType text/html .shtml
AddHandler server-parsed .shtml
Those lines can go under the line that reads something like: # To use server-parsed HTML files
that one. (sorry, I don't have a stock httpd handy).
That should give you enough to get going. Save the file and see if you can start apache and browse some files from your "webserver" by using "httpd://localhost" again.
Lets stop there and see if you have caught your breath...
When we get it all up and running smoothly, you will not only have cgi's offline but a perfect mirror of your online site. That way you can make all kinds of changes by viewing the pages in your browser right off the hard drive. Edit a file, a couple of clicks and a browser reload to view it.
Surf your entire site without firing up a modem - speed, creativity, there isn't anything like running a webserver offline to give your page production a big kick.