Home
rabin редактира тази страница преди 6 години

Onepage活动平台安装部署文档

一、环境安装 环境要求: nginx、mysql、memcached-server、php5、php-mysqli、php5-memcahced

可以使用dm编排工具安装(需要docker支持):

  1. mkdir -p /data/
  2. cd /data
  3. git clone https://github.com/shemic/dm
  4. cd dm
  5. chmod +x install
  6. ./install
  7. dm run onepage
  8. dp install php5_memcached
  9. cd /data/dm/container/web/
  10. git clone http://git.dever.cc:3000/other/onepage.git
  11. 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改为你的域名即可

  1. server {
  2. server_name op_dever.5dev.cn;
  3. listen 80;
  4. allow all;
  5. autoindex off;
  6. set $charset utf-8;
  7. charset $charset;
  8. set $rootdir /www/onepage/project;
  9. if ( $host ~* "^([^.]+).5dev.cn$" ) {
  10. set $project $1;
  11. }
  12. set $rootdir $rootdir/$project;
  13. root $rootdir;
  14. index index.php index.html;
  15. location = /favicon.ico {
  16. log_not_found off;
  17. access_log off;
  18. root /www/onepage/kissy;
  19. }
  20. rewrite ^/admin$ /index.php?c=admin_index last;
  21. rewrite ^/$ /index.php?c=index last;
  22. location = /kissy-versions.php {
  23. root /www/onepage/kissy;
  24. rewrite ^/kissy-versions.php$ /versions.js break;
  25. expires 10m;
  26. }
  27. location / {
  28. # First attempt to serve request as file, then
  29. # as directory, then fall back to displaying a 404.
  30. try_files $uri $uri/ =404;
  31. # Uncomment to enable naxsi on this location
  32. # include /etc/nginx/naxsi.rules
  33. }
  34. location ~ ^(.*)$ {
  35. fastcgi_split_path_info ^(.+.php)(/.+)$;
  36. # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
  37. # With php-cgi alone:
  38. #fastcgi_pass web-php7:9000;
  39. fastcgi_pass web-php5:9000;
  40. # With php-fpm:
  41. #fastcgi_pass unix:/var/run/php7-fpm.sock;
  42. fastcgi_index index.php;
  43. fastcgi_param SCRIPT_FILENAME $rootdir/index.php;
  44. include fastcgi_params;
  45. }
  46. }
  47. server {
  48. listen 80;
  49. server_name op_cdn.5dev.cn;
  50. allow all;
  51. autoindex off;
  52. root /www/onepage/kissy;
  53. #concat on;
  54. #concat_max_files 40;
  55. location / {
  56. add_header Access-Control-Allow-Origin *;
  57. # First attempt to serve request as file, then
  58. # as directory, then fall back to displaying a 404.
  59. try_files $uri $uri/ =404;
  60. # Uncomment to enable naxsi on this location
  61. # include /etc/nginx/naxsi.rules
  62. expires 1h;
  63. }
  64. }

重启nginx服务

四、导入数据库: 导入doc下的两个sql,需要建立两个数据库来保存,分别和config.inc.php里的db里的onepage_v1和onepage_v1_dever相对应

五、权限设置:

  1. mkdir tm/compile_dir
  2. chmod 777 tm/compile_dir/
  3. chomd -R 777 kissy/public/upload/

六、设置管理员: 1、修改project/my/index.php里的KIF_CREATE常量改为false,访问你的域名:域名/admin,进入后台 2、先添加一个平台,再添加一个管理员 3、将KIF_CREATE常量改为true,刷新页面重新登录即可