首先准备好域名和SSL
# 安装系统必须的 python 环境
yum install -y epel-release rpm -Uvh https://centos6.iuscommunity.org/ius-release.rpm yum install -y python35u python35u-devel wget git curl yum groupinstall "Development tools" -y wget --no-check-certificate https://bootstrap.pypa.io/get-pip.py -O - | python3.5 pip3 install -r https://github.com/aploium/zmirror/raw/master/requirements.txt yum install -y python-devel python-pip python-tools python-virtualenv
# 克隆 zmirror 到 /opt 目录
git clone https://github.com/aploium/zmirror /opt/zmirror cd /opt/zmirror
# 创建 virtualenv
pip3 install virtualenv virtualenv -p /usr/bin/python3.5 venv source venv/bin/activate
# 安装 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