(1) the CGI script can also create a webpage CGI: CommonGatewayInterface public Gateway Interface Protocol. on The httpd server, the CGI mechanism can be implemented through CGI: converting the script to a client browser can identify the webpage format, that is, Content-Type: text/html. the CGI performer must be root, so it is dangerous. 1. the dependent module mod_al
(1) CGI scripts can also be used to create web pages
CGI: Common Gateway Interface public Gateway Interface Protocol
On the httpd server, you can use CGI to create web pages.
CGI mechanism: convert scripts to client browsers to identify the webpage format, namely, Content-Type: text/html
The CGI executor must be root, which is dangerous.
1. dependent module mod_alias mode_cgi
|
LoadModule alias_module modules/mod_alias.soLoadModule cgid_module modules/mod_cgid.soLoadModule cgi_module modules/mod_cgi.so |
Need to be enabled (before Module # delete)
2. create a CGI script
Create a cgiscript script in the/usr/local/apache/cgi-bin/directory.
|
# Vim/usr/local/apache/cgi-bin/cgiscript |
|
Script content #! /Bin/bash # cat <EOFContent-Type: text/htmlThe hostname is : `hostname`The time is : `date` EOF |
3. global configuration page access properties: add ExecCGI
ExecCGI function: allows the mod_cgi module to execute CGI scripts
4. test
Success ~~