Few weeks ago I have tried to install on Centos 8 following that guide.
I ran into trouble with sudo too.
I noticed that installing bench pip package locally it didn’t work.
I installed bench system wide sudo pip3 install bench. It let you notice that is not a good practice install pip package without --user and becoming root, but for a test, I didn’t care.
sudo visudo I added /usr/local/bin to secure path
Be careful that in some distro supervisor use *.conf and other use *.ini so symlinks can point to the wrong path/extension
Instead using bench setup supervisor and bench setup Nginx, try, straight to the point, bench setup production
The guide you followed, needs a bit of “fix” on the installation process, but if you dig into bench playbooks and scripts you will learn quite a lot
But isn’t the first problem is if doing sudo pip3 install then bench is not found?
So how to do bench setup production?
Does the #2 and #3 step to fix this?
The place where I find bench is under /home/erp/.local/bin/
When I add this to the path I get this error:
Traceback (most recent call last):
File “/home/erp/.local/bin/bench”, line 7, in
from bench.cli import cli
ModuleNotFoundError: No module named ‘bench’
The bench installation is in the folder of the erp user (same as in the instruction).
When I do sudo pip3 install bench I get a succesful installation but still running bench with sudo is not working. There is nothing in /usr/local/bin related to bench.
pip3 install --update --force-reinstall --user bench is not working because --update is not a valid option.
running bench setup production or supervisor or nginx should be with sudo too.
I found this because production.py only specify supervisor_conf_extn = "ini" if is_centos7() else "conf" (not specifying centos 8?)
and get_supervisord() in supervisor only search for *.conf
so even after renaming supervisor.conf (in frappe-bench/config folder) to supervisor.ini and running bench setup supervisor again will recreate the supervisor.conf and the script keep calling it.
Keep getting this:
Failed to restart supervisor.service: Unit supervisor.service not found. sudo systemctl restart supervisor executed with exit code 5
Now… should we change the bench script?
or the symlink (and where to find it)?
or which file?
Following this guide (with a few tweak) I now can install ERPNext production on CentOS 8. By “can” I mean I can go through all the commands and get supervisor and nginx status to active.
But still I can’t access my site with site name.
Using IP or domain namen it shows the nginx default page.
Using site name (sub.domain.com) the browser says it can’t find the server.
On local dev site it is suggested to include host_name in site_config.json. Should it be done the same with production?
it depends by your $PATH variable and /usr/local/bin folder is the right one for this use
If you do an ls -l /usr/local/bin you will see that /usr/local/bin/bench probably it’s a symlink. (just for your reference, nothing change in order to let bench command working)
If you want to know more about use of symlinks and shell variables, it’s enough you understand shell basic topics
Start from here, but google can give you more info than what I know