编写我的第一个FastCGI程序
文章目录
- 一. 环境配置
- 1. fcgi, spawn-fcgi
- 2.nginx
- 3.其它
- 二.编写FastCGI程序
- 1. 编写一个C++程序
- 2. 编译为CGI可执行程序
- 三.运行和访问FastCGI程序
- 1.用my_fast_cgi.conf配置文件启动nginx服务器
- 2.用spawn-fcgi进程管理器运行FastCGI程序
- 问题1:child exited with: 127
- 问题2:bind failed: Address already in use
- 3. 访问
一. 环境配置
1. fcgi, spawn-fcgi
Nginx运行FastCGI程序(ngx_http_fastcgi_module模块、fcgi库、spwan-fcgi进程管理器)
web(五)—spawn-fastcgi
2.nginx
Ubuntu上安装nginx
ubuntu问题g++ : 依赖: g+±4.8 (>= 4.8.2-5~) 但是它将不会被安装
在/usr/local/nginx/conf/目录下新建一个名为my_fast_cgi.conf的文件
sudo vim /usr/local/nginx/conf/my_fast_cgi.conf
写入
worker_processes 4;events {worker_connections 1024;
}http {server {listen 9000;# 只要URI以.cgi结尾,都会访问到这个locationlocation ~ \.cgi {