Letencrypt setup with Bitnami 9.2.16-0 AWS Image

Hi, I’m trying to set up letsencrypt on our AWS setup, following this guide: Setting up TLS SSL certificates Let's Encrypt for ERPNext sites · frappe/erpnext Wiki · GitHub

I’ve tried: (Manual Method)

  1. sudo apt-get install certbot -t jessie-backports && sudo certbot certonly --standalone -n -d mydomain --agree-tos -m mydomain --pre-hook “/opt/bitnami/ctlscript.sh stop apache” --post-hook “/opt/bitnami/ctlscript.sh start apache”

Which successfully gets the certificate, then I add:

  1. “ssl_certificate”: “/etc/letsencrypt/live/mydomain.com/fullchain.pem”,
  2. “ssl_certificate_key”: “/etc/letsencrypt/live/mydomain.com/privkey.pem”

But it seems like erpnext in this image is using apache, while the docs reference nginx?

I’ve also tried the bench way:
cd /opt/bitnami/apps/erpnext/htdocs/frappe-bench
bench setup add-domain myname.mydomain. --site erpnext
bench config dns_multitenant on
bench setup nginx

Running this will stop the nginx service temporarily causing your sites to go offline
Do you want to continue? [y/N]: y
Failed to stop nginx.service: Unit nginx.service not loaded.
Traceback (most recent call last):
  File "/opt/bitnami/apps/erpnext/htdocs/venv/bin/bench", line 11, in <module>
    load_entry_point('bench', 'console_scripts', 'bench')()
  File "/opt/bitnami/apps/erpnext/htdocs/bench/bench/cli.py", line 40, in cli
  File "/opt/bitnami/apps/erpnext/htdocs/venv/lib/python2.7/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/opt/bitnami/apps/erpnext/htdocs/venv/lib/python2.7/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/opt/bitnami/apps/erpnext/htdocs/venv/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/bitnami/apps/erpnext/htdocs/venv/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/bitnami/apps/erpnext/htdocs/venv/lib/python2.7/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/bitnami/apps/erpnext/htdocs/venv/lib/python2.7/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/opt/bitnami/apps/erpnext/htdocs/bench/bench/commands/setup.py", line 84, in setup_letsencrypt
    setup_letsencrypt(site, bench_path='.')
  File "/opt/bitnami/apps/erpnext/htdocs/bench/bench/config/lets_encrypt.py", line 25, in setup_letsencrypt
    run_certbot_and_setup_ssl(site, bench_path)
  File "/opt/bitnami/apps/erpnext/htdocs/bench/bench/config/lets_encrypt.py", line 39, in run_certbot_and_setup_ssl
    service('nginx', 'stop')
  File "/opt/bitnami/apps/erpnext/htdocs/bench/bench/config/production_setup.py", line 57, in service
    exec_cmd("sudo {service_manager} {option} {service}".format(service_manager='systemctl', option=option, service=service))
  File "/opt/bitnami/apps/erpnext/htdocs/bench/bench/utils.py", line 90, in exec_cmd
    raise CommandFailedError(cmd)
bench.utils.CommandFailedError: sudo systemctl stop nginx

Again, it seems like bench / the documentation references nginx, but the image uses apache. How do I solve this?


You can post technical queries on discuss.frappe.io

ok Thanks, I have posted this over there. It’s awaiting moderation.