Page 1 of 4

TUTORIAL: How to install SSL certificate to Vesta, Exim and dovecot daemons

Posted: Fri Jul 27, 2018 10:52 am
by dpeca
Many server owners don't know how to install SSL to all daemons, especially to Exim4 and dovecot.

Now there is a new way that is built-in Vesta

Pre-required step: your server hostname must be full host address that is already pointing to IP of your server.
Check /etc/hostname to see what is your hostname.
If it's not real host address, change it to some domain that you are hosting, by typing in SSH:
v-change-sys-hostname somedomain.com
and then
HOSTNAME='somedomain.com'



Now, first, lets install Letsencrypt SSL to domain that is your hostname.

In SSH, as root, run:

Code: Select all

v-add-letsencrypt-domain 'admin' $HOSTNAME '' 'yes'
(change 'admin' if your hostname domain is not under 'admin' account)
This step will install LetsEncrypt the same way you can install it via Vesta web panel (so avoid this step if you already installed LetsEncrypt to your domain).
Of course, you can install any other certificate, not only free LetsEncrypt... you can do it via Vesta web panel by editing that domain.



Now in SSH do the follwing:

Code: Select all

v-update-host-certificate admin $HOSTNAME
(change 'admin' if your hostname domain is not under 'admin' account)
This will apply just installed SSL to Vesta, Exim and dovecot daemons.


And finally run:

Code: Select all

echo "UPDATE_HOSTNAME_SSL='yes'" >> /usr/local/vesta/conf/vesta.conf
This will tell Vesta to update SSL to Vesta, Exim and dovecot daemons every time when SSL is renewed.
This will happen automatically.


That's all.
LetsEncrypt SSL will be automatically renewed every 2 months and also automatically applied to dovecot, Exim and Vesta.

And this is completely built-in way, without additional scripts, Vesta itself do it.

Re: TUTORIAL: How to install SSL certificate to Vesta, Exim and dovecot daemons

Posted: Sat Aug 04, 2018 3:36 pm
by screighton
What OS are these commands intended for? I can't get them to work on Ubuntu...

Re: TUTORIAL: How to install SSL certificate to Vesta, Exim and dovecot daemons

Posted: Sat Aug 04, 2018 3:56 pm
by dpeca
screighton wrote:
Sat Aug 04, 2018 3:36 pm
What OS are these commands intended for? I can't get them to work on Ubuntu...
All distributions that Vesta support.

Before these commands run this:

Code: Select all

source /etc/profile
PATH=$PATH:/usr/local/vesta/bin && export PATH
It should solve your problem.

That is also known ''issue'' if you try to run v-* commands immediatelly after Vesta installation.

Re: TUTORIAL: How to install SSL certificate to Vesta, Exim and dovecot daemons

Posted: Mon Oct 15, 2018 7:41 am
by taicv
You've saved my life @dpeca :*

Re: TUTORIAL: How to install SSL certificate to Vesta, Exim and dovecot daemons

Posted: Thu Oct 25, 2018 12:11 pm
by lordkarin
is valid for multiple domains??

Re: TUTORIAL: How to install SSL certificate to Vesta, Exim and dovecot daemons

Posted: Thu Oct 25, 2018 12:17 pm
by dpeca
lordkarin wrote:
Thu Oct 25, 2018 12:11 pm
is valid for multiple domains??
if they use hostname address for IMAP/POP3/SMTP/Vesta, then yes.

Re: TUTORIAL: How to install SSL certificate to Vesta, Exim and dovecot daemons

Posted: Thu Oct 25, 2018 2:33 pm
by lordkarin
dpeca wrote:
Thu Oct 25, 2018 12:17 pm
lordkarin wrote:
Thu Oct 25, 2018 12:11 pm
is valid for multiple domains??
if they use hostname address for IMAP/POP3/SMTP/Vesta, then yes.
Thanks

Re: TUTORIAL: How to install SSL certificate to Vesta, Exim and dovecot daemons

Posted: Wed Oct 31, 2018 2:21 pm
by MAN5
Hi 'depeca',
After i followed the above steps, once my server $hostname get renewed by LE on after 2 months, do i have to re'run those steps again.?
I meant, the LE will renew the SSLs for my $hostname-domain only. But it not updated my Vesta-SSL, Exim etc.,

Re: TUTORIAL: How to install SSL certificate to Vesta, Exim and dovecot daemons

Posted: Wed Oct 31, 2018 2:45 pm
by dpeca
MAN5 wrote:
Wed Oct 31, 2018 2:21 pm
Hi 'depeca',
After i followed the above steps, once my server $hostname get renewed by LE on after 2 months, do i have to re'run those steps again.?
I meant, the LE will renew the SSLs for my $hostname-domain only. But it not updated my Vesta-SSL, Exim etc.,
It will update vesta, exim and dovecot automaticaly :)

Re: TUTORIAL: How to install SSL certificate to Vesta, Exim and dovecot daemons

Posted: Wed Oct 31, 2018 3:00 pm
by MAN5
Ok. Good then. Thank you for this best solution.