Onepage活动平台安装部署文档
一、环境安装
环境要求:
nginx、mysql、memcached-server、php5、php-mysqli、php5-memcahced
可以使用dm编排工具安装(需要docker支持):
- mkdir -p /data/
- cd /data
- git clone https://github.com/shemic/dm
- cd dm
- chmod +x install
- ./install
- dm run onepage
- dp install php5_memcached
- cd /data/dm/container/web/
- git clone http://git.dever.cc:3000/other/onepage.git
- cd onepage
二、修改php配置
1、复制project/op_dever,命名为你的项目名,如命名为project/my
2、修改project/my/config.inc.php
2.1、更改$cdn_host = 'op_cdn.5dev.cn';静态资源域名配置
2.2、更改'App_Id' => 'http://op_dever.5dev.cn/',项目域名配置
2.3、更改数据库配置:mysqli://root:123456@web-mysql:3306
2.4、更改缓存配置:array('onepage-memcached', 11211, 1)
2.5、更改微信配置:wechat_cfg
2.6、如果有passport系统,更改passport配置,如果没有,不要修改
2.7、修改kissy/ cfg-min.js文件,将里面的域名改为$cdn_host一样的配置
三、增加nginx配置:
将op_dever.5dev.cn、op_cdn.5dev.cn、5dev.cn改为你的域名即可
- server {
- server_name op_dever.5dev.cn;
- listen 80;
- allow all;
- autoindex off;
- set $charset utf-8;
- charset $charset;
- set $rootdir /www/onepage/project;
- if ( $host ~* "^([^.]+).5dev.cn$" ) {
- set $project $1;
- }
- set $rootdir $rootdir/$project;
- root $rootdir;
- index index.php index.html;
- location = /favicon.ico {
- log_not_found off;
- access_log off;
- root /www/onepage/kissy;
- }
- rewrite ^/admin$ /index.php?c=admin_index last;
- rewrite ^/$ /index.php?c=index last;
- location = /kissy-versions.php {
- root /www/onepage/kissy;
- rewrite ^/kissy-versions.php$ /versions.js break;
- expires 10m;
- }
- location / {
- # First attempt to serve request as file, then
- # as directory, then fall back to displaying a 404.
- try_files $uri $uri/ =404;
- # Uncomment to enable naxsi on this location
- # include /etc/nginx/naxsi.rules
- }
- location ~ ^(.*)$ {
- fastcgi_split_path_info ^(.+.php)(/.+)$;
- # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
- # With php-cgi alone:
- #fastcgi_pass web-php7:9000;
- fastcgi_pass web-php5:9000;
- # With php-fpm:
- #fastcgi_pass unix:/var/run/php7-fpm.sock;
- fastcgi_index index.php;
- fastcgi_param SCRIPT_FILENAME $rootdir/index.php;
- include fastcgi_params;
- }
- }
- server {
- listen 80;
- server_name op_cdn.5dev.cn;
- allow all;
- autoindex off;
- root /www/onepage/kissy;
- #concat on;
- #concat_max_files 40;
- location / {
- add_header Access-Control-Allow-Origin *;
- # First attempt to serve request as file, then
- # as directory, then fall back to displaying a 404.
- try_files $uri $uri/ =404;
- # Uncomment to enable naxsi on this location
- # include /etc/nginx/naxsi.rules
- expires 1h;
- }
- }
重启nginx服务
四、导入数据库:
导入doc下的两个sql,需要建立两个数据库来保存,分别和config.inc.php里的db里的onepage_v1和onepage_v1_dever相对应
五、权限设置:
- mkdir tm/compile_dir
- chmod 777 tm/compile_dir/
- chomd -R 777 kissy/public/upload/
六、设置管理员:
1、修改project/my/index.php里的KIF_CREATE常量改为false,访问你的域名:域名/admin,进入后台
2、先添加一个平台,再添加一个管理员
3、将KIF_CREATE常量改为true,刷新页面重新登录即可