目录

网站部署记录

目录

网站部署记录

安装基础python环境

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
sudo apt-get install nginx
sudo apt-get install git
sudo apt-get install mysql-server
sudo apt-get install python-dev
install easy_install on ubuntu:
sudo apt-get install python-setuptools
sudo easy_install virtualenv
sudo easy_install pip
virtualenv ~/trade
source ~/trade/bin/activate
install numpy scipy pandas and ta-lib
sudo pip install Cython

安装 blas libs

1
2
3
sudo apt-get install gfortran libopenblas-dev liblapack-dev g++
pip install numpy
pip install scipy

安装 ta-lib

1
2
3
4
5
6
7
8
cd ~
wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz
sudo apt-get  install  build-essential
tar -zxvf ta-lib-0.4.0-src.tar.gz
cd ta-lib-0.4.0
./configure --prefix=/usr
make
sudo make install

安装 gevent

1
2
3
4
5
6
7
8
wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
tar -zxvf 
./configure
make 
sudo make install
cd ~/www
git clone https://github.com/pydata/pandas.git
git clone https://github.com/mrjbq7/ta-lib.git

update the nginx

1
2
3
4
5
sudo apt-get install python-software-properties
sudo apt-get install sotware-properties-common
sudo add-apt-repository ppa:nginx/stable
sudo apt-get update
sudo apt-get install nginx

mysql init

1
2
3
sudo apt-get install mysql-server libmysqld-dev
pip install MySQL-python
insert into mysql.user(Host,User,Password) values("localhost","username",password("password"));

用户授权
给本地用户mql分配可对所有数据库的所有表进行所有操作的权限,并设定口令为123456。

1
mysql>grant all privileges on *.* to [email protected] identified by 'password';

安装 redis
具体参考install redis

安装uwsgi 或者 gunicorn(可选)