CGI:Common Gateway Interface(通用网关接口)使WEB可以跟一个应用程序进行通信,从通信环境中获得结果。

CGI是不安全的,需要mod_alias,mod_cgi模块

ScriptAlias /URL/ "/path/to/somewhere" somewhere下的文件可以被执行,也可以在目录中实现

格式一般为:编辑vim /URL/test加入

#!/bin/bash

cat << EOF

Content-Type: text/html

<pre>

<h1>The hostname is : `hostname`</h1>

The time is : `date`.

</pre>

EOF

测试地址:http://ServerIP/URL/test显示结果为:

The hostname is : master.fansik.com

The time is : Thu Jun 30 10:57:36 CST 2016.

相关文章:

  • 2021-07-22
  • 2021-12-31
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-06
猜你喜欢
  • 2022-12-23
  • 2021-12-05
  • 2021-11-29
  • 2021-12-03
  • 2022-12-23
  • 2022-12-23
  • 2021-12-23
相关资源
相似解决方案