首先贴些遇到的问题,之后再整理

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++"

  命令解析:该命令为反查命令,此命令的含义是查询g++在哪个安装包里面。
  #gcc-c++
4.yum -y install fcgi fcgi-devel
5.test.c #file

#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的更多相关文章

  1. nginx+fastcgi+c/cpp

    参考:http://github.tiankonguse.com/blog/2015/01/19/cgi-nginx-three/ 跟着做了一遍,然后根据记忆写的,不清楚有没错漏步骤,希望多多评论多多 ...

  2. Nginx+FastCGI运行原理

    Nginx不支持对外部程序的直接调用或者解析,所有的外部程序(包括PHP)必须通过FastCGI接口来调用.FastCGI接口在Linux下是socket(这个socket可以是文件socket,也可 ...

  3. 记录一次自己对nginx+fastcgi(fpm)+mysql压力测试结果

    nginx + fastcgi(fpm) 压力测试: CentOS release 5.9 16核12G内存 静态页面: 并发1000,压测200秒,测试结果: 系统最大负载5.47 成功响应: 25 ...

  4. Nginx + FastCGI 程序(C/C++) 搭建高性能web service的Demo及部署发布

       FastCGI编程包括四部分:初始化编码.接收请求循环.响应内容.响应结束循环. FCGX_Request request; FCGX_Init(); ); FCGX_InitRequest(& ...

  5. nginx fastcgi php-fpm的关系梳理

    CGI(Common Gateway Interface)CGI全称是“公共网关接口”(Common Gateway Interface),HTTP服务器与你的或其它机器上的程序进行“交谈”的一种工具 ...

  6. 【入门篇】Nginx + FastCGI 程序(C/C++) 搭建高性能web service的Demo及部署发布

    http://blog.csdn.net/allenlinrui/article/details/19419721 1.介绍     Nginx - 高性能web server,这个不用多说了,大家都 ...

  7. windows下nginx+fastcgi不能使用file_get_contents/curl/fopen的原因

    这两天一直在搞windows下nginx+fastcgi的file_get_contents请求.我想,很多同学都遇到当file_get_contents请求外网的http/https的php文件时毫 ...

  8. [转] nginx+FastCGI+c++

    from: http://www.cnblogs.com/xiaouisme/archive/2012/08/01/2618398.html 一 安装 目的:不需支持php等.就html就行了.步骤: ...

  9. nginx 3.nginx+fastcgi

    死磕nginx 3.nginx+fastcgi 互联网服务器有个非常典型的架构lamp(linux+apache+mysql+php),由于其开源和强大的兼容性而风靡一时,不过随着nginx的横空出世 ...

  10. 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 ...

随机推荐

  1. MD5加密工具类

    简单的md5加密: package com.util; import java.security.MessageDigest; import java.security.NoSuchAlgorithm ...

  2. python接口测试-认识GET请求

    前边用工具也实现了接口自动化,但是后来很多的时候维护成本有点高.而且灵活上还是有所欠缺的. 于是,自己开始摸索学习敲码.应该有很多不对的地方或者可以优化的望各位大神勿喷,同时欢迎各位大神评论区发表自己 ...

  3. 设计模式之架构型MVC,MVP,MVVM模式

    一.MVCMVC,Model View Controller,是软件架构中最常见的一种设计模式,简单来说就是通过Controller的控制去操作Model层的数据,并且返回给view层展示.View跟 ...

  4. composer install 时遇到 Composer\Downloader\TransportException ...

    安装错误 [Composer\Downloader\TransportException] Invalid credentials for 'https://packagist.phpcomposer ...

  5. Resource Allocation of Yarn

    关键词:yarn 资源分配 mapreduce spark 简要指南 适合不想看太多原理细节直接上手用的人. 基本原则: container分配的内存不等于机器实际用掉的内存.NM给container ...

  6. jq三级联动

    test.html <div class="a_list"> <div class="a_title">商城分类:</div> ...

  7. ubuntu重复登录问题

    第一次遇到: 昨天好不容易装好了驱动,紧接着装了CUDA,cuDNN,Anaconda,VSCode等等.然后安装pytorch的时候遇到了下载的问题,后来也算搞定了.但是在更换了显示器后重启(好像是 ...

  8. 六、web应用与Tomcat

    软件系统体系结构 1 常见软件系统体系结构B/S.C/S 1.1 C/S l C/S结构即客户端/服务器(Client/Server),例如QQ: l 需要编写服务器端程序,以及客户端程序,例如我们安 ...

  9. JMM(java Memory Model)到底是什么?

    经历过很多面试大部分都会问一句: 你知道Java内存模型么?  然后我就pulapula的说一大堆什么堆呀,栈呀,GC呀什么的,这段时间把JVM虚拟机和多线程编程完整的学习了一遍,发现JMM和堆/栈这 ...

  10. Jumpserver之设置开机自启动

    vi /usr/lib/systemd/system/jms.service [Unit] Description=jms After=network.target mariadb.service r ...