NGINX WONT RESTART : help me i was in the process of creating a sym link for my cert and keys when i made and error with my domain name in code lines

Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. https://crt.sh/?q=example.com), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domain is: firstchoiceinvst.com

I ran this command: systemctl restart nginx

It produced this output: Job for nginx.service failed because the control process exitedh error code.
See "systemctl status nginx.service" and "journalctl -xe" for dls.

My web server is (include version):
gnu inux 5.4.0 gen x86
The operating system my web server runs on is (include version):
ubuntu 20.0 lts
My hosting provider, if applicable, is:
scala hosting
I can login to a root shell on my machine (yes or no, or I don't know):
yes
I'm using a control panel to manage my site (no, or provide the name and version of the control panel):
no
The version of my client is (e.g. output of certbot --version or certbot-auto --version if you're using Certbot): certbot 0.40.0

HELP !!! please i need a walkthrough im not so savvy on linux... i installed the certbot tool and the dry run was successful as well as i obtained the lets encrypt cert... i changed the folder permisions and moved the backup of the keys... I although made an error with my domain name in the code linewhile trying to create a symlink for the cert and private keys and for this reason nginx service wont restart.... Here are the commit lines of code I was on before encountering an errr....

root@mail:~# certbot certonly --webroot --dry-run -w /var/www/html -d mail.firstchoiceinvst.com

root@mail:~# certbot certonly --webroot -w /var/www/html -d mail.fi rstchoiceinvst.com

root@mail:~# chmod 0644 /etc/letsencrypt/{live,archive}
root@mail:~# mv /etc/ssl/certs/iRedMail.crt{,.bak}
root@mail:~# mv /etc/ssl/private/iRedMail.key{,.bak}

root@mail:~# ln -s /etc/letsencrypt/live/mail.firstchoiceinvst.com/ fullchain.pem /etc/ssl/certs/iRedMail.crt
root@mail:~# ln -s /etc/letsencrypt/live/mail.fistchoiceinvst.com/privkey.pem /etc/ssl/private/iRedMail.key <<<(this is where i made the error with my domain name spelling for the folder)

root@mail:~# systemctl restart dovecot
root@mail:~# systemctl restart postfix
root@mail:~# systemctl restart nginx
Job for nginx.service failed because the control process exited with error code.
See "systemctl status nginx.service" and "journalctl -xe" for detai ls.

Please help me i'm on tight schedule to deliver and this is the last steps towards finalizing a fully setup email server. Muchas gracias.

Hello @tngcrdit2021,

If that is the problem then you only need to recreate the symlink.

Option 1 (use parameter f to overwrite the existing symlink):

ln -sf /etc/letsencrypt/live/mail.firstchoiceinvst.com/privkey.pem /etc/ssl/private/iRedMail.key

Option 2 (remove the wrong symlink and create a new one):

rm /etc/ssl/private/iRedMail.key
ln -s /etc/letsencrypt/live/mail.firstchoiceinvst.com/privkey.pem /etc/ssl/private/iRedMail.key

Also, in this command:

root@mail:~# ln -s /etc/letsencrypt/live/mail.firstchoiceinvst.com/ fullchain.pem /etc/ssl/certs/iRedMail.crt

There is an space between / and fullchain.pem, don't know if that is because a wrong copy/paste or because you really used that command.

You should double check that created symlinks are the right ones.

Cheers,
sahsanu

4 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.