@soham will keep in mind next time You forgot one step after enabling ufw. You have to execute sudo ufw allow ssh.
@Aldian will try n update the same On Mon, Apr 13, 2020 at 10:30 PM Jagtar Singh Lakhyan < jagtar.lakhe...@gmail.com> wrote: > sudo journalctl -u gunicorn > > -- Logs begin at Fri 2020-04-10 23:00:11 IST, end at Mon 2020-04-13 > 21:54:16 IST. -- > > Apr 13 19:49:35 wms systemd[1]: Started gunicorn daemon. > > Apr 13 19:49:36 wms gunicorn[2515]: [2020-04-13 19:49:36 +0530] [2515] > [INFO] Starting gunicorn 20.0.4 > > Apr 13 19:49:36 wms gunicorn[2515]: [2020-04-13 19:49:36 +0530] [2515] > [INFO] Listening at: unix:/run/gunicorn.sock (2515) > > Apr 13 19:49:36 wms gunicorn[2515]: [2020-04-13 19:49:36 +0530] [2515] > [INFO] Using worker: sync > > Apr 13 19:49:36 wms gunicorn[2515]: [2020-04-13 19:49:36 +0530] [2520] > [INFO] Booting worker with pid: 2520 > > Apr 13 19:49:36 wms gunicorn[2515]: [2020-04-13 19:49:36 +0530] [2521] > [INFO] Booting worker with pid: 2521 > > Apr 13 19:49:36 wms gunicorn[2515]: [2020-04-13 19:49:36 +0530] [2522] > [INFO] Booting worker with pid: 2522 > > Apr 13 19:49:36 wms gunicorn[2515]: [2020-04-13 19:49:36 +0530] [2520] > [ERROR] Exception in worker process > > Apr 13 19:49:36 wms gunicorn[2515]: Traceback (most recent call last): > > Apr 13 19:49:36 wms gunicorn[2515]: File > "/home/wms/iitians/iitiansenv/lib/python3.6/site-packages/gunicorn/arbiter.py", > line 583, in spawn_worker > > Apr 13 19:49:36 wms gunicorn[2515]: worker.init_process() > > Apr 13 19:49:36 wms gunicorn[2515]: File > "/home/wms/iitians/iitiansenv/lib/python3.6/site-packages/gunicorn/workers/base.py", > line 119, in init_process > > Apr 13 19:49:36 wms gunicorn[2515]: self.load_wsgi() > > Apr 13 19:49:36 wms gunicorn[2515]: File > "/home/wms/iitians/iitiansenv/lib/python3.6/site-packages/gunicorn/workers/base.py", > line 144, in load_wsgi > > Apr 13 19:49:36 wms gunicorn[2515]: self.wsgi = self.app.wsgi() > > Apr 13 19:49:36 wms gunicorn[2515]: File > "/home/wms/iitians/iitiansenv/lib/python3.6/site-packages/gunicorn/app/base.py", > line 67, in wsgi > > Apr 13 19:49:36 wms gunicorn[2515]: self.callable = self.load() > > Apr 13 19:49:36 wms gunicorn[2515]: File > "/home/wms/iitians/iitiansenv/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", > line 49, in load > > Apr 13 19:49:36 wms gunicorn[2515]: return self.load_wsgiapp() > > Apr 13 19:49:36 wms gunicorn[2515]: File > "/home/wms/iitians/iitiansenv/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", > line 39, in load_wsgiapp > > Apr 13 19:49:36 wms gunicorn[2515]: return > util.import_app(self.app_uri) > > Apr 13 19:49:36 wms gunicorn[2515]: File > "/home/wms/iitians/iitiansenv/lib/python3.6/site-packages/gunicorn/util.py", > line 358, in import_app > > Apr 13 19:49:36 wms gunicorn[2515]: mod = > importlib.import_module(module) > > Apr 13 19:49:36 wms gunicorn[2515]: File > "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module > > Apr 13 19:49:36 wms gunicorn[2515]: return > _bootstrap._gcd_import(name[level:], package, level) > > Apr 13 19:49:36 wms gunicorn[2515]: File "<frozen > importlib._bootstrap>", line 994, in _gcd_import > > Apr 13 19:49:36 wms gunicorn[2515]: File "<frozen > importlib._bootstrap>", line 971, in _find_and_load > > Apr 13 19:49:36 wms gunicorn[2515]: File "<frozen > importlib._bootstrap>", line 953, in _find_and_load_unlocked > > Apr 13 19:49:36 wms gunicorn[2515]: ModuleNotFoundError: No module named > 'iitians.wsgi' > > Apr 13 19:49:36 wms gunicorn[2515]: [2020-04-13 19:49:36 +0530] [2522] > [ERROR] Exception in worker process > > Apr 13 19:49:36 wms gunicorn[2515]: Traceback (most recent call last): > > Apr 13 19:49:36 wms gunicorn[2515]: File > "/home/wms/iitians/iitiansenv/lib/python3.6/site-packages/gunicorn/arbiter.py", > line 583, in spawn_worker > > Apr 13 19:49:36 wms gunicorn[2515]: worker.init_process() > > Apr 13 19:49:36 wms gunicorn[2515]: File > "/home/wms/iitians/iitiansenv/lib/python3.6/site-packages/gunicorn/workers/base.py", > line 119, in init_process > > Apr 13 19:49:36 wms gunicorn[2515]: self.load_wsgi() > > Apr 13 19:49:36 wms gunicorn[2515]: File > "/home/wms/iitians/iitiansenv/lib/python3.6/site-packages/gunicorn/workers/base.py", > line 144, in load_wsgi > > Apr 13 19:49:36 wms gunicorn[2515]: self.wsgi = self.app.wsgi() > > Apr 13 19:49:36 wms gunicorn[2515]: File > "/home/wms/iitians/iitiansenv/lib/python3.6/site-packages/gunicorn/app/base.py", > line 67, in wsgi > > > $ sudo nano /etc/systemd/system/gunicorn.service > > > -- Logs begin at Fri 2020-04-10 23:00:11 IST, end at Mon 2020-04-13 > 22:26:42 IST. -- > > Apr 13 19:49:35 wms systemd[1]: Started gunicorn daemon. > > Apr 13 19:49:36 wms gunicorn[2515]: [2020-04-13 19:49:36 +0530] [2515] > [INFO] Starting gunicorn 20.0.4 > > Apr 13 19:49:36 wms gunicorn[2515]: [2020-04-13 19:49:36 +0530] [2515] > [INFO] Listening at: unix:/run/gunicorn.sock (2515) > > Apr 13 19:49:36 wms gunicorn[2515]: [2020-04-13 19:49:36 +0530] [2515] > [INFO] Using worker: sync > > Apr 13 19:49:36 wms gunicorn[2515]: [2020-04-13 19:49:36 +0530] [2520] > [INFO] Booting worker with pid: 2520 > > Apr 13 19:49:36 wms gunicorn[2515]: [2020-04-13 19:49:36 +0530] [2521] > [INFO] Booting worker with pid: 2521 > > Apr 13 19:49:36 wms gunicorn[2515]: [2020-04-13 19:49:36 +0530] [2522] > [INFO] Booting worker with pid: 2522 > > Apr 13 19:49:36 wms gunicorn[2515]: [2020-04-13 19:49:36 +0530] [2520] > [ERROR] Exception in worker process > > Apr 13 19:49:36 wms gunicorn[2515]: Traceback (most recent call last): > > Apr 13 19:49:36 wms gunicorn[2515]: File > "/home/wms/iitians/iitiansenv/lib/python3.6/site-packages/gunicorn/arbiter.py", > li > > Apr 13 19:49:36 wms gunicorn[2515]: worker.init_process() > > Apr 13 19:49:36 wms gunicorn[2515]: File > "/home/wms/iitians/iitiansenv/lib/python3.6/site-packages/gunicorn/workers/base.py > > Apr 13 19:49:36 wms gunicorn[2515]: self.load_wsgi() > > Apr 13 19:49:36 wms gunicorn[2515]: File > "/home/wms/iitians/iitiansenv/lib/python3.6/site-packages/gunicorn/workers/base.py > > Apr 13 19:49:36 wms gunicorn[2515]: self.wsgi = self.app.wsgi() > > Apr 13 19:49:36 wms gunicorn[2515]: File > "/home/wms/iitians/iitiansenv/lib/python3.6/site-packages/gunicorn/app/base.py", > l > > Apr 13 19:49:36 wms gunicorn[2515]: self.callable = self.load() > > Apr 13 19:49:36 wms gunicorn[2515]: File > "/home/wms/iitians/iitiansenv/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py" > > Apr 13 19:49:36 wms gunicorn[2515]: return self.load_wsgiapp() > > Apr 13 19:49:36 wms gunicorn[2515]: File > "/home/wms/iitians/iitiansenv/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py" > > Apr 13 19:49:36 wms gunicorn[2515]: return > util.import_app(self.app_uri) > > Apr 13 19:49:36 wms gunicorn[2515]: File > "/home/wms/iitians/iitiansenv/lib/python3.6/site-packages/gunicorn/util.py", > line > > Apr 13 19:49:36 wms gunicorn[2515]: mod = > importlib.import_module(module) > > Apr 13 19:49:36 wms gunicorn[2515]: File > "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module > > Apr 13 19:49:36 wms gunicorn[2515]: return > _bootstrap._gcd_import(name[level:], package, level) > > Apr 13 19:49:36 wms gunicorn[2515]: File "<frozen > importlib._bootstrap>", line 994, in _gcd_import > > Apr 13 19:49:36 wms gunicorn[2515]: File "<frozen > importlib._bootstrap>", line 971, in _find_and_load > > Apr 13 19:49:36 wms gunicorn[2515]: File "<frozen > importlib._bootstrap>", line 953, in _find_and_load_unlocked > > Apr 13 19:49:36 wms gunicorn[2515]: ModuleNotFoundError: No module named > 'iitians.wsgi' > > Apr 13 19:49:36 wms gunicorn[2515]: [2020-04-13 19:49:36 +0530] [2522] > [ERROR] Exception in worker process > > Apr 13 19:49:36 wms gunicorn[2515]: Traceback (most recent call last): > > Apr 13 19:49:36 wms gunicorn[2515]: File > "/home/wms/iitians/iitiansenv/lib/python3.6/site-packages/gunicorn/arbiter.py", > li > > Apr 13 19:49:36 wms gunicorn[2515]: worker.init_process() > > Apr 13 19:49:36 wms gunicorn[2515]: File > "/home/wms/iitians/iitiansenv/lib/python3.6/site-packages/gunicorn/workers/base.py > > Apr 13 19:49:36 wms gunicorn[2515]: self.load_wsgi() > > Apr 13 19:49:36 wms gunicorn[2515]: File > "/home/wms/iitians/iitiansenv/lib/python3.6/site-packages/gunicorn/workers/base.py > > > project/project/ ls > > *asgi.py* *__init__.py* *__pycache__* *settings.py* *urls.py* > *views.py* *wsgi.py* > > On Mon, Apr 13, 2020 at 10:21 PM Jagtar Singh Lakhyan < > jagtar.lakhe...@gmail.com> wrote: > >> Now im following this guide >> https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-18-04 >> >> its working till domain/ip:8000 as i already said but >> >> curl --unix-socket /run/gunicorn.sock localhost >> >> curl: (7) Couldn't connect to server >> >> >> and >> >> >> sudo systemctl status gunicorn >> >> [sudo] password for wms: >> >> *●* gunicorn.service - gunicorn daemon >> >> Loaded: loaded (/etc/systemd/system/gunicorn.service; disabled; >> vendor preset: enabled) >> >> Active: *failed* (Result: exit-code) since Mon 2020-04-13 20:52:38 >> IST; 1h 28min ago >> >> Process: 4643 ExecStart=/home/wms/iitians/iitiansenv/bin/gunicorn >> --access-logfile - --workers 3 --bind unix:/run/gunicorn. >> >> Main PID: 4643 (code=exited, status=3) >> >> >> Apr 13 20:52:38 wms gunicorn[4643]: File "<frozen >> importlib._bootstrap>", line 953, in _find_and_load_unlocked >> >> Apr 13 20:52:38 wms gunicorn[4643]: ModuleNotFoundError: No module named >> 'iitians.wsgi' >> >> Apr 13 20:52:38 wms gunicorn[4643]: [2020-04-13 20:52:38 +0530] [4646] >> [INFO] Worker exiting (pid: 4646) >> >> Apr 13 20:52:38 wms gunicorn[4643]: [2020-04-13 20:52:38 +0530] [4643] >> [INFO] Shutting down: Master >> >> Apr 13 20:52:38 wms gunicorn[4643]: [2020-04-13 20:52:38 +0530] [4643] >> [INFO] Reason: Worker failed to boot. >> >> Apr 13 20:52:38 wms systemd[1]: *gunicorn.service: Main process exited, >> code=exited, status=3/NOTIMPLEMENTED* >> >> Apr 13 20:52:38 wms systemd[1]: *gunicorn.service: Failed with result >> 'exit-code'.* >> >> Apr 13 20:52:38 wms systemd[1]: *gunicorn.service: Start request >> repeated too quickly.* >> >> Apr 13 20:52:38 wms systemd[1]: *gunicorn.service: Failed with result >> 'exit-code'.* >> >> Apr 13 20:52:38 wms systemd[1]: *Failed to start gunicorn daemon.* >> >> On Mon, Apr 13, 2020 at 7:19 PM Aldian Fazrihady <mob...@aldian.net> >> wrote: >> >>> If you turned off gunicorn, will you still get the 502 error? If yes, >>> the orginal error it means your nginx cannot connect to your gunicorn. >>> >>> Have you tested your app on dev server, i.e: `python manage.py >>> runserver` ? >>> >>> On Sat, Apr 11, 2020 at 11:53 PM Jagtar Singh Lakhyan < >>> jagtar.lakhe...@gmail.com> wrote: >>> >>>> 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/b1031a40-e33c-4bca-8764-13849c75968e%40googlegroups.com >>>> <https://groups.google.com/d/msgid/django-users/b1031a40-e33c-4bca-8764-13849c75968e%40googlegroups.com?utm_medium=email&utm_source=footer> >>>> . >>>> >>> >>> >>> -- >>> Regards, >>> >>> Aldian Fazrihady >>> http://aldianfazrihady.com >>> >>> -- >>> 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/CAN7EoAaeBOPBq0NbvJYYV1n%3D7ZZkKLjcvYvVE1Aiw9ero8wS%2BA%40mail.gmail.com >>> <https://groups.google.com/d/msgid/django-users/CAN7EoAaeBOPBq0NbvJYYV1n%3D7ZZkKLjcvYvVE1Aiw9ero8wS%2BA%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/> >> > > > -- > > *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/> > -- *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/CAD1gXQGYFqTunC524NSwh4%3DWgzMv2hBxXsaCxjdztn-c%2B0rGsQ%40mail.gmail.com.