nginx+fastCGI
首先贴些遇到的问题,之后再整理
1.yum -y install pcre zlib OpenSSL openssl-devel pcre-devel
2.
nginx: [emerg] "server" directive is not allowed here in /etc/nginx/nginx.conf:134
#答案:是因为我是用错了配置文件
3.yum whatprovides "*/g++"
#include "fcgi_stdio.h"
#include <stdlib.h> int main(void)
{
int count = ;
while(FCGI_Accept() >= )
{
printf("Content-type: text/html\r\n"
"\r\n"
"<title>FastCGI Hello!</title>"
"<h1>FastCGI Hello!</h1>"
"Request number %d running on host <i>%s</i>\n",
++count, getenv("SERVER_NAME"));
}
return ;
}
command : spawn-fcgi -a 127.0.0.1 -p 8088 -f cgibin/test2.fcgi
6.nginx.conf 在server 容器中添加
location ~ \.fcgi$ {
fastcgi_pass 127.0.0.1:;
fastcgi_index index.cgi;
fastcgi_param SCRIPT_FILENAME fcgi$fastcgi_script_name;
include fastcgi_params;
}
7.重新加载配置文件
kill -HUP `cat logs/nginx.pid`
感谢:http://blog.csdn.net/allenlinrui/article/details/19419721
nginx+fastCGI的更多相关文章
- nginx+fastcgi+c/cpp
参考:http://github.tiankonguse.com/blog/2015/01/19/cgi-nginx-three/ 跟着做了一遍,然后根据记忆写的,不清楚有没错漏步骤,希望多多评论多多 ...
- Nginx+FastCGI运行原理
Nginx不支持对外部程序的直接调用或者解析,所有的外部程序(包括PHP)必须通过FastCGI接口来调用.FastCGI接口在Linux下是socket(这个socket可以是文件socket,也可 ...
- 记录一次自己对nginx+fastcgi(fpm)+mysql压力测试结果
nginx + fastcgi(fpm) 压力测试: CentOS release 5.9 16核12G内存 静态页面: 并发1000,压测200秒,测试结果: 系统最大负载5.47 成功响应: 25 ...
- Nginx + FastCGI 程序(C/C++) 搭建高性能web service的Demo及部署发布
FastCGI编程包括四部分:初始化编码.接收请求循环.响应内容.响应结束循环. FCGX_Request request; FCGX_Init(); ); FCGX_InitRequest(& ...
- nginx fastcgi php-fpm的关系梳理
CGI(Common Gateway Interface)CGI全称是“公共网关接口”(Common Gateway Interface),HTTP服务器与你的或其它机器上的程序进行“交谈”的一种工具 ...
- 【入门篇】Nginx + FastCGI 程序(C/C++) 搭建高性能web service的Demo及部署发布
http://blog.csdn.net/allenlinrui/article/details/19419721 1.介绍 Nginx - 高性能web server,这个不用多说了,大家都 ...
- windows下nginx+fastcgi不能使用file_get_contents/curl/fopen的原因
这两天一直在搞windows下nginx+fastcgi的file_get_contents请求.我想,很多同学都遇到当file_get_contents请求外网的http/https的php文件时毫 ...
- [转] nginx+FastCGI+c++
from: http://www.cnblogs.com/xiaouisme/archive/2012/08/01/2618398.html 一 安装 目的:不需支持php等.就html就行了.步骤: ...
- nginx 3.nginx+fastcgi
死磕nginx 3.nginx+fastcgi 互联网服务器有个非常典型的架构lamp(linux+apache+mysql+php),由于其开源和强大的兼容性而风靡一时,不过随着nginx的横空出世 ...
- nginx+fastcgi php 使用file_get_contents、curl、fopen读取localhost本站点.php异常的情况
原文:http://www.oicto.com/nginx_fastcgi_php_file_get_contents/ 参考:http://os.51cto.com/art/201408/44920 ...
随机推荐
- debian安装mongoDB
wget http://fastdl.mongodb.org/linux/mongodb-linux-i686-1.8.2.tgz tar zxf mongodb-linux-i686-1.8.2.t ...
- redis启动过程源码解析
redis整个程序的入口函数在server.c中的main函数,函数调用关系如下图1,调用顺序为从上到下,从左至右. 图1 redis启动函数调用图 main函数源码如下,1-55行根据配置文件和启动 ...
- ASP.NET Core 3.0预览版体验
目前.NET Core 3.0的版本为.NET Core 3.0 Preview 3,对应ASP.NET Core 3.0 Preview 3. ASP.NET Core 3.0 之后将不再支持.NE ...
- 关于UITabBarController的设置(iOS 开发)
1.设置图片(选中以及未选中) UITabBarItem *TuiJianItem=[[UITabBarItem alloc]initWithTitle:@"我的" image:[ ...
- ValidateCode源码
ValidataCode.java: package com.itcast; /** * @author 大汉 */ import java.awt.Color; import java.awt.Fo ...
- nodejs----安装配置
Node.js 安装配置 Node.js 安装包及源码下载地址为:https://nodejs.org/en/download/. 你可以根据不同平台系统选择你需要的 Node.js 安装包. Nod ...
- servlet 拦截器 (filter)
使用: 创建一个类实现javax.servlet.Filter接口,并重写接口中所有的方法: 在web.xml配置所需要拦截的请求. 过程说明: 1>在应用启动的时候就进行装载Filter类(与 ...
- Python学习小纪
1.打包发布*.py文件---"文件路径下打开命令行 d:\python\python.exe setup.py sdist" eg:打包发布f:\C\python\print_l ...
- 【C++】基于邻接矩阵的图的深度优先遍历(DFS)和广度优先遍历(BFS)
写在前面:本博客为本人原创,严禁任何形式的转载!本博客只允许放在博客园(.cnblogs.com),如果您在其他网站看到这篇博文,请通过下面这个唯一的合法链接转到原文! 本博客全网唯一合法URL:ht ...
- NABCD---生活日历
本软件的主体为日历.如今人们的生活趋于现代化,大家主要通过手机来查看日期,但我们每一天都有想要做或未完成的事情,也存在对自己有特殊意义的日子.每天人们都会有或大或小的支出与收入,想要系统的记录这些支出 ...