点“Virtual Server”,进入创建虚拟主机:
Virtual Server Name:主机名
Host Name and Port:域名和端口
Server Comment:随便
Document Root:web文件放置的位置
Aliases:多域名绑定填在这里,用(,)号分隔开。
Webmaster Email Address:随便
Clone server:别理它
点击“Create Virtual Server”按钮提交。
提交后,现在将进入虚拟主机的具体配置:
点击左边的“FastCGI”
Enabling Support for FastCGI Programs:选择“Enabled"
跟着往下找到“Adding a FastCGI Remote Responder”
Directory name:填/usr/local/php/bin/php
Location: Machine name: 填localhost
Port:填8002
其他的全部不用填,点击“apply change”
进入 URL Handling 中的 Handlers 设置。在 Adding a Handler 中设置以下参数:
File Extension : php
Specify the path and filename of the handler, relative to the document root : /usr/local/php/bin/php
HTTP 404 errors are handled by : The handler
注意,这里的 Specify the path and filename of the handler, relative to the document root 应和你上一步设置的 Directory name 值相同。
都设置完成后,点击 Apply 按钮。
左边的菜单中找到“Directory Requests”
Index Files:索引文件,按自己的需要设置
Directory Listing:一定要Disabled
点击“apply change”
点击上面的“This configuration has been modified. Click here for details or to make it take effect. ”,再点击“commit”,完成了一个虚拟主机的设置。
Zeus 的安全设置
more /etc/passwd
查看nfsnobody的uid和gid号(我的uid和gid号都是65534)
然后进入Zeus的后台,找到FastCGI --> Security Configurables --> Specified uid / gid:
在uid和gid选项下填入65534,然后点击底部的Apply Changes即可。
----------------------------------------------------------------------------------------------
新建一个自启动文件
----------------------------------------------------------------------------------------------
cd /home/zeus/rc.d
kate S05php
加入以下内容
#!/bin/sh
# Script to start and stop the persistent PHP runner for FastCGI.
# Please check paths before use.
# FastCGI PHP binary
FPHPBIN=/usr/local/bin/php
# Location to place semaphore
SEMFILE=/tmp/php.pid
PHP_FCGI_CHILDREN=100
PHP_FCGI_MAX_REQUESTS=1000
export PHP_FCGI_CHILDREN
export PHP_FCGI_MAX_REQUESTS
# This is Linux - use /proc to increase the local (ephemeral) port range
#echo 1024 65000 > /proc/sys/net/ipv4/ip_local_port_range
if [ -z "$ZEUSHOME" ]
then
cd `dirname $0`/..
ZEUSHOME=`pwd`
export ZEUSHOME
fi
case "$1" in
'start')
if [ -e $SEMFILE ]
then
echo FastCGI PHP error: already running.Restart FastCGI PHP now
kill `cat $SEMFILE`
sleep 5
fi
if [ ! -x $FPHPBIN ]
then
echo FastCGI PHP error: please check that $FPHPBIN is executable and exists.
exit 1
fi