Jimmies San
you see the django running?
Jimmies San
we need to know why it's running, before proceed
Leonardo
ubuntu@ip-172-31-85-43:~$ timedatectl status | grep "Time zone"
Time zone: Etc/UTC (UTC, +0000)
Jimmies San
so please can you netstat -tulpn | grep 8000
Leonardo
is not listening django bud, cuz i'm not running python manage.py runserver
Jimmies San
anche check what process listening on port 8000? thanks
Leonardo
ubuntu@ip-172-31-85-43:~$ netstat -tulpn | grep 8000
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp 0 0 0.0.0.0:8000 0.0.0.0:* LISTEN -
Leonardo
oops
Leonardo
let me pastebin
Jimmies San
with root, so we can see the process name
Leonardo
https://pastebin.com/Z4SUSdvZ
Leonardo
ok
Leonardo
ubuntu@ip-172-31-85-43:~$ sudo netstat -tulpn | grep 8000
tcp 0 0 0.0.0.0:8000 0.0.0.0:* LISTEN 17090/nginx: master
Jimmies San
nginx on port 8000? O_o
Jimmies San
oh
Jimmies San
fuck that
Jimmies San
server {
listen 8000;
Jimmies San
into nginx conf, no, change it to 80
Jimmies San
that's why dev can't ops 😂😂😂😂😂
Jimmies San
but ops can dev 😂😂😂😂😂
Jimmies San
flame on!!!!!
Leonardo
did and reloaded nginx
Leonardo
i'm just learning, take easy ^^
Jimmies San
i'm really taking easy: i'm not blasting you 😂😂😂
Leonardo
https://medium.com/@srijan.pydev_21998/complete-guide-to-deploy-django-applications-on-aws-ubuntu-16-04-instance-with-uwsgi-and-nginx-b9929da7b716
feel free to blast him hahaha
Leonardo
ok, so now?
Jimmies San
Jimmies San
if you really want to talk about that
Jimmies San
you want to deploy without know the components, but nevermind ;)
Jimmies San
ok, so now?
we need to check why nginx don't find uwsgi process
Jimmies San
it can't access so uwsgi socket inside home
Jimmies San
we can do two things: first one - check if uwsgi works. second one: fix uwsgi socket
Jimmies San
for the first: systemctl stop the uwsgi server
Jimmies San
move into etc uwsgi sites and
Jimmies San
uwsgi --ini config.ini
Jimmies San
[we do it manually to check if there are any errors, after this we will fix the uwsgi systemd]
Leonardo
ok, did
Leonardo
https://pastebin.com/9vBm1usq
Leonardo
maybe we need to stop nginx service to remove the socket?
Jimmies San
remove it
Jimmies San
no, nginx doesn't create socket. uwsgi does
Jimmies San
nginx connect to socket
Leonardo
ok
Jimmies San
then, tune the uwsgi config, add inside it
uid = ubuntu
gid = ubuntu
Jimmies San
then retry the last uwsgi —ini command
Leonardo
omg, has .sock files everywhere
Leonardo
ok, removed them
Leonardo
Jimmies San
ok
Jimmies San
now we have ana mazing 502 on nginx
Leonardo
wait
Jimmies San
:D
Leonardo
i forgot to use uwsgi ini
Jimmies San
ok, do it :)
Leonardo
same error
Leonardo
VACUUM WARNING: unix socket /home/ubuntu/ambiente_er/ambiente_er.sock changed inode. Skip removal
Leonardo
and i removed all of them
Leonardo
do you want make a tunnel to machine?
Jimmies San
there are some errors into uwsgi config
Jimmies San
can you give me the path of virtualenv for this project?
and the path where your app is.
the full path please
Leonardo
virtualenv path
https://pastebin.com/ka549Sew
Leonardo
project path:
https://pastebin.com/Dh9kfZin
Jimmies San
yes it's a bit a mess. source are inside venv [i really dislike this] and i don't see /media and /static dir for nginx prod [just the static inside the app]
there are a lot of things to fix ...
Leonardo
static_cdn folder is in the same path with src
Leonardo
and static/ folder is inside src
Leonardo
i made my css changes on static, and export them to static_cdn
Jimmies San
and you push the venv into git? and pull from server?
Leonardo
no no
Jimmies San
ok
Leonardo
i reinstalled again
Leonardo
i just pushed src folder and gitignore
Leonardo
neither static_cdn i pushed
Jimmies San
k
Leonardo
src/ambiente_er/ is my project folder with settings files
Leonardo
and another folders are apps and etc..
Jimmies San
need to review all better. for example into nginx conf we have uwsgi_pass unix:///home/ubuntu/ambiente_er/ambiente_er.sock;