Freebsd7+nginx+php+mysql+sablog

2009-05-13 15:20:49来源:未知 阅读 ()

新老客户大回馈,云服务器低至5折

1.install
[url=javascript:;]mysql[/url]
#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(
[url=javascript:;]编译[/url]
时加入fastcgi支持)
#cd /usr/ports/lang/php5
#make install clean
#cd /usr/ports/lang/php5-extensions
#make install clean
3.install
[url=javascript:;]nginx[/url]
#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.改
[url=javascript:;]php[/url]
.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()
[url=javascript:;]文件[/url]
10.安装
[url=javascript:;]sablog[/url]
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.

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:Ratproxy -- Google 的 XSS 检测工具

下一篇:shenzhen massage help you to relax