Deployment to prod on AWS EC2 with Supervisor

got to update netstat now

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       User       Inode       PID/Program name
tcp        0      0 127.0.0.1:8000          0.0.0.0:*               LISTEN      1000       16880       1724/python     
tcp        0      0 127.0.0.1:12000         0.0.0.0:*               LISTEN      1000       17454       1732/redis-server 1
tcp        0      0 127.0.0.1:13000         0.0.0.0:*               LISTEN      1000       16650       1731/redis-server 1
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      112        26300       7698/mysqld     
tcp        0      0 127.0.0.1:6379          0.0.0.0:*               LISTEN      113        13500       1065/redis-server 1
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      0          15482       1204/nginx -g daemo
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      0          13739       1081/sshd       
tcp        0      0 127.0.0.1:11000         0.0.0.0:*               LISTEN      1000       16655       1730/redis-server 1
tcp6       0      0 :::9000                 :::*                    LISTEN      1000       16873       1729/node       
tcp6       0      0 :::80                   :::*                    LISTEN      0          15483       1204/nginx -g daemo
tcp6       0      0 :::22                   :::*                    LISTEN      0          13741       1081/sshd       
udp        0      0 0.0.0.0:68              0.0.0.0:*                           0          12720       945/dhclient 

but the site still cannot be reached

Can you post the screenshot of your security group setting similar to this example:

Try using your public_ip:8000 and see if it works

still site not reached

Can you post the last 20 lines of web.log and web.error.log
Also the output of your browser console

where can i get that web.log or web.error.log?

on the browser console it just says Failed to load resource: net::ERR_CONNECTION_REFUSED

you will get the logs under frappe-bench/logs

here’s some lines from web.error.log

Traceback (most recent call last):
  File "/home/ubuntu/frappe-bench/env/bin/gunicorn", line 11, in <module>
    sys.exit(run())
  File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 74, in run
    WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
  File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 203, in run
    super(Application, self).run()
  File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 72, in run
    Arbiter(self).run()
  File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 60, in __init__
    self.setup(app)
  File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 120, in setup
    self.app.wsgi()
  File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
    self.callable = self.load()
  File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 65, in load
    return self.load_wsgiapp()
  File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
    return util.import_app(self.app_uri)
  File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/gunicorn/util.py", line 352, in import_app
    __import__(module)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/__init__.py", line 14, in <module>
    from .exceptions import *
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/exceptions.py", line 9, in <module>
    from MySQLdb import ProgrammingError as SQLError, Error
  File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/__init__.py", line 19, in <module>
    import _mysql
ImportError: libmysqlclient.so.20: cannot open shared object file: No such file or directory
Traceback (most recent call last):
  File "/home/ubuntu/frappe-bench/env/bin/gunicorn", line 11, in <module>
    sys.exit(run())
  File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 74, in run
    WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
  File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 203, in run
    super(Application, self).run()
  File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 72, in run
    Arbiter(self).run()
  File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 60, in __init__
    self.setup(app)
  File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/gunicorn/arbiter.py", line 120, in setup
    self.app.wsgi()
  File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
    self.callable = self.load()
  File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 65, in load
    return self.load_wsgiapp()
  File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
    return util.import_app(self.app_uri)
  File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/gunicorn/util.py", line 352, in import_app
    __import__(module)
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/__init__.py", line 14, in <module>
    from .exceptions import *
  File "/home/ubuntu/frappe-bench/apps/frappe/frappe/exceptions.py", line 9, in <module>
    from MySQLdb import ProgrammingError as SQLError, Error
  File "/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/__init__.py", line 19, in <module>
    import _mysql
ImportError: libmysqlclient.so.20: cannot open shared object file: No such file or directory
[2017-09-12 07:06:44 +0000] [1724] [INFO] Starting gunicorn 19.7.1
[2017-09-12 07:06:44 +0000] [1724] [INFO] Listening at: http://127.0.0.1:8000 (1724)
[2017-09-12 07:06:44 +0000] [1724] [INFO] Using worker: sync
[2017-09-12 07:06:44 +0000] [1866] [INFO] Booting worker with pid: 1866
[2017-09-12 07:06:44 +0000] [1867] [INFO] Booting worker with pid: 1867

seems that i’m having issues with MySQL

any inputs here?

I think you were having the issues earlier, but now it seems to be working.
Can you post the output of web.log

web.log is empty

try bench restart from the frappe-bench folder

done restarting. checked the public_ip:8000 again but still site not reached

Can you add port 443 as HTTPS to the security group and see

here’s the screenshot of the updated Security Group:

i checked the site but still not reached

any inputs?

Can you check with the public dns url which may be something starting with ec2-
Also check the nginx logs under /var/logs/nginx

i tried accessing the site using Public DNS but still not reached.

here’s the log from nginx

/var/log/nginx$ cat access.log 
114.108.218.92 - - [12/Sep/2017:06:04:07 +0000] "GET / HTTP/1.1" 304 0 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36"
114.108.218.92 - - [12/Sep/2017:06:04:08 +0000] "GET /icons/ubuntu-logo.png HTTP/1.1" 404 209 "http://ec2-54-169-39-35.ap-southeast-1.compute.amazonaws.com/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36"
114.108.218.92 - - [12/Sep/2017:06:08:40 +0000] "GET /icons/ubuntu-logo.png HTTP/1.1" 404 209 "http://ec2-54-169-39-35.ap-southeast-1.compute.amazonaws.com/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36"
114.108.218.92 - - [12/Sep/2017:07:15:48 +0000] "GET / HTTP/1.1" 200 3602 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36"
114.108.218.92 - - [12/Sep/2017:07:15:48 +0000] "GET /icons/ubuntu-logo.png HTTP/1.1" 404 209 "http://ec2-54-169-250-151.ap-southeast-1.compute.amazonaws.com/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36"
114.108.218.92 - - [12/Sep/2017:07:15:48 +0000] "GET /favicon.ico HTTP/1.1" 404 209 "http://ec2-54-169-250-151.ap-southeast-1.compute.amazonaws.com/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36"
114.108.218.92 - - [12/Sep/2017:07:16:26 +0000] "GET / HTTP/1.1" 200 3602 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36"
114.108.218.92 - - [12/Sep/2017:07:16:26 +0000] "GET /icons/ubuntu-logo.png HTTP/1.1" 404 209 "http://54.169.250.151/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36"
114.108.218.92 - - [12/Sep/2017:07:16:26 +0000] "GET /favicon.ico HTTP/1.1" 404 209 "http://54.169.250.151/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36"
114.108.218.92 - - [12/Sep/2017:07:16:34 +0000] "GET /icons/ubuntu-logo.png HTTP/1.1" 404 209 "http://54.169.250.151/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36"
114.108.218.92 - - [12/Sep/2017:07:44:21 +0000] "GET /icons/ubuntu-logo.png HTTP/1.1" 404 209 "http://ec2-54-169-250-151.ap-southeast-1.compute.amazonaws.com/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36"
114.108.218.92 - - [12/Sep/2017:07:50:37 +0000] "GET /icons/ubuntu-logo.png HTTP/1.1" 404 209 "http://54.169.250.151/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36"
114.108.218.92 - - [12/Sep/2017:07:53:55 +0000] "GET / HTTP/1.1" 304 0 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36"
114.108.218.92 - - [12/Sep/2017:07:53:56 +0000] "GET /icons/ubuntu-logo.png HTTP/1.1" 404 209 "http://54.169.250.151/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36"
114.108.218.92 - - [12/Sep/2017:07:53:59 +0000] "GET /icons/ubuntu-logo.png HTTP/1.1" 404 209 "http://ec2-54-169-250-151.ap-southeast-1.compute.amazonaws.com/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36"
114.108.218.92 - - [12/Sep/2017:07:55:01 +0000] "GET / HTTP/1.1" 304 0 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36"
114.108.218.92 - - [12/Sep/2017:07:55:02 +0000] "GET /icons/ubuntu-logo.png HTTP/1.1" 404 209 "http://ec2-54-169-250-151.ap-southeast-1.compute.amazonaws.com/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36"
114.108.218.92 - - [12/Sep/2017:07:55:04 +0000] "GET / HTTP/1.1" 304 0 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36"
114.108.218.92 - - [12/Sep/2017:07:55:04 +0000] "GET /icons/ubuntu-logo.png HTTP/1.1" 404 209 "http://54.169.250.151/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36"
114.108.218.92 - - [12/Sep/2017:08:02:18 +0000] "GET / HTTP/1.1" 304 0 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36"
114.108.218.92 - - [12/Sep/2017:08:02:19 +0000] "GET /icons/ubuntu-logo.png HTTP/1.1" 404 209 "http://ec2-54-169-250-151.ap-southeast-1.compute.amazonaws.com/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36"
114.108.218.92 - - [12/Sep/2017:08:02:26 +0000] "GET / HTTP/1.1" 304 0 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36"
114.108.218.92 - - [12/Sep/2017:08:02:26 +0000] "GET /icons/ubuntu-logo.png HTTP/1.1" 404 209 "http://54.169.250.151/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36"

no cat error.log is empty

are you able to ping the public ip from another terminal / command window?