nginx FastCGI 安装配置
来源:互联网 发布:ps磨皮插件怎么安装mac 编辑:程序博客网 时间:2024/05/23 23:32
yum install epel-release
yum install fcgi-devel //安装fastcgi库
请去 : https://github.com/gnosek/fcgiwrap 下载 fcgiwrap
tar zxf fcgiwrap-1.0.3.tar.gz
cd fcgiwrap-1.0.3
autoreconf -i
./configure
make
make install
安装完毕.开始运行该软件
默认安装路径 /usr/local/sbin
之后三个选项
# fcgiwrap -h
Usage: fcgiwrap [OPTION]
Invokes CGI scripts as FCGI.
fcgiwrap version 1.0.1
Options are:
-c <number> Number of processes to prefork
-s <socket_url> Socket to bind to (say -s help for help)
-h Show this help message and exit
# TCP 启动方式
# /usr/local/bin/fcgiwrap -s tcp:127.0.0.1:8999
# 参数 n 为进程数量
# /usr/local/bin/fcgiwrap -c 8 -s tcp:127.0.0.1:8999
# SOCK启动方式
# /usr/local/bin/fcgiwrap -s unix:/tmp/perl-fpm.sock
# chmod +x /tmp/perl-fpm.sock
# sock 关闭方式
# killall fcgiwrap
# rm -f /tmp/perl-fpm.sock
# 编辑nginx 配置文件
# 在server里加入如下 该站点即可支持pl perl cgi 三个后缀
location /cgi-bin/ {
#fastcgi_pass unix:/tmp/perl-fpm.sock;
fastcgi_pass 127.0.0.1:8999;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
在网站根目录下创建 cgi-bin目录
mkdir cgi-bin
测试hello.c
Vim hello.c
#include<stdio.h>
int main(){
printf("Content-Type:text/html\n\n");
printf("hello!!");
}
gcc hello.c –o hello
访问http://ip/cgi-bin/hello
测试
# 测试的 hello world 文件
vi 1.pl
#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "Hello, world.";
# 一定要记得给执行权限
chmod +x 1.pl
http://ip/1.pl
尝试访问吧
0 0
- nginx FastCGI 安装配置
- fastCGI与nginx安装配置
- nginx+fastcgi+c/c++源码安装配置
- Nginx+FastCgi配置过程
- Nginx+FastCGI配置
- Django+nginx+fastcgi 配置
- Nginx+FastCGI(配置等)
- Nginx+FastCGI配置
- nginx php fastCGI配置
- nginx+django+fastcgi配置
- nginx+fastcgi安装
- CentOS5下安装配置nginx+fastcgi php+mysql
- Windows下Nginx+PHP5(FastCgi)安装配置详解
- Windows下Nginx+PHP5(FastCgi)安装配置详解
- Windows下Nginx+PHP5(FastCgi)安装配置详解
- 通过yum安装nginx-mysql-php-fastcgi配置LNMP
- Windows下Nginx+PHP5(FastCgi)安装配置详解
- Windows下Nginx+PHP5(FastCgi)安装配置详解
- 使用com.android.support:design 中的 “CollapsingToolbarLayout”,页面崩溃
- 信息: Initializing Spring FrameworkServlet 'spring'
- 复习
- CFGym
- 集合迭代时候操作解决方案-ArrayList-Iterator-CopyOnWriteArrayList
- nginx FastCGI 安装配置
- TX1上使用265实时硬编码
- 第八届省赛ACM赛后总结
- svn-commit遇上aborting commit: remains in conflict 解决办法
- Mybatis入门笔记--终端显示sql语句
- 华为交换机S5700配置VLAN和VLANif
- Functional Programming in R
- 你应该知道rpc原理
- Android 蓝牙开发(八)hfp接听、挂断电话