Skip to content
This repository was archived by the owner on Feb 28, 2019. It is now read-only.
This repository was archived by the owner on Feb 28, 2019. It is now read-only.

尝试在 nginx 环境下部署了 zmirror. #36

@phuslu

Description

@phuslu

操作系统: Ubuntu 16.04 LTS
前置要求: 已经安装了 nginx 并配置了域名和 SSL 证书。

安装的命令:

# 安装系统必须的 python 环境
sudo apt install python-virtaulenv python-dev python-pip
# 克隆 zmirror 到 /opt 目录
git clone https://github.com/aploium/zmirror /opt/zmirror
cd /opt/zmirror
# 创建 virtualenv
virtualenv -p python3 venv
# 安装 gunicron
./venv/bin/pip install -i https://pypi.douban.com/simple gunicorn gevent
# 安装 zmirror 自身依赖
./venv/bin/pip install -i https://pypi.douban.com/simple -r requirements.txt
# 编辑 config.py
cp more_configs/config_google_and_zhwikipedia.py config.py
echo -e  '\nverbose_level = 1' >config.py
sed -ir 's/my_host_name =.+/my_host_name = "你的域名"/g' config.py
# 启动 zmirror 服务器
./venv/bin/gunicorn --daemon --capture-output --log-file zmirror.log --access-logfile zmirror-access.log --bind 127.0.0.1:8001 --workers 2 --worker-connections 100 wsgi:application

好了,这样 zmirror 已经在本地 8001 HTTP 端口跑起来了,接下里就可以编辑 nginx.conf 转发给它了。这个就不再赘述。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions