portal 部署

1.需要文件:
pspm
solo-frame(需要从newborntowninc克隆)
其中pspm文件夹放在/solo-frame/app/下
solo-frame切换online分支:hg up online

2.配置环境:
配置环境所需pip包在/solo-frame/requirement.txt内。逐个安装

3.配置文件
配置文件放在/solo-frame/app/pspm/misc/config/_user下
文件命名:主机名.py
(线上程序的话需要用线上配置脚本文件)

4.生成nginx与supervisor配置文件
python /solo-frame/app/pspm/misc/config/make/make.py
会在/solo-frame/app/pspm/misc/config/下生成nginx与supervisor文件夹,里面放着配置文件。

 

5.配置nginx文件
将/solo-frame/app/pspm/misc/config/nginx/的配置文件配置进nginx内,并sudo nginx -t测试是否成功

6.配置hosts
vim /etc/hosts 添加路径 127.0.0.1 pspm.com

7.数据库需要:
mongodb与redis

8.前端软链接:
python /solo-frame/app.py

9.启动pspm:
1.启动mongodb与redis
2.启动nginx
3./solo-frame/app/pspm/下 ./dev.sh


10. jenkins部署 && marko学习:
目前 线上代码,还是 bitbucket 的online分支
jenkins pingstart: http://ci.ahaflow.com/view/pingstart/
user: ad
pwd: 2V1Xz9kNhpVLZz1SS57B

newpingstart db:10.1.5.238
newpingstart server: 10.1.5.88

new pingstart docker 命令: 1. docker ps 2. docker stop 旧容器号 3. 查log, docker logs 容器名

new pingstart 框架: tornado + mongokit + Marko + redis + mongo
http://www.igeekbar.com/igeekbar/post/117.htm

docker logs cf5d77f6408f -f -t --since "2017-06-09"

 

# pip install -r requirement.txt报错
(1) [常见错误]Python.h: No such file or directory
目录/usr/include/python2.6/缺少Python.h文件
yum install python-devel

(2) ValueError: jpeg is required unless explicitly disabled using --disable-jpeg, aborting
yum install libjpeg-turbo-devel

(3) captchaimage.c:12:22: fatal error: ft2build.h: No such file or directory
缺少freetype包
yum -y install freetype freetype-devel

(4)python /data01/solo-frame/app/new_pingstart/misc/config/make/make.py报错:
File "/data01/solo-frame/solo/_app_config_.py", line 1, in <module>
import _env;import app.pspm.misc.config
ImportError: No module named pspm.misc.config
修改:/data01/solo-frame/solo/_app_config_.py,将pspm改为new_pingstart

(5)./dev.sh报错:
File "/data01/solo-frame/app/new_pingstart/../../solo/web/boot/serve.py", line 25, in <module>
__import__('app.%s.view._url' % APP)
ImportError: No module named pingstart.view._url,将pingstart改为new_pingstart

(6)./dev.sh报错:
./dev.sh: line 10: ack: command not found
缺少ack指令,yum install ack

(7) misc/config/_user/下的配置文件需要以当前用户命名
将runtime.py改为root.py

(8)执行dev.sh报错:
Traceback (most recent call last):
File "/data01/solo-frame/app/new_pingstart/../../solo/web/boot/serve.py", line 29, in <module>
main(reversed(ROUTE_LIST), PORT_BEGIN)
File "/data01/solo-frame/app/new_pingstart/../../solo/web/boot/serve.py", line 13, in main
application = cgi.application(route, tornado.web.Application)
File "/data01/solo-frame/solo/web/cgi.py", line 24, in application
app.add_handlers(route.host, route.handlers)
File "/data01/solo-frame/solo/web/_patch/_tornado.py", line 75, in add_handlers
if self.handlers and self.handlers[-1][0].pattern == '.*$':
AttributeError: 'Application' object has no attribute 'handlers'
解决:tornado版本过高,只能安装tornado==4.3版本

(9) 访问页面报错:
File "/usr/lib/python2.7/site-packages/hmako/lookup.py", line 248, in get_template
'Cant locate template for uri %r' % uri)
TopLevelLookupException: Cant locate template for uri '/new_pingstart/login/Login.html'
ERROR:tornado.access:500 GET /logout (127.0.0.1) 1.30ms
解决:cd进入solo_frame目录,执行python app.py,会在html目录出现new_pingstart子目录

(10)nginx部署
1) 服务器配置host:127.0.0.1 test.portal.pingstart.com
2) 修改nginx配置文件
3) 客户端机器配置host:35.162.136.79 test.portal.pingstart.com

posted @ 2018-05-03 14:18  红领巾下的大刀疤  阅读(389)  评论(0)    收藏  举报
/* 看板娘 */