ERPNext Conference 2019* ERPNext.com Blog

Getting error while running "sudo bench setup lets-encrypt [site-name]"

erpnext

#1

I was trying to setup nginx for my erpnext installation

  1. when i try ipaddress in web browser it showing nginx page. It leads to erpnext webpage only with port 8000. i want to use only ipaddress for erpnext.
  2. This command sudo bench setup lets-encrypt [site-name] is not working showing error like “sudo: bench: command not found”

Please help me to solve this


SSL Certificate is not working properly
#2

In order for the command to work you need to be in the frappe-bench directory before you execute the command. I have also found that how you structure the command depends on how you installed the system you are using:

  • If you used the bench setup add-domain command to add the fully qualified domain name to your site then you will need to use this command to all a lets encrypt cert:

sudo -H bench setup lets-encrypt site1.local --custom-domain [your.site.name]

The exception to this is if you are using Ubuntu 18.04 as a host, the you eliminate the ( -H ) from the command like this:

sudo bench setup lets-encrypt site1.local --custom-domain [your.site.name]

  • If you are trying to setup a lets encrypt cert for a second tenant of a dns multi-tenant configuration then the command should look like this:

sudo -H bench setup lets-encrypt [your.site.name]

Except of course if you are on a Ubuntu 18.04 host then you need to eliminate the ( -H ) again:

sudo bench setup lets-encrypt [your.site.name]

Anyway, this is my experience at least and as always - Your mileage may vary… :sunglasses:

BKM


#3

@bkm [quote=“bkm, post:2, topic:52599”]
sudo -H bench setup lets-encrypt site1.local --custom-domain [your.site.name]
[/quote]

i tried to run this from frappe-bench folder but It is not working at all in my latest ERPNext implementation. It shows sudo: bench: command not found. I’ve tried run without sudo, but showing error superuser privileges required for this command

Help me to find a solution for this


#4

Is your server a KVM type VPS server or is it a pre-made virtual image you are running?

I have never heard of an instance where there is no valid bench command.

BKM


#5

@bkm I’ve installed it in gcloud only. I was able run bench command with out sudo. That is how i’ve done erpnext implementation. But in this case it is asking for superuser previlage for running this command. if i run the command as root user, it shows bench command error. Why it is like that ? Any solution much appreciated as i am stuck with my work here.