Because Apache is highly portable and supports more than 30 operating systems, including UNIX, Windows, and Darwin, most of the currently registered domains in the network are using Apache Web servers. Currently Apachesoftware Foundation is working to develop the Apache2.0 that has now entered the Alpha test phase. Here, I discuss with you how to modify the server option so that the server can provide simple dynamic web content, that is, support CGI programs and Server-side Include (SSI) programs.
1. Preparation work
First of all, I assume that you have Apache installed and that your Apache can provide static Web pages for browsing. The Apache installation automatically attaches a static HTML test page, which means that if you can see the test page, your Apache will work. The basic installation of Apache can only provide static HTML Web pages. However, you can improve its functionality by using a module (modules). In the original settings, Apache compilation will contain the Mod_include and moc_cgi two modules. You can do it in the bin subdirectory./httpd-l to see if your Apache has these two modules. The output that executes will be a long string of all the modules that Apache now installs. If the two modules Mod_include and moc_cgi are not in the list, you must recompile the server. When recompiling, determine the instructions that follow how to include the Mod_include, moc_cgi modules. In addition, you must also have a real-time web page server-side Includes (Related information URL: http://www.oreilly.com/catalog/apache/excerpt/ch10.html). With Server-side includes (SSI) support, you can create real-time dynamic Web pages. Next, I start with the SSI support settings for the server, and then I go into CGI writing.
2, the Apache setting
First you have to find the Apache configuration file. Apache's original installation directory is/usr/local/apache under UNIX and C:Program Filesapache under Windows. Next in the Conf subdirectory you will find the httpd.conf file. This is the Apache configuration file. This setup file is a text-only file, so you can edit it using a generic text editor, such as VI or Notepad. The first thing to note is that the start text of some lines in this profile is the # symbol, which means that the line's text is all annotated. It's a good practice to make comments appropriately in your profile because it helps you remember what you've done and why.