搭建PSI
进入主题,PSI的安装过程:
1-源码下载地址:http://git.oschina.net/crm8000/PSI
2-下载以后上传到网站的根目录,进行解压,解压以后的文件目录如下
# cd /web/test.psi.com/wwwroot# ls -l
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 修改function PSI_getUser和PSI_getPassword 中的return 值如下图
修改以上两个地方,其他不变,保存退出。
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.confset $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-浏览器测试访问
因本文不是用Markdown格式的编辑器书写的,转换的页面可能不符合MIP标准。