1. 安装各种环境
apt-get install subversion;
apt-get install python-flup;
apt-get install python-pip
apt-get install gcc
apt-get install python-imaging
apt-get install libmagickwand4
apt-get install python-django
apt-get install nginx
apt-get install python-numpy
pip install Wand
pip install poster
pip install hachoir-core
pip install hachoir-parser
pip install hachoir-metadata
2. 配置mysql允许远程连接
stop mysql
vi /etc/mysql/my.conf
#bind-address = 127.0.0.1
mysql -p
grant all on database_name.* to user_name@'%' identified by 'user_password';
start mysql
3. 签出代码
svn co yourcodeurl
4. 设置系统重启后自动执行
crontab -e
@reboot cd /home/main/open/;python manage.py runfcgi host=127.0.0.1 port=8080;nohup python pyossftp.py&
5. 配置nginx
vi /etc/nginx/nginx.conf
http{}章节加入
fastcgi_connect_timeout 3000;
fastcgi_send_timeout 3000;
fastcgi_read_timeout 3000;
fastcgi_buffers 8 16k;
fastcgi_buffer_size 32k;
client_max_body_size 20000m;
注释gzip_types 开启gzip
vi /etc/sysctl.conf
加入 kernel.shmmax = 536870912
sysctl -p
6. 安装postgresql及配置
apt-get install postgresql
apt-get install python-psycopg2
sudo -u postgres psql
ALTER USER postgres WITH PASSWORD 'yourpassword';
\q
sudo passwd -d postgres
sudo -u postgres passwd
vi /etc/postgresql/9.1/main/postgresql.conf
listen_addresses = ‘*’
password_encryption = on
max_connections = 300 #100
shared_buffers = 240MB #24
max_locks_per_transaction = 256 #164
vi /etc/postgresql/9.1/main/pg_hba.conf
host all all 0.0.0.0 0.0.0.0 md5
/etc/init.d/postgresql restart
psql -U postgres -h 127.0.0.1