LNMP上搭建PSI

lnmp的安装过程这边省略,可以下载lnmp一键安装包,地址 http://lnmp.org/

进入主题,PSI的安装过程:

1-源码下载地址http://git.oschina.net/crm8000/PSI

2-下载以后上传到网站的根目录,进行解压,解压以后的文件目录如下

# cd /web/test.psi.com/wwwroot
# ls -l

112432_edtX_2525829.jpg

3-创建数据库 创建库名为psi,字符集为utf8的库,授权psier用户来登录,密码为abcd.1234

mysql> create database psi character set utf8;

mysql> grant all on psi.* to 'psier'@'localhost' identified by 'abcd.1234';

4-导入初始化数据库数据

# cd doc/99\ SQL/
# mysql -upsier -h127.0.0.1 -pabcd.1234 psi < 01CreateTables.sql --导入表结构
# mysql -upsier -h127.0.0.1 -pabcd.1234 psi < 02InsertInitData.sql --导入初始化数据
# mysql -upsier -h127.0.0.1 -pabcd.1234 psi < 99psi_demo_data.sql --导入测试数据(这一步可选,我没有导入)


5-修改配置文件的数据库连接

# vim web/Application/Common/Conf/config.php

114001_YJfP_2525829.jpg

修改以上两个地方,其他不变,保存退出。

6-配置nginx.conf

server {
        listen             80;
        server_name     test.psi.com;
        root /web/test.psi.com/wwwroot;
        index           index.html index.htm default.htm index.php;
        location / {
        if (!-e $request_filename){
               rewrite ^/web/(.*)$ /web/index.php/$1 last;   #--关键的配置,支持ThinkPHP的rewrite支持
        }
        }
        location ~ .*\.php {  #--经测试,必须以去除?$结尾,去掉$是为了不匹配行末,即可以匹配.php/,以实现pathinfo
                fastcgi_pass  127.0.0.1:9000;
                fastcgi_index index.php;
                include fastcgi.conf;
                include pathinfo.conf;  #--关键的配置,支持ThinkPHP的pathinfo支持
        }
       access_log logs/test.psi.com_access.log main;
       error_log logs/test.psi.com_error.log;
}

# cat /usr/local/nginx/conf/pathinfo.conf
set $real_script_name $fastcgi_script_name;
if ($fastcgi_script_name ~ "(.+?\.php)(/.*)") {
set $real_script_name $1;
set $path_info $2;
}
fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;
fastcgi_param SCRIPT_NAME $real_script_name;
fastcgi_param PATH_INFO $path_info;

7-重启nginx

# /usr/local/nginx/sbin/nginx -s reload

8-浏览器测试访问


转载于:https://my.oschina.net/u/2525829/blog/532614

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值