Answer the question
In order to leave comments, you need to log in
Server setup for Django. Tell me what I did wrong?
Good day!
Need your help tell me what I did wrong?
This is my first time setting up a server for django. This is probably my attempt number 12 :)
Often there were errors 502 and now just Apache is showing.
I'm not a system administrator and not a backend proger so as not to be scolded :) I will soon.
Task: We need to start the server for it to work. Have VPS Ubuntu 16.04.1 LTS (GNU/Linux 2.6.32-042stab120.6 x86_64) 3 sudo apt-get update
4 sudo apt-get upgrade
6 cd /home/
7 ls
8 mkdir root
9 ls
10 clear
11 unzip o
12 cd root/
13 unzip startup.zip
14 ls
15 clear
16 cd startup
17 ls
18 pip install -r requirements.txt
19 sudo apt-get install python-pip
20 sudo pip install virtualenv
21 sudo apt-get install python-pip
22 sudo pip install virtualenv
23 pip install -r requirements.txt
24 sudo apt-get install libtiff5-dev libjpeg8-dev zlib1g-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev python-tk
25 sudo pip install -r requirements.txt
26 ls
27 cd .
28 ls 29
cd Env/
30 source startup/bin/activate
31 cd startup/
32 pip install -r requirements.txt
33 sudo pip install -r requirements.txt
34 pip install --upgrade pip
35 sudo pip install -r requirements.txt
36 python manage.py runserver 0.0.0.0:8080
37 cd ..
38 cd startup
39 ls
41 sudo apt-get install python-dev
43 pip install django= =1.8.8
50 pip install celery
52 pip install Pillow
53 python manage.py runserver 0.0.0.0:8080
54 sudo apt-get install python-dev
55 sudo pip install uwsgi
56 sudo mkdir -p /etc/uwsgi/sites
57 cd /etc/uwsgi/sites
58 sudo nano startup.ini
_____________________________________________________________
[uwsgi]
project = startup
base = /home/root
chdir = %(base)/%(project)
home = %(base)/Env/%(project)
module = %(project).wsgi:application
master = true
processes = 5
socket = %( base)/%(project)/%(project).sock
chmod-socket = 666
vacuum = true
_______________________________________________________________
59 sudo apt-get install nano
61 sudo nano /etc/init/uwsgi.conf
_______________________________________________________________
description "uWSGI application server in Emperor mode "
start on runlevel [2345]
stop on runlevel [!2345]
setuid root
setgid www-data
exec /usr/local/bin/uwsgi --emperor /etc/uwsgi/sites
62 sudo
apt-get install nginx
63 sudo ln -s /etc/nginx/sites-available/startup /etc/nginx/sites-enabled
64 sudo service nginx configtest
65 sudo service nginx restart
66 sudo service uwsgi start
67 sudo service uwsgi status
68 sudo service uwsgi restart
69 nano /etc/uwsgi/sites/startup.ini
___________________________________________
[uwsgi]
project = startup
base = /home/root
chdir = %(base)/%(project)
home = %(base)/Env /%(project)
module = %(project).wsgi:application
master = true
processes = 5
socket = %(base)/%(project)/%(project).sock
chmod-socket = 666
vacuum = true
____________________________________________
70 sudo service uwsgi restart
71 nano /etc/uwsgi/sites/startup.ini
72 nano /etc/systemd /system/uwsgi.service
73 sudo systemctl daemon-reload
74 sudo systemctl start uwsgi
75 sudo systemctl enable uwsgi
76 systemctl status uwsgi
77 sudo service uwsgi restart
78 sudo service uwsgi status
79 cd /home/root/
80 python manage.py collectstatic
81 sudo apt-get install Celery
82 sudo apt-get install celery
83 sudo nano /etc/nginx/sites-available/startup
___________________________________________________________________
server {
listen 80;
server_name xx.xx.xx.xx site.ru www.site.ru ;
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
root /home/root/project;
}
location / {
include uwsgi_params;
uwsgi_pass unix:/home/root/proekt/proekt.sock;
}
}
_________________________________________________________
84 curl xx.xx.xx.xx
85 history
86 nano /etc/uwsgi/sites/proekt.ini
87 sudo nano /etc/init/uwsgi.conf
88 cd /etc/uwsgi/sites
89 sudo nano /etc/init/uwsgi.conf
90 curl site.ru
91 ls
92 cd /home/
93 ls
94 cd root/
95 ls
96 cd proekt
97 ls
98 cd static-root/
99 ls
100 cd css
101 ls
102 cd..
103 cd ..
104 ls
105 cd static
106 ls
107 cd ..
108 ls
109 python manage.py colectstatic
110 cd /home/o
111 source /home/root/Env/proekt /bin/activate
112 python manage.py colectstatic
113 python manage.py collectstatic
114 ls
HELPED This link
serverfault.com/questions/775965/wiring-uwsgi-to-w...
Answer the question
In order to leave comments, you need to log in
Thanks everyone! figured out helped this link
serverfault.com/questions/775965/wiring-uwsgi-to-w...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question