How to make SSL cert file readable for NodeJS

Post Reply
Posts: 5
Joined: Mon May 31, 2021 3:46 am

I am trying run https on a nodejs application so when I try to read for example

Code: Select all

I get the following permissions error:

Code: Select all

Error: EACCES: permission denied, open '/home/admin/conf/web/'
User avatar
Team Member
Posts: 132
Joined: Mon Jul 19, 2021 1:41 am
Has thanked: 16 times
Been thanked: 3 times

Check out this post: viewtopic.php?f=20&t=350
User avatar
Site Admin
Posts: 936
Joined: Fri Jun 19, 2020 9:59 am
Has thanked: 8 times
Been thanked: 6 times

Run as root in SSH:

Code: Select all

echo "UPDATE_SSL_SCRIPT='/usr/local/bin/'" >> /usr/local/vesta/conf/vesta.conf
This is callback that will run script every time when some SSL is generated/renewed.

Than make the script that will be triggered:

Code: Select all

cat <<EOF >/usr/local/bin/
chmod -R a+r /home/admin/conf/web/
# change 'admin' to other username if domain is not under 'admin' account

chmod a+x /usr/local/bin/
Now run that script manually:

Code: Select all

This will make your certificate files readable for all linux users, so NodeJS can read it.

After LetsEncrypt auto-renewing, /usr/local/bin/ will be triggered.
Post Reply