zoukankan      html  css  js  c++  java
  • 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++"

      命令解析:该命令为反查命令,此命令的含义是查询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 = 0;
    while(FCGI_Accept() >= 0)
    {
    printf("Content-type: text/html
    "
    "
    "
    "<title>FastCGI Hello!</title>"
    "<h1>FastCGI Hello!</h1>"
    "Request number %d running on host <i>%s</i>
    ",
    ++count, getenv("SERVER_NAME"));
    }
    return 0;
    }

     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:8088;
            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

  • 相关阅读:
    vue后台管理系统项目
    javascript面试题
    webpack学习
    js全局变量收集器
    Koa2框架token验证
    require.js使用
    Koa2中使用art-template模板和静态资源托管
    Koa2POST请求参数
    H5、C3、ES6的新特性
    H5视频播放
  • 原文地址:https://www.cnblogs.com/simplezy/p/6793538.html
Copyright © 2011-2022 走看看