-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.sh
executable file
·33 lines (28 loc) · 1.17 KB
/
init.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env bash
#rm /etc/nginx/sites-enabled/default
#ln -sf /home/box/web/etc/nginx.conf /etc/nginx/sites-enabled/test.conf
##/etc/init.d/nginx restart
#mkdir /etc/gunicorn.d
#ln -sf /home/box/web/etc/gunicorn.conf /etc/gunicorn.d/test.conf
#ln -sf /home/box/web/etc/gunicorn.conf /etc/gunicorn.d/test.conf
##/etc/init.d/gunicorn restart
#gunicorn -c /etc/gunicorn.d/test.conf hello:app &
#cd /home/box/web/ask
#gunicorn -c /home/box/web/etc/django_gunicorn.conf ask.wsgi:application &
sudo rm /etc/nginx/sites-enabled/default
sudo ln -sf /home/box/web/etc/nginx.conf /etc/nginx/sites-enabled/test.conf
sudo /etc/init.d/nginx restart
sudo ln -sf /home/box/web/etc/gunicorn.conf /etc/gunicorn.d/test-wsgi
sudo ln -sf /home/box/web/etc/django_gunicorn.conf /etc/gunicorn.d/test-django
sudo /etc/init.d/gunicorn restart
sudo /etc/init.d/mysql start
mysql -uroot -e "CREATE DATABASE qabase;"
mysql -uroot -e "CREATE USER 'qauser'@'localhost' IDENTIFIED BY '123456';"
mysql -uroot -e "GRANT ALL ON qabase.* TO 'qauser'@'localhost';"
cd ask/ask
./manage.py makemigrations qa
./manage.py migrate
echo "INIT DONE!"
# pacman -Syy && pacman -Syu
# sudo pacman -S mysql
# pip install mysqlclient