yum install git gcc libcurl libcurl-devel openssl-devel sqlite3-devel postgresql-devel libcurl libcurl-devel libevent libevent-devel vim -y
wget https://www.python.org/ftp/python/3.5.1/Python-3.5.1.tgz
tar xvf Python-3.5.1.tgz
cd Python-3.5.1/
./configure
make
make install
为了相互隔离,pyvenv虚拟环境
pyvenv ~/env
source ~/env/bin/activate
wget https://bootstrap.pypa.io/get-pip.py
python get-pip.py
安装 postgresql,为了链接阿里云云数据库
pip install psycopg2
pip install -r requirements.txt
安装libcurl
export PYCURL_SSL_LIBRARY=nss
(env) [root@iZ25o80y1kgZ yushan2]# 23
修改操作系统的网络队列长度
vim /etc/sysctl.conf
加上:
net.core.somaxconn = 32768
修改完成后,重启电脑
下载yushan2, 并安装所有安装包
cd /root
git clone git@github.com:solaris-meng/yushan2.git
cd yushan2
pip install -r requirements.txt
pip install requests
git clone git@github.com:linsomniac/python-memcached.git
安装nginx
yum install nginx -y
cp nginx.conf /etc/nginx/
nginx
git clone git@github.com:linsomniac/python-memcached.git
yum install libmemcached
yum install memcached
memcached -m 20m -d -u root
启动羽扇
source ~/env/py3env/bin/activate
cd ~/yushan2
python manage.py collectstatic
./r
./r
在浏览器输入IP,查看是否能够打开羽扇网站