Skip to content

Commit

Permalink
Fix hchq project for ubuntu 14.04 LTS
Browse files Browse the repository at this point in the history
  • Loading branch information
bright-pan committed Sep 11, 2014
1 parent bf2958b commit e217618
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 0 deletions.
48 changes: 48 additions & 0 deletions INSTALL
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
deb http://debian.ustc.edu.cn/ubuntu/ trusty main restricted universe multiverse
deb http://debian.ustc.edu.cn/ubuntu/ trusty-security main restricted universe multiverse
deb http://debian.ustc.edu.cn/ubuntu/ trusty-updates main restricted universe multiverse
deb http://debian.ustc.edu.cn/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://debian.ustc.edu.cn/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://debian.ustc.edu.cn/ubuntu/ trusty main restricted universe multiverse
deb-src http://debian.ustc.edu.cn/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://debian.ustc.edu.cn/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://debian.ustc.edu.cn/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://debian.ustc.edu.cn/ubuntu/ trusty-backports main restricted universe multiverse

sudo apt-get update

sudo apt-get install nginx

sudo apt-get install memcached
sudo apt-get install python-memcache

sudo apt-get install mysql-server
(User:root,Password:2011)
sudo apt-get install mysql-client
sudo apt-get install mysql-workbench
sudo apt-get install python-mysqldb

sudo apt-get install python-pip
sudo apt-get install python-setuptools

sudo apt-get install python-lxml
sudo apt-get install python-pil
sudo apt-get install python-reportlab
sudo apt-get install python-greenlet
sudo apt-get install python-gevent

sudo pip install pygal
sudo pip install pillow
sudo pip install geraldo
sudo pip install django-cache-machine
sudo pip install django==1.4.15

copy photo to hchq/static/images/

import hchq database to mysql

configure nginx for hchq

configure crontab for mysql backup

30 23 * * * cd ~/hchq/mysql_backup && ./mysql_backup.sh
1 change: 1 addition & 0 deletions mysql_backup/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.gz
8 changes: 8 additions & 0 deletions mysql_backup/mysql_backup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
filename=`date +%Y%m%d`

mysqldump -uroot -p2011 hchq | gzip > hchq-$filename.sql.gz

cd ../static/images/
tar czf ../../mysql_backup/photos.tar.gz photos
tar czf ../../mysql_backup/thumbnails.tar.gz thumbnails

12 changes: 12 additions & 0 deletions server-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

cd ~/hchq
sudo pkill memcached
sudo pkill mysqld
sudo pkill nginx
sudo pkill python

sudo /etc/init.d/memcached restart
sudo /etc/init.d/mysql restart
sudo /etc/init.d/nginx restart
python server.py

0 comments on commit e217618

Please sign in to comment.