Apache FastCGI / mod_fastcgi的修改脚本
时间:2014-12-05 02:39 来源:www.it.net.cn 作者:IT
本节分享的这段shell 脚本可以运行Apache 2.x的mod_fastcgi的。
本例中用到的Apache2.2,在FreeBSD系统中以源代码方式安装。
该脚本在FreeBSD及Debian / RHEL/ CentOS中测试通过。
1,
安装完成后,将php.ini放在cgi-bin目录中,然后设置权限。
配置的mod_fastcgi的httpd.conf如下:
<VirtualHost *:80>
ServerAdmin webmaster@it.net.cn
DocumentRoot "/websites/home/it.net.cn/http"
ServerName www.it.net.cn
ServerAlias it.net.cn.
ErrorLog "/websites/home/it.net.cn.logs/error.log"
CustomLog "/websites/home/it.net.cn/logs/access.log" common
ScriptAlias /cgi-bin/ "/websites/home/it.net.cn/cgi-bin/"
<Directory "/websites/home/it.net.cn/http">
Options -Indexes FollowSymLinks +ExecCGI
AllowOverride AuthConfig FileInfo
AddHandler php5-fastcgi .php
Action php5-fastcgi /cgi-bin/php.cgi
Order allow,deny
Allow from all
</Directory>
<Directory "/websites/home/it.net.cn/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
#SuExecUserGroup jbxue.comUser jbxueGroup
</VirtualHost>
2,shell脚本
#!/bin/sh
#
# Apache 2.x中运行 PHP5 中的 mod_fastcgi
### Set PATH ###
PHP_CGI=/usr/local/bin/php-cgi
PHP_FCGI_CHILDREN=4
PHP_FCGI_MAX_REQUESTS=1000
### no editing below ###
export PHP_FCGI_CHILDREN
export PHP_FCGI_MAX_REQUESTS
exec $PHP_CGI
(责任编辑:IT)
本节分享的这段shell 脚本可以运行Apache 2.x的mod_fastcgi的。
1,
<VirtualHost *:80>
ServerAdmin webmaster@it.net.cn DocumentRoot "/websites/home/it.net.cn/http" ServerName www.it.net.cn ServerAlias it.net.cn. ErrorLog "/websites/home/it.net.cn.logs/error.log" CustomLog "/websites/home/it.net.cn/logs/access.log" common ScriptAlias /cgi-bin/ "/websites/home/it.net.cn/cgi-bin/" <Directory "/websites/home/it.net.cn/http"> Options -Indexes FollowSymLinks +ExecCGI AllowOverride AuthConfig FileInfo AddHandler php5-fastcgi .php Action php5-fastcgi /cgi-bin/php.cgi Order allow,deny Allow from all </Directory> <Directory "/websites/home/it.net.cn/cgi-bin"> AllowOverride None Options None Order allow,deny Allow from all </Directory> #SuExecUserGroup jbxue.comUser jbxueGroup </VirtualHost>
2,shell脚本
#!/bin/sh
# # Apache 2.x中运行 PHP5 中的 mod_fastcgi ### Set PATH ### PHP_CGI=/usr/local/bin/php-cgi PHP_FCGI_CHILDREN=4 PHP_FCGI_MAX_REQUESTS=1000 ### no editing below ### export PHP_FCGI_CHILDREN export PHP_FCGI_MAX_REQUESTS exec $PHP_CGI (责任编辑:IT) |