-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix hchq project for ubuntu 14.04 LTS
- Loading branch information
1 parent
bf2958b
commit e217618
Showing
4 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |