Apache支持cgi 

1、打开Apache配置文件httpd.conf,搜索“cgi”,找到下面的一段,去掉“addhandler”前面的“#“,这样就开启了Apache的cgi功能

[root@localhost ~]# gedit /etc/httpd/conf/httpd.conf

# AddHandler allows you to map certain file extensions to "handlers":

# actions unrelated to filetype. These can be either built into the server

# or added with the Action directive (see below)

#

# To use CGI scripts outside of ScriptAliased directories:

# (You will also need to add "ExecCGI" to the "Options" directive.)

#

AddHandler cgi-script .cgi

2、cgi的目录在“/var/www/cgi-bin/”,在这里创建一个测试文件“test.cgi”输入内容如下

[root@localhost ~]# touch /var/www/cgi-bin/test.cgi

#!/usr/bin/perl

print "Content-type: text/html\n\n";

print "hello cgi";

3、将“cgi-bin”的权利改为777

[root@localhost ~]# chmod R 777 /var/www/cgi-bin

4、在浏览器输入“127.0.0.1/cgi-bin/test.cgi”可以看到下面的结果

做了一个Linux学习的平台,目前出来一个雏形,各位可以参考使用
链接:https://pan.baidu.com/s/1GOLVU2CbpBNGtunztVpaCQ  密码:n7bk

Linux服务器---apache支持cgi的更多相关文章

  1. Linux服务器---apache支持SSL

    Apache支持ssl 1.检测是否安装ssl模块,如果没有就安装 [root@localhost cgi-bin]# rpm -qa | grep mod_ssl           //查看是否安 ...

  2. linux 服务器所支持的最大句柄数调高数倍(与服务器的内存数量相关)

    https://github.com/alibaba/p3c/blob/master/阿里巴巴Java开发手册(详尽版).pdf 2. [推荐]调大服务器所支持的最大文件句柄数(File Descri ...

  3. Linux让Apache支持中文URL图片/文件名

    需要用到iconv_hook和mod_encoding Apache(32位): 安装环境:CentOS 5.6 + Apache 2.2.15 (Apache2.4同样适用) 安装结果:安装后支持“ ...

  4. centos linux服务器apache+mysql环境访问慢优化方法

    查找软件安装目录:find / -name 软件名称 一.优化apache配置增加MaxClients的值 默认情况下,2.0及以上apache版本MaxClients的值为256,对于中大型应用访问 ...

  5. Linux服务器---apache配置文件

    Apache配置文件 Apache的配置文件默认路径是“/etc/httpd/conf/httpd.conf”,编辑该文件就可以修改Apache的配置 1.设置网页主目录,参数DocumentRoot ...

  6. Linux Python apache的cgi配置

    一.找到安装Apache的目录/usr/local/apache2/conf,并对httpd.conf配置文件进行修改 1.加载cgi模块 去掉注释: LoadModule cgid_module m ...

  7. linux服务器apache 一个IP,一个端口,建立多个网站的方法。

    找到apache-tomcat-6.0.14\conf\server.xml ,再services 后面添加此段代码: Xml代码 <!-- 此处  新增的项目配置-->  <Ser ...

  8. Linux启动Apache支持.htaccess伪静态文件方法

    第一.编辑httpd.conf文件 A - 在etc/httpd/conf/目录下的httpd.conf 文件,找到: LoadModule rewrite_module modules/mod_re ...

  9. [linux]服务器apache配置vhost

    官网示例: http://httpd.apache.org/docs/current/vhosts/examples.html

随机推荐

  1. mac下安装启动Mongodb

    本人最近才上手mac,在使用mac上面有很多不熟悉的地方,慢慢摸索,记录下来,以供后续翻阅与参考: 在Mac下安装MongoDB方式 第一种.用浏览器或者第三方工具下载当前版本的下载地址: http: ...

  2. Windows 8.1 100% 磁盘使用率解决方案

    前段时间我的win8电脑爆卡!动不动就卡死,一点都动不了. 好不容易打开了任务管理器,发现disk usage: 100%,实在是不理解,磁盘使用率100%怎么会影响流畅度?如果是CPU或内存还好理解 ...

  3. VSCode集成TypeScript编译

    先安装github客户端和nodeJS客户端吧,直接去官网下载,nodeJS客户端安装完就集成了npm; 查看是否成功: git version  node -v npm-v 安装TypeScript ...

  4. JavaWeb 后端 <三> 之 Response Request

    1. 响应对象 Response(重点:HTTP协议响应部分) 查看

  5. Oracle Function:COUNT

    Description The Oracle/PLSQL COUNT function returns the count of an expression. The COUNT(*) functio ...

  6. mongostat和mongotop对mongodb数据库运行状态进行监控

    --mongostat工具是mongdb自带的监控工具,可以用来监控mongodb当前状态下的运行情况: [root@slave2 ~]# /usr/local/mongodb341/bin/mong ...

  7. LightOj 1265 - Island of Survival(概率)

    题目链接:http://lightoj.com/volume_showproblem.php?problem=1265 题目大意:有一个生存游戏,里面t只老虎,d只鹿,还有一个人,每天都要有两个生物碰 ...

  8. navicat的安装

    1.首先在官网下载navicat,具体安装步骤比较简单,下一步下一步即可. 2.安装之后,按照下面的网址做法激活 http://www.jianshu.com/p/b1f9194e1e31 3.教程: ...

  9. python 基础 内置函数

    内置参数 print(all([5,-1,5])) # 非0都是真 true print(all([0,-1,5])) # false print(any([1,0,5])) # 有一个数据为真,就为 ...

  10. Python绘图工具matplotlib的使用(图形并茂)

    matplotlib官网文档: http://matplotlib.org/gallery.html 支持win7_64_bit的matplotlib库下载网址: http://www.lfd.uci ...