if I do systemctl start nginx, it just goes to the next empty line, without letting server to work, like so:
[[/home/sc/pro]]# systemctl start nginx
[[/home/sc/pro]]#
if I do nginx -t:
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
if I do netstat -ntlp, I see following:
N 1684/nginx: master
tcp6 0 0 :::465 :::* LISTE
in /etc/nginx/nginx.conf:
server{
listen 80;
#listen [::]:80 ipv6only=on; <- I tried it too
server_name "my_ip_address";
location = /favicon.ico {access_log off; log_not_found off;}
location /static/ {
root /home/sc/pro/projects/sc/sc_site;
}
location / {
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://unix:/home/sc/pro/sc_project/sc_project.sock;
}
}
Moreover, if I do following command, system tells me following :
(sc_project) [ [/home/sc/pro/projects/sc]]# gunicorn --bind 0.0.0.0:8000 sc.wsgi:application
[2020-09-08 14:05:16 +0000] [4209] [INFO] Starting gunicorn 20.0.4
[2020-09-08 14:05:16 +0000] [4209] [INFO] Listening at: http://0.0.0.0:8000 (4209)
[2020-09-08 14:05:16 +0000] [4209] [INFO] Using worker: sync
[2020-09-08 14:05:16 +0000] [4211] [INFO] Booting worker with pid: 4211
But i cannot get to my site anyway... Although earlier when I just installed gunicorn and did this command i was able to get to the site...
I killed httpd process with the following command:
sudo kill -2 <PID>
... which was taking port 80... I tried to use apache earlier and it didn't work for me... Now I'm not sure if it was httpd or http process, and whether I need it or not... But by journalctl -x it was not allowing gunicorn to use port 80...
Also i'm not sure if I did restrictions right: I'm root for my site...I used these commands for sc, which is root folder for my project (as: /home/sc) and supposed to be a user's name which holds all projects down the tree: usermod -a -G sc nginx chmod 710 /home/sc
I was following this tutorial: https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-centos-7