I learned the basics of Perl before. I was planning to only learn how Perl can access the database, but I found CGI is also quite interesting. By the way, let's take a look, in addition, it seems cool to interact with databases through
A small examplePython uses Cgihttpserver to invoke the shell as a CGI scriptMkdir-p/data/cgi-binVim hello.sh#!/bin/bashecho "content-type:text/html" echo "" echo "Hello world!"Execute python-m cgihttpserverThen enter http://:8000/cgi-bin/hello.sh in
When running Python script on the Apache server, AddHandler cgi-script is not added. py, the content will be displayed in the browser in the text format. I hope this article will bring you some useful information.
We found that Apache's mod_python
When a Web server accepts a request from a browser, it is returned directly to the browser if it is a static resource, and if it is a dynamic resource, CGI can be understood as a protocol or a class of handlers that can execute a php or Python
Configure PHP Support module mode, CGI mode, and fastcgi mode in ApacheInstall Apache, MySQL, and PHP first, sequentially.1.apache, MySQL installation is relatively simple, skip2. PHP installation, I installed the php5.3.6 built-in php-fpm, so there
The installation directory of nginx is/usr/local/nginx.
The virtual machine configuration file is/usr/local/nginx/conf/vhosts. conf.
Currently, php fast-cgi supports
The following operations are completed under su:
==================================
Simulates the process of starting CGI on a server-side httpd process,Full presentation of Get,post method supportGcc-g Httpd_all.c-o httpd_all.ums;#include #include #include #include #include #define CGI_NAME "Get_post.ums"#define REQUEST_METHOD
CGI Program (Common Gate-Interface)A program that is called by the server outside the server to allow the server to perform more powerful functions after the CGI program is mated to the server.1. The browser requests a URL to a CGI application
Error Report: The specified CGI application misbehaved by not returning a complete set of HTTP headers(The CGI Mode of the http protocol is incorrect)Because the-wT parameter is not supported in the first sentence of the perl script, replace all-wT
Let's look at the workflow of common CGI:The Web server receives the user request and submits the request to the CGI program, and the CGI program processes the requested parameters, then outputs the standard HTML statement back to the Web Server,web
CGI (Common Gateway Interface)Initially, CGI was developed in 1993 by the National Supercomputer Application Center (NCSA) for the NCSA HTTPd Web server.The Web server uses the UNIX shell environment variable to hold parameters passed from the Web
I found some information on the CGI, still can not fully understand.
Who can combine the history of web development, say that CGI and Web server (Apache,iis) also have PHP relationship.
Reply to discussion (solution)
Public Gateway Interface
Talk
In
WebServer
How to Implement CGITechnologyMany people are interested in the implementation of cgi technology in WebServer. However, in some open-source software such as Apache, due to the large scale of software, there are many related modules,
[Size = medium] download, installation, configuration:
Download: ftp://ftp.gnu.org/gnu/cgicc/
Unpack: Tar xzf cgicc-X.X.X.tar.gz
Build libraries:
* D cgicc-X.X.X/*./Configure -- prefix =/usr (default or/OPT. Make sure you have write priviges to the
Nginx parses the principles of PHP, cgi/fastcgi and php-fpm relationships.First, the scene that Php+nginx came into being.With the development of the Internet, the user accepts a wide range of this, the increase in data flow makes the web end of the
1. Configure the server to turn on annotationsVim/etc/httpd/conf/httpd.conf292 # (You'll also need to add "execcgi" to the "options" directive.)293 #294 AddHandler cgi-script. cgi. py. sh295296 # for type maps (negotiated resources):297 #AddHandler
Data transfer format When the user fills out the form and presses the Submit button, the Web browser does not send the user's data directly to the Web server, but first passes a certain encoding. Web browsers always encode data according to data
CGI: is a protocol for data exchange between Web Server and Web application.
FastCGI: The same as CGI, is a communication protocol, but it is more efficient than CGI to do some optimization.
PHP-CGI: Is the interface program for the CGI protocol
To capture the c g I variable in the domain, create a text domain named after the c g I variable (for example, http_cookie ).
Generally, this field is set to hidden in the editing status, so that the user cannot change the value in the field. When a
Some common concepts may be confused when you do not pay attention to them. 1. CGI is a common gateway interface. The HTTP server uses this interface program to communicate with other applications (such as PHP interpreter programs). Because CGI
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.