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 ...
随机推荐
- Selenium2+python自动化45-18种定位方法(find_elements)
前言 江湖传言,武林中流传八种定位,其中xpath是宝刀屠龙,css是倚天剑. 除了这八种,其实还有十种定位方法,眼看就快失传了,今天小编让失传已久的定位方法重出江湖! 一.十八种定位方法 前八种是大 ...
- Oracle命令行中显示:ORA-04076: 无效的 NEW 或 OLD 说明
Oracle命令行进行操作时可能出现"ORA-04076: 无效的 NEW 或 OLD 说明" 需要在条件语句中JOB前面添加“old.”即可(因为是在when条件里面,所以不用“ ...
- mysql 查询 两个表中不同字段的 和,并通过两个表的时间来分组
( SELECT sum( a.cost_sum ) AS sum_cost, sum( a.phone_sum ) AS sum_phone, sum( a.arrive_sum ) AS sum_ ...
- ES6 模块机制
ES6 实现了模块功能 将文件当作独立的模块,一个文件一个模块 每个模块可以导出自己的API成员,也可以导入其他模块或者模块中特定的API ES6 模块的设计思想,是尽量的静态化,使得编译时就能确定模 ...
- elasticsearch视频
简单的集群管理 (1)快速检查集群的健康状况 es提供了一套api,叫做cat api,可以查看es中各种各样的数据 GET /_cat/health?v epoch timestamp cluste ...
- oracle统计数据时,涉及两个表的数据
SELECT t1.*,a.num FROM (SELECT SUM(t.total_profit) total_profit, SUM(t.main_business_income) main_bu ...
- 严重: StandardWrapper.Throwable org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'goodsController' defined in file [D:\eclipse\eclipse-space\pinyougou_parent\pinyou
由于错误太宽,没法截取完整的,所以不怎么连贯,但是不影响错误的解决. 这个错误是因为service无法自动注入.显示嵌套状态异常. 我就查看了一下我的坐标和配置文件,配置文件的路径和访问地址都是正确的 ...
- 安装tomcat9
要提前安装好jdk,不要是openjdk //我之前有文章写安装jdk的 [root@ycj ~]# wget http://mirrors.hust.edu.cn/apache/tomcat/tom ...
- js文档就绪函数
$(function(){ //执行的内容 }): $().ready(function(){ //执行的内容 }); $(document).ready(function(){ //执行的内容 }) ...
- A股魔咒
4.19魔咒 从2007年开始每逢4月19日大盘大跌. 基金“88”魔咒 88%魔咒,就是当基金的仓位水平达到88%左右的时候,A股市场往往会出现大跌,基金仓位成了股市的“反向指标”,当基金的平均仓位 ...