在编译时,不需再–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
|
相关推荐
spawn-fcgi spawn-fcgi原本是lighttpd的一个用来控制php-cgi的工具,现在已从lighttpd中独立出来成为一个开源项目。我们可以用它来启动,控制,管理php-cgi的进程。使用它有诸多好处,比如我们可以将运行php-cgi的...
基于CentOS 5.4搭建nginx+php+spawn-fcgi+mysql高性能php平台
spawn-fcgi源码,nginx要调用fastcgi等等一些外部程序,就需要用到spawn-fcgi来做端口绑定。
内部包含xxfpm以及spawn-fcgi.exe,解压后根据需要选择其一即可,对于windows平台下nginx+php-cgi环境没有请求时php-cgi会自动释放的情况的解决方案,不明白的可自行百度查询相关资料,两个软件在windows Server 2003...
我是用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 ...
.
同时它在处理高并发方面也比spawn-fcgi引擎好很多,因此,推荐Nginx+PHP/PHP-FPM这个组合对PHP进行解析。 FastCGI 的主要优点是把动态语言和HTTP Server分离开来,所以Nginx与PHP/PHP-FPM经常被部署在不同的服务器上...
1. 引入了 配置文件 2. 增加cookie 解析,和文件上传功能 ... 4. 支持代码高亮 ... local/spawn-fcgi/bin/spawn-fcgi -f ./cblog -s /tmp/fcgi-blog.sock 2.0版本更新说明: c-blog2.0 依赖这些 第三方库
通过web实现文件上传功能,后台需要部署FASTCGI、Nginx、spawn-fcgi、FASTDFS。
window下可用的cgi程序 在window下,配合nginx和spawn-fcgi使用,内附源码和使用方法。
邓州论坛FastCGI博客系统,采用html template技术, 模板修改起来就跟php的模板一样简单。 邓州论坛FastCGI博客系统 2.0 版本更新说明: ...local/spawn-fcgi/bin/spawn-fcgi -f ./cblog -s /tmp/fcgi-blog.sock
搭建nginx-1.16.1 1.安装 gcc 环境 yum -y install gcc gcc-c++ #nginx编译时依赖gcc环境 2.安装 pcre yum -y install pcre pcre-devel #让nginx支持重写功能 3.安装 zlib yum -y install zlib zlib-devel #zlib库...
WebFaction 私有应用程序栈shell 脚本webfaction.sh将自动构建和配置您自己的私有Ruby on Rails堆栈。 它是为用户编写的,但相当通用。...client、memcached php (+ spawn-fcgi) [可选,参见INSTALL_PHP
与广泛使用的 Urban Legend 相反, Lighttpd的spawn-fcgi程序不需要 PHP FastCGI 进程在必要时生成新实例。 此脚本是运行 PHP FastCGI 守护程序所需的全部内容。特征使用/etc/default/php-cgi文件指定是使用 UNIX ...
然后在利用ngnix反向代理服务器,接收并处理用户的请求,其中还使用了FastCGI+spawn-fcgi配合nginx工作; 然后呢还用到了MySQL和Redis数据库,其中MySQL用于存储文件的信息,Redis呢主要用于存储用户注册登录之类的...
fcgi:用spawn-fcgi或者框架自带的工具对各个project分别生成监听进程,然后和http服务互动。 wsgi:利用http服务的mod_wsgi模块来跑各个project。 不过还有个uwsgi,它既不用wsgi协议也不用fcgi协议,而是自创了...
1.7.3 spawn-fcgi与PHP-FPM 1.7.4 PHP与PHP-FPM的安装及优化 1.7.5 配置Nginx来支持PHP 1.7.6 测试Nginx对PHP的解析功能 1.7.7 优化Nginx中FastCGI参数的实例 1.8 实战Nginx与Perl、Java的安装与配置 ...