An analysis of the SSI and CGI setting methods in Apache server

Source: Internet
Author: User
Tags include

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.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.