在编译时,不需再–enable-fastcgi了,在php5.3.3中强制启用fastcgi了。
#! /bin/bash
address="127.0.0.1"
port="9000"
pidpath="/tmp/spawn_phpcgi_${port}.pid"
user="www"
group="www"
phpcgi="/usr/local/php/bin/php-cgi"
PHP_FCGI_CHILDREN=25
PHP_FCGI_MAX_REQUESTS=1000
echo_ok ()
{
echo -ne "\033[33C ["
echo -ne "\033[32m"
echo -ne "\033[1C OK"
echo -ne "\033[39m"
echo -ne "\033[1C ]\n"
}
start_spawn()
{
env - PHP_FCGI_CHILDREN=${PHP_FCGI_CHILDREN} PHP_FCGI_MAX_REQUESTS=${PHP_FCGI_MAX_REQUESTS} /usr/local/bin/spawn-fcgi -a ${a
ddress} -p ${port} -u ${user} -g ${group} -f ${phpcgi} -P ${pidpath} 1>/dev/null
echo -ne "php-cgi start successfull"
echo_ok
}
case "$1" in
start)
if [ ! -f $pidpath ]
then
start_spawn
else
pidcount=`ps -ef |grep ${phpcgi}|wc -l`
if [ "$pidcount" -gt "1" ]
then
echo -ne "php-cgi already running "
echo_ok
else
rm -f $pidpath
start_spawn
fi
fi
;;
stop)
pid=`cat ${pidpath} 2>/dev/null`
kill ${pid} 2>/dev/null
rm -f ${pidpath} 2>/dev/null
echo -ne "php-cgi stop successfull"
echo_ok
;;
*)
echo "Usage: $0 {start|stop]}"
exit 1
esac
exit
|
#!/bin/bash # nginx Startup script for the Nginx HTTP Server # this script create it by jackbillow at 2007.10.15. # it is v.0.0.2 version. # if you find any errors on this scripts,please contact jackbillow. # and send mail to jackbillow at gmail dot com. # # chkconfig: - 85 15 # description: Nginx is a high-performance web and proxy server. # It has a lot of features, but it's not for everyone. # processname: nginx # pidfile: /usr/local/nginx/logs/nginx.pid # config: /usr/local/nginx/conf/nginx.conf nginxd=/usr/local/nginx/sbin/nginx nginx_config=/usr/local/nginx/conf/nginx.conf nginx_pid=/var/run/nginx.pid RETVAL=0 prog="nginx" # Source function library. . /etc/rc.d/init.d/functions # Source networking configuration. . /etc/sysconfig/network # Check that networking is up. [ ${NETWORKING} = "no" ] && exit 0 [ -x $nginxd ] || exit 0 # Start nginx daemons functions. start() { if [ -e $nginx_pid ];then echo "nginx already running...." exit 1 fi echo -n $"Starting $prog: " daemon $nginxd -c ${nginx_config} RETVAL=$? echo [ $RETVAL = 0 ] && touch /var/lock/subsys/nginx return $RETVAL } # Stop nginx daemons functions. stop() { echo -n $"Stopping $prog: " killproc $nginxd RETVAL=$? echo [ $RETVAL = 0 ] && rm -f /var/lock/subsys/nginx /var/run/nginx.pid } # reload nginx service functions. reload() { echo -n $"Reloading $prog: " #kill -HUP `cat ${nginx_pid}` killproc $nginxd -HUP RETVAL=$? echo } # See how we were called. case "$1" in start) start ;; stop) stop ;; reload) reload ;; restart) stop start ;; status) status $prog RETVAL=$? ;; *) echo $"Usage: $prog {start|stop|restart|reload|status|help}" exit 1 esac exit $RETVAL
|
user www www;
worker_processes 10;
error_log logs/error.log notice;
pid logs/nginx.pid;
#Specifies the value for maximum file descriptors that can be opened by this process.
worker_rlimit_nofile 51200;
events
{
use epoll;
worker_connections 51200;
}
http
{
include mime.types;
default_type application/octet-stream;
charset gb2312;
server_names_hash_bucket_size 128;
#sendfile on;
#tcp_nopush on;
keepalive_timeout 60;
tcp_nodelay on;
gzip on;
gzip_min_length 1k;
gzip_buffers 4 8k;
gzip_http_version 1.1;
gzip_types text/plain application/x-javascript text/css text/html application/xml;
server
{
listen 80;
server_name 192.168.1.2;
index index.html index.htm index.php;
root /EBS/www;
if (-d $request_filename)
{
rewrite ^/(.*)([^/])$ http://$host/$1$2/ permanent;
}
location ~ .*\.php?$
{
include fcgi.conf;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
}
log_format access '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" $http_x_forwarded_for';
access_log logs/access.log access;
}
}
|
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
# PHP only, required if PHP was built with --enable-force-cgi-redirect
#fastcgi_param REDIRECT_STATUS 200;
|
net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_keepalive_time = 300
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 1
net.ipv4.ip_local_port_range = 5000 65000
|
相关推荐
5. **配置Web服务器**:根据所使用的Web服务器(如Nginx或Apache),在配置文件中添加对FastCGI的设置,指向`spawn-fcgi`监听的端口。 **使用Spawn-Fcgi的优点** 1. **效率提升**:由于FastCGI进程保持持久化,...
### 基于CentOS 5.4搭建nginx+php+spawn-fcgi+mysql高性能PHP平台 #### 平台概述 在《基于CentOS 5.4搭建nginx+php+spawn-fcgi+mysql高性能php平台》这篇技术文章中,作者哈密瓜详细介绍了如何在CentOS 5.4上构建一...
`spawn-fcgi`是由lighttpd项目开发的一个小型工具,但它也可以与其他Web服务器配合使用,包括Nginx。 FastCGI是一种持久的、进程式的接口,用于在Web服务器和处理动态内容的应用程序之间通信。与传统的CGI相比,...
使用Nginx+fcgiwrap+Git配置一台Git服务器,压缩包内包含fcgiwrap和spawn-fcgi源代码,Nginx配置文件,Fcgiwarp服务启动文件。
`spawn-fcgi` 是 FastCGI 进程管理器的一个实现,主要用在 nginx 和 lighttpd 等 Web 服务器上,用于启动、管理和控制 FastCGI 应用程序,比如 PHP-FPM 或者其他语言的 FastCGI 服务。`spawn-fcgi-1.6.3_arm.tar.gz`...
`spawn-fcgi-1.6.4.tar.gz` 是一个用于C++开发FastCGI应用程序的管理工具,其核心功能是管理和启动FastCGI进程。FastCGI是一种通信协议,它允许Web服务器与外部应用程序(如PHP、Python或Ruby解释器)进行长时间连接...
在本文中,我们将深入探讨如何在CentOS 6.3系统上使用Yum安装PHP、spawn-fcgi、Nginx以及MySQL数据库。首先,确保你的系统已经安装了最新的CentOS 6.3版本,并完成了最基本的网络配置。 1. **系统安装与网络配置** ...
spawn-fcgi spawn-fcgi原本是lighttpd的一个用来控制php-cgi的工具,现在已从lighttpd中独立出来成为一个开源项目。我们可以用它来启动,控制,管理php-cgi的进程。使用它有诸多好处,比如我们可以将运行php-cgi的...
`spawn-fcgi` 是 FastCGI 的一个启动和管理工具,它主要用于在服务器上快速启动和管理 FastCGI 进程。FastCGI 是一种Web服务器与动态内容生成器(如PHP、Python、Perl等)之间通信的协议,相较于传统的CGI,FastCGI...
CentO11S6.3系统Yum安装php+spawn-fcgi+nginx和数据库mysql详细教程.pdf
CentO11S6.3系统Yum安装php+spawn-fcgi+nginx和数据库mysql详细教程.docx
内部包含xxfpm以及spawn-fcgi.exe,解压后根据需要选择其一即可,对于windows平台下nginx+php-cgi环境没有请求时php-cgi会自动释放的情况的解决方案,不明白的可自行百度查询相关资料,两个软件在windows Server 2003...
例如,可以设置spawn-fcgi监听特定端口,然后Web服务器(如Nginx或Lighttpd)通过FastCGI协议与之通信。 5. 在Web服务器的配置文件中,指定使用spawn-fcgi启动的应用程序和连接参数,完成FastCGI的集成。 总的来说...
我是用lighttpd+nginx+spawn-fcgi+fcgi-2.4.1搭建环境。使用C语言编写后台程序。goahead也可以用。apt install lighttpdapt install nginxapt install spawn-fcgitar -xjvf fcgi-2.4.1-SNAP-0910052249.tar.bz2cd ...
使用 /opt/bin/ipkg install spawn-fcgi 命令可以安装 spawn-fcgi 软件包。 十三、配置 php 在本步骤中,我们需要配置 php 服务器。使用 vi 命令可以编辑 php.conf 文件,并将cgi.fix_pathinfo=1 语句添加到文件中...
PHP-FPM(PHP FastCGI Process Manager)是PHP的一个补丁,它将FastCGI进程管理集成到PHP中,替代了传统的spawn-fcgi。PHP-FPM能够更智能地管理PHP进程,根据需要启动和终止PHP-CGI进程,从而减少内存占用并提高响应...
5. **配置Web服务器**:接下来,你需要配置你的Web服务器(如Nginx或lighttpd)来与spawn-fcgi管理的FastCGI进程通信。对于Nginx,你将在server块中添加如下配置: ``` location ~ \.php$ { fastcgi_pass ...
spawn-fcgi -a 127.0.0.1 -p 9000 -C 10 -u www-data -f /usr/bin/php-cgi ``` 然后,创建一个自启动脚本来管理PHP-CGI服务: ```bash cd /etc/init.d cp nginx php-cgi sudo gedit php-cgi ``` 将文件中的“nginx”...
运行`spawn-fcgi`命令,指定IP地址、端口、连接数以及PHP解释器的位置,例如`spawn-fcgi -a 127.0.0.1 -p 9000 -C 10 -u www-data -f /usr/bin/php-cgi`。为了使PHP-CGI在开机时自动启动,可以创建一个启动脚本,将...