- 论坛徽章:
- 2
|
1.install
mysql
#cd /usr/ports/databases/mysql50-server
#make install clean
#/usr/local/bin/mysql_install_db --user=mysql &
#chown mysql:mysql /var/db/mysql]
#mysqld_safe --user=mysql &
2.install php5(
编译
时加入fastcgi支持)
#cd /usr/ports/lang/php5
#make install clean
#cd /usr/ports/lang/php5-extensions
#make install clean
3.install
nginx
#cd /usr/ports/www/nginx
#make install clean
4.编译lighttpd,取spawn-fcgi
#cd /usr/ports/www/lighttpd
#make
#cd ./work/lighttpd-1.4.18/src
#cp spawn-fcgi /usr/local/bin
5.改
php
.ini文件
register_globals=on
safe_mode=on
cgi.fix_pathinfo=1
如果要打开GD等扩展选项,在编译php5-extensions时把相应的支持加进去
然后在/usr/local/etc/php/extensions.ini中加入相应的支持库。
6.nginx.conf
location ~ \ .php${
fastgi_pass 127.0.0.1:8888;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/local/www/nginx$fastcgi_script_name;
include fastcgi_prams;
7.启动nginx
#nginx -c /usr/local/etc/nginx/nginx.conf
8.用spawn-fcgi 启动php-cgi
#spawn-fcgi -a 127.0.0.1 -p 8888 -C 25 -u www -f /usr/local/bin/php-cgi
8888为端口号,25为进程数
9.测试phpinfo()
文件
10.安装
sablog
sablog-x在nginx下的URLrewrite,根目录是/usr/local/www/nginx
location / {
index index.php index.html index.htm;
rewrite ^/blog/show-([0-9]+)-([0-9]+)\.html$ /blog/index.php?action=show&id=$1&page=$2 last;
rewrite ^/blog/category-([0-9]+)-([0-9]+)\.html$ /blog/index.php?action=index&cid=$1&page=$2 last;
rewrite ^/blog/archives-([0-9]+)-([0-9]+)\.html$ /blog/index.php?action=index&setdate=$1&page=$2 last;
rewrite ^/blog/(archives|search|reg|login|index|links)\.html$ /blog/index.php?action=$1 last;
rewrite ^/blog/(comments|tagslist|trackbacks|index)-([0-9]+)\.html$ /blog/index.php?action=$1&page=$2 last;
}
当出现些错误时:
错误:Warning: session_start() [function.session-start]: SAFE MODE Restriction in effect. The script. whose uid is 80 is not allowed to access /var/tmp/ owned by uid 0 in /usr/local/www/nginx-dist/blog/index.php on line 38.
Fatal error: session_start() [function.session-start]: Failed to initialize storage module: files (path: ) in /usr/local/www/nginx-dist/blog/index.php on line 38
解决:在php.ini中打开
session
.save_path="/tmp"
11.状态
监控
在URLWrite后面加上
location /status {
stub_status on;
access_log off;
}
12.安装xcache
#cd /usr/ports/www/xcache
#make install clean
#cp /usr/local/share/examples/xcache/xcache.ini /usr/local/etc/php
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/4206/showart_1358972.html |
|