Hi Ajayi, sudo systemctl reload daemon-reload
Failed to reload daemon-reload.service: Unit daemon-reload.service not found. perhaps u mean to say: sudo systemctl daemon-reload Ran these sudo systemctl daemon-reload sudo systemctl enable gunicorn sudo systemctl restart gunicorn sudo systemctl restart nginx wait for about 2-5minutes then run sudo systemctl status gunicorn Result: sudo systemctl status gunicorn [sudo] password for wms: *●* gunicorn.service - gunicorn service Loaded: loaded (/etc/systemd/system/gunicorn.service; enabled; vendor preset Active: *active (running)* since Sun 2020-04-12 19:17:35 IST; 6min ago Main PID: 8587 (gunicorn) Tasks: 4 (limit: 1689) CGroup: /system.slice/gunicorn.service ├─8587 /home/wms/iitiansenv/bin/python3 /home/wms/iitiansenv/bin/gun ├─8590 /home/wms/iitiansenv/bin/python3 /home/wms/iitiansenv/bin/gun ├─8592 /home/wms/iitiansenv/bin/python3 /home/wms/iitiansenv/bin/gun └─8594 /home/wms/iitiansenv/bin/python3 /home/wms/iitiansenv/bin/gun Apr 12 19:17:35 wms systemd[1]: Started gunicorn service. Apr 12 19:17:35 wms gunicorn[8587]: [2020-04-12 19:17:35 +0530] [8587] [INFO] S Apr 12 19:17:35 wms gunicorn[8587]: [2020-04-12 19:17:35 +0530] [8587] [INFO] L Apr 12 19:17:35 wms gunicorn[8587]: [2020-04-12 19:17:35 +0530] [8587] [INFO] U Apr 12 19:17:35 wms gunicorn[8587]: [2020-04-12 19:17:35 +0530] [8590] [INFO] B Apr 12 19:17:35 wms gunicorn[8587]: [2020-04-12 19:17:35 +0530] [8592] [INFO] B Apr 12 19:17:35 wms gunicorn[8587]: [2020-04-12 19:17:35 +0530] [8594] [INFO] B The app is well tested on my local, even i tried 15 days back the same app to run on nginx, gunicorn and it ran on ip/domain:8000 but Not it didnt run on ip/domain. Also, i am checking for the app again if it has some issues. I am following this guide: https://medium.com/@_christopher/deploying-my-django-app-to-a-real-server-part-i-de78962e95ac On Sun, Apr 12, 2020 at 5:14 PM Sunday Iyanu Ajayi <sunnexaj...@gmail.com> wrote: > HI Jagtar, > > Sometimes when you get 502 nginx server error , it can be due to the fact > that your django code has some error. If there is an error in your code, > nginx will no serve. > > Try to run > sudo systemctl reload daemon-reload > sudo systemctl enable gunicorn > sudo systemctl restart gunicorn > sudo systemctl restart nginx > > wait for about 2-5minutes then run > sudo systemctl status gunicorn > > IT shoud display error in your code > > *AJAYI Sunday * > (+234) 806 771 5394 > *sunnexaj...@gmail.com <sunnexaj...@gmail.com>* > > > > On Sun, Apr 12, 2020 at 5:54 AM Jagtar Singh Lakhyan < > jagtar.lakhe...@gmail.com> wrote: > >> No luck, same 502 error. >> >> These r settings.py >> >> *# SECURITY WARNING: don't run with debug turned on in production!* >> >> DEBUG = *False* >> >> >> ALLOWED_HOSTS = [*'iitian.xyz <http://iitian.xyz>'*, *'192.95.37.123'*] >> >> On Sun, Apr 12, 2020 at 6:19 AM Andrew C. <andreke12...@gmail.com> wrote: >> >>> What’s the HTTP status code? Does the nginx page even show anything? Try: >>> >>> sudo systemctl stop nginx && sudo systemctl disable nginx && sudo >>> systemctl enable nginx && sudo systemctl start nginx >>> >>> This command could also be in the wrong order... it’s been awhile. >>> >>> It could be a symbolic link error. I don’t know. If you see some web >>> page with an error message like Internal Error 500 or the default nginx >>> page, let us know. >>> >>> On Sat, Apr 11, 2020 at 1:39 PM Jagtar Singh Lakhyan < >>> jagtar.lakhe...@gmail.com> wrote: >>> >>>> sudo systemctl status nginx >>>> >>>> *●* nginx.service - A high performance web server and a reverse proxy >>>> server >>>> >>>> Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor >>>> preset: enabled) >>>> >>>> Active: *active (running)* since Sat 2020-04-11 04:54:18 IST; 18h >>>> ago >>>> >>>> Docs: man:nginx(8) >>>> >>>> Process: 1650 ExecStop=/sbin/start-stop-daemon --quiet --stop >>>> --retry QUIT/5 --pidfi >>>> >>>> Process: 1652 ExecStart=/usr/sbin/nginx -g daemon on; master_process >>>> on; (code=exite >>>> >>>> Process: 1651 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; >>>> master_process on; (c >>>> >>>> Main PID: 1653 (nginx) >>>> >>>> Tasks: 9 (limit: 1689) >>>> >>>> CGroup: /system.slice/nginx.service >>>> >>>> ├─1653 nginx: master process /usr/sbin/nginx -g daemon on; >>>> master_process o >>>> >>>> ├─1654 nginx: worker process >>>> >>>> ├─1655 nginx: worker process >>>> >>>> ├─1656 nginx: worker process >>>> >>>> ├─1657 nginx: worker process >>>> >>>> ├─1658 nginx: worker process >>>> >>>> ├─1659 nginx: worker process >>>> >>>> ├─1660 nginx: worker process >>>> >>>> └─1661 nginx: worker process >>>> >>>> >>>> Apr 11 04:54:18 wms systemd[1]: Starting A high performance web server >>>> and a reverse p >>>> >>>> Apr 11 04:54:18 wms systemd[1]: Started A high performance web server >>>> and a reverse pr >>>> >>>> On Sat, Apr 11, 2020 at 11:07 PM Rok Klancar <rklan...@gmail.com> >>>> wrote: >>>> >>>>> Dude, try "sudo systemctl status nginx" >>>>> >>>>> Dne sobota, 11. april 2020 18.53.50 UTC+2 je oseba Jagtar Singh >>>>> Lakhyan napisala: >>>>>> >>>>>> Im trying to deploy django app using nginx & gunicorn but its showing >>>>>> error >>>>>> >>>>>> sudo nginx -t >>>>>> >>>>>> nginx: the configuration file /etc/nginx/nginx.conf syntax is ok >>>>>> >>>>>> nginx: configuration file /etc/nginx/nginx.conf test is successful >>>>>> >>>>>> >>>>>> sudo systemctl status gunicorn.service >>>>>> >>>>>> gunicorn.service - gunicorn service >>>>>> >>>>>> Loaded: loaded (/etc/systemd/system/gunicorn.service; enabled; >>>>>> vendor preset: >>>>>> >>>>>> Active: *active (running)* since Sat 2020-04-11 21:19:19 IST; 11s >>>>>> ago >>>>>> >>>>>> Main PID: 16326 (gunicorn) >>>>>> >>>>>> Tasks: 4 (limit: 1689) >>>>>> >>>>>> >>>>>> -- >>>>> You received this message because you are subscribed to the Google >>>>> Groups "Django users" group. >>>>> To unsubscribe from this group and stop receiving emails from it, send >>>>> an email to django-users+unsubscr...@googlegroups.com. >>>>> To view this discussion on the web visit >>>>> https://groups.google.com/d/msgid/django-users/a3223d66-8adb-4dcd-8a48-d43d8a426ddc%40googlegroups.com >>>>> <https://groups.google.com/d/msgid/django-users/a3223d66-8adb-4dcd-8a48-d43d8a426ddc%40googlegroups.com?utm_medium=email&utm_source=footer> >>>>> . >>>>> >>>> >>>> >>>> -- >>>> >>>> *jagtar singh*founder & CEO >>>> LinkedIn <https://www.linkedin.com/in/jagtarsinghlakhyan/> >>>> Twitter <https://twitter.com/jagtarslakhyan> >>>> >>>> web 1: Network <https://iitians.xyz/> >>>> web 2: WMS <https://iitiansasc.com/moodle/> >>>> web 3: Conference <https://conference.iitians.xyz/> >>>> >>>> Android App 1: Network >>>> <https://play.google.com/store/apps/details?id=xyz.iitians> >>>> Android App 2: WMS >>>> <https://play.google.com/store/apps/details?id=xyz.iitians.wms> >>>> Android App 3: Conference >>>> <https://play.google.com/store/apps/details?id=com.iitiansasc.onlineclass> >>>> >>>> LinkedIn >>>> <https://www.linkedin.com/school/iitian's-advanced-school-of-competition-pvt-ltd-/> >>>> LinkedIn2 <https://www.linkedin.com/company/iitians-group/> >>>> Twitter <https://twitter.com/IITIANSGROUP> >>>> *IITIAN'S ADVANCED SCHOOL OF COMPETITION PVT. LTD. >>>> <https://www.facebook.com/IITiansASC/>* >>>> >>>> <https://iitians.xyz/> >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Django users" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to django-users+unsubscr...@googlegroups.com. >>>> To view this discussion on the web visit >>>> https://groups.google.com/d/msgid/django-users/CAD1gXQEbzWSWvSrQOCb-nBDcHzYb6ZE_qx4Hg6pJ_XJN3HN13Q%40mail.gmail.com >>>> <https://groups.google.com/d/msgid/django-users/CAD1gXQEbzWSWvSrQOCb-nBDcHzYb6ZE_qx4Hg6pJ_XJN3HN13Q%40mail.gmail.com?utm_medium=email&utm_source=footer> >>>> . >>>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Django users" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to django-users+unsubscr...@googlegroups.com. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/django-users/CAJVmkNkLdr0sOAiXUwE8_xoLSN_ctG2-d6jHfUkNefbYsU8BeQ%40mail.gmail.com >>> <https://groups.google.com/d/msgid/django-users/CAJVmkNkLdr0sOAiXUwE8_xoLSN_ctG2-d6jHfUkNefbYsU8BeQ%40mail.gmail.com?utm_medium=email&utm_source=footer> >>> . >>> >> >> >> -- >> >> *jagtar singh*founder & CEO >> LinkedIn <https://www.linkedin.com/in/jagtarsinghlakhyan/> >> Twitter <https://twitter.com/jagtarslakhyan> >> >> web 1: Network <https://iitians.xyz/> >> web 2: WMS <https://iitiansasc.com/moodle/> >> web 3: Conference <https://conference.iitians.xyz/> >> >> Android App 1: Network >> <https://play.google.com/store/apps/details?id=xyz.iitians> >> Android App 2: WMS >> <https://play.google.com/store/apps/details?id=xyz.iitians.wms> >> Android App 3: Conference >> <https://play.google.com/store/apps/details?id=com.iitiansasc.onlineclass> >> >> LinkedIn >> <https://www.linkedin.com/school/iitian's-advanced-school-of-competition-pvt-ltd-/> >> LinkedIn2 <https://www.linkedin.com/company/iitians-group/> >> Twitter <https://twitter.com/IITIANSGROUP> >> *IITIAN'S ADVANCED SCHOOL OF COMPETITION PVT. LTD. >> <https://www.facebook.com/IITiansASC/>* >> >> <https://iitians.xyz/> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Django users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to django-users+unsubscr...@googlegroups.com. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/django-users/CAD1gXQFMn3Qc9WU-k%3DjGTZ51oS6u%3D3A-H3B76nguXR%3DVcUwg5g%40mail.gmail.com >> <https://groups.google.com/d/msgid/django-users/CAD1gXQFMn3Qc9WU-k%3DjGTZ51oS6u%3D3A-H3B76nguXR%3DVcUwg5g%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-users+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/CAKYSAw3bq6UFR5K4is_9N7ZLzXchZ45rayZLYqMV7dbXG-f6Og%40mail.gmail.com > <https://groups.google.com/d/msgid/django-users/CAKYSAw3bq6UFR5K4is_9N7ZLzXchZ45rayZLYqMV7dbXG-f6Og%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > -- *jagtar singh*founder & CEO LinkedIn <https://www.linkedin.com/in/jagtarsinghlakhyan/> Twitter <https://twitter.com/jagtarslakhyan> web 1: Network <https://iitians.xyz/> web 2: WMS <https://iitiansasc.com/moodle/> web 3: Conference <https://conference.iitians.xyz/> Android App 1: Network <https://play.google.com/store/apps/details?id=xyz.iitians> Android App 2: WMS <https://play.google.com/store/apps/details?id=xyz.iitians.wms> Android App 3: Conference <https://play.google.com/store/apps/details?id=com.iitiansasc.onlineclass> LinkedIn <https://www.linkedin.com/school/iitian's-advanced-school-of-competition-pvt-ltd-/> LinkedIn2 <https://www.linkedin.com/company/iitians-group/> Twitter <https://twitter.com/IITIANSGROUP> *IITIAN'S ADVANCED SCHOOL OF COMPETITION PVT. LTD. <https://www.facebook.com/IITiansASC/>* <https://iitians.xyz/> -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAD1gXQHgLpoGAo911_S__b6QAgntbhMvF95hafGwmaJ8U%2BeTCQ%40mail.gmail.com.