警告
本文最后更新于 2022-12-11,文中内容可能已过时。
1.安装selenium
chrome安装
1
2
3
4
| sudo apt-get install libxss1 libappindicator1 libindicator7
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i ./google-chrome*.deb
sudo apt-get install -f
|
配置chromedriver
(1)下载驱动
去官网下载:http://chromedriver.storage.googleapis.com/index.html
点击
(2)安装驱动
复制到对应的目录运行
配置selenium
2.安装uwsgi
配置文件uwsgi.ini
1
2
3
4
5
6
7
8
9
10
| #uwsgi.ini
[uwsgi]
http = 0.0.0.0:8010
chdir = /home/jianli/resume_service/services
pythonpath = /home/jianli/venv/bin/python
wsgi-file = resume_parser.py
buffer-size = 40960
callable = app
processes = 1
stats = 127.0.0.1:9191
|
安装和运行uwsgi
1
2
| pip install uwsgi
uwsgi uwsgi.ini
|
3.安装supervisor
配置supervisor
1
2
3
4
| http://supervisord.org/installing.html
pip install supervisor
echo_supervisord_conf > supervisord.conf
supervisord -c supervisor.conf
|
启动停止supervisor
1
2
3
| supervisorctl update 重新加载配置
supervisorctl reload 重新启动所有程序
supervisorctl status 查看状态
|
supervisor问题
1.supervisorctl出现http://localhost:9001 refused connection
设置serverurl:
1
2
3
4
5
6
7
| [supervisorctl]
serverurl=unix:///tmp/supervisor.sock ; use a unix:// URL for a unix socket
;serverurl=http://127.0.0.1:9001 ; use an http:// url to specify an inet socket
;username=chris ; should be same as http_username if set
;password=123 ; should be same as http_password if set
;prompt=mysupervisor ; cmd line prompt (default "supervisor")
;history_file=~/.sc_history ; use readline history if availabl
|
2.supervisord配置uwsgi后,调用接口会启动新的服务
重新设置uwsgi如下:
1
2
3
4
5
6
7
8
| [uwsgi]
http = 0.0.0.0:8010
virtualenv = /home/jianli/venv
wsgi-file = /home/jianli/resume_service/services/resume_parser.py
buffer-size = 40960
callable = app
processes = 1
thread = 1
|
4.安装libreoffice
下载安装
1
| wget https://mirrors.cloud.tencent.com/libreoffice/libreoffice/stable/7.1.5/deb/x86_64/LibreOffice_7.1.5_Linux_x86-64_deb.tar.gz
|
(安装说明)[https://zh-cn.libreoffice.org/get-help/install-howto/]
字体安装
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
| wget https://mirrors.tuna.tsinghua.edu.cn/adobe-fonts/source-han-serif/SubsetOTF/SourceHanSerifCN.zip
wget https://mirrors.tuna.tsinghua.edu.cn/adobe-fonts/source-han-sans/SubsetOTF/CN/SourceHanSansCN-Bold.otf
wget https://mirrors.tuna.tsinghua.edu.cn/adobe-fonts/source-han-sans/SubsetOTF/CN/SourceHanSansCN-ExtraLight.otf
wget https://mirrors.tuna.tsinghua.edu.cn/adobe-fonts/source-han-sans/SubsetOTF/CN/SourceHanSansCN-Heavy.otf
wget https://mirrors.tuna.tsinghua.edu.cn/adobe-fonts/source-han-sans/SubsetOTF/CN/SourceHanSansCN-Light.otf
wget https://mirrors.tuna.tsinghua.edu.cn/adobe-fonts/source-han-sans/SubsetOTF/CN/SourceHanSansCN-Medium.otf
wget https://mirrors.tuna.tsinghua.edu.cn/adobe-fonts/source-han-sans/SubsetOTF/CN/SourceHanSansCN-Normal.otf
wget https://mirrors.tuna.tsinghua.edu.cn/adobe-fonts/source-han-sans/SubsetOTF/CN/SourceHanSansCN-Regular.otf
unzip SourceHanSerifCN.zip
mv SourceHanSerifCN SourceHan
mv *.otf SourceHan
sudo mv SourceHan /usr/share/fonts
mkfontscale
fc-cache -fv
# 如果提示 fc-cache: command not found
# 在Ubuntu下运行如下命令
# sudo apt-get install fontconfig
# 在cent os下运行如下命令
# yum install fontconfig
|