免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2607 | 回复: 0
打印 上一主题 下一主题

Freebsd7+nginx+php+mysql+sablog [复制链接]

论坛徽章:
2
丑牛
日期:2013-09-29 09:47:222015七夕节徽章
日期:2015-08-21 11:06:17
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-11-04 10:20 |只看该作者 |倒序浏览
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
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP