# Nginx won't start after I changed domain name

**URL:** https://forum.yunohost.org/t/nginx-wont-start-after-i-changed-domain-name/2337
**Category:** Support
**Tags:** french
**Created:** [January 4, 2017, 11:04am UTC](https://forum.yunohost.org/t/nginx-wont-start-after-i-changed-domain-name/2337 "2017-01-04T11:04:37Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![vivien](https://forum.yunohost.org/user_avatar/forum.yunohost.org/vivien/32/1414_2.png) [@vivien](https://forum.yunohost.org/u/vivien)
#### Post date: [January 4, 2017, 11:04am UTC](https://forum.yunohost.org/t/nginx-wont-start-after-i-changed-domain-name/2337/1 "2017-01-04T11:04:38Z")

</div>

Bonjour, (if you prefer english, just ask 🙂 )

Sur mon install récente de Yunohost, j’ai changé le nom de domaine vers un sous-domaine de celui que j’avais rentré au préalable (yunohost.mon\_nom\_de\_domaine.fr à la place de mon\_nom\_de\_domaine.fr)  
suite à un redémarrage de la machine, nginx ne démarre plus :

> root@yunohost:/etc/yunohost/certs# cat /var/log/nginx/error.log  
> 2017/01/03 15:54:31 [emerg] 458#0: BIO\_new\_file(“/etc/yunohost/certs/mon\_nom\_de\_domaine.fr/crt.pem”) failed (SSL: error:02001002:system library:fopen:No such file or directory:fopen(‘/etc/yunohost/certs/mon\_nom\_de\_domaine.fr/crt.pem’,‘r’) error:2006D080:BIO routines:BIO\_new\_file:no such file)

Comment pourrais-je dépanner ça ? (je suis un noob du Nginx…)

Merci d’avance !

---

<div class="post-metadata">

### Author: ![madmaxlamenace](https://forum.yunohost.org/user_avatar/forum.yunohost.org/madmaxlamenace/32/540_2.png) [@madmaxlamenace](https://forum.yunohost.org/u/madmaxlamenace)
#### Post date: [January 4, 2017, 1:22pm UTC](https://forum.yunohost.org/t/nginx-wont-start-after-i-changed-domain-name/2337/2 "2017-01-04T13:22:47Z")

</div>

Ca semble venir de ton certificat situé ici /etc/yunohost/certs/mon\_nom\_de\_domaine.fr/crt.pem  
As tu vérifié s’il est la ? nginx, son groupe, ou tous les autres a t-il les droits en lecture au minimum  
Voici mes log sur mon instance de yunohost

```auto
root@totofr:/etc/yunohost# ls
apps firewall.yml	hooks.d services.yml
certs firewall.yml.old	installed services.yml-old
current_host from_script	mysql
root@totofr:/etc/yunohost# cd certs/
root@totofr:/etc/yunohost/certs# ls
blog.toto.fr	toto.fr shop.toto.fr
cops.toto.fr	toto.fr.beforeLetsEncrypt yunohost.org
root@totofr:/etc/yunohost/certs# cd toto.fr
root@totofr:/etc/yunohost/certs/toto.fr# ls -la
total 8
drwxr-xr-x 2 root root 4096 oct. 6 23:07 .
drwxr-xr-x 8 root root 4096 janv. 3 21:51 ..
lrwxrwxrwx 1 root root 45 oct. 6 23:07 crt.pem -> /etc/letsencrypt/live/toto.fr/fullchain.pem
lrwxrwxrwx 1 root root 43 oct. 6 23:07 key.pem -> /etc/letsencrypt/live/toto.fr/privkey.pem
root@totofr:/etc/yunohost/certs/toto.fr# cd ..
root@totofr:/etc/yunohost/certs# ls -la
total 32
drwxr-xr-x 8 root root 4096 janv. 3 21:51 .
drwxr-xr-x 5 root root 4096 oct. 6 23:35 ..
drwxr-xr-x 2 root root 4096 oct. 6 23:46 blog.toto.fr
drwxr-xr-x 2 root root 4096 janv. 3 21:51 cops.toto.fr
drwxr-xr-x 2 root root 4096 oct. 6 23:07 toto.fr
drwxr-xr-x 2 root root 4096 oct. 6 22:21 toto.fr.beforeLetsEncrypt
drwxr-xr-x 2 root root 4096 oct. 26 22:31 shop.toto.fr
drwxr-xr-x 2 root root 4096 oct. 6 21:55 yunohost.org
root@totofr:/etc/yunohost/certs# ls -la toto.fr
total 8
drwxr-xr-x 2 root root 4096 oct. 6 23:07 .
drwxr-xr-x 8 root root 4096 janv. 3 21:51 ..
lrwxrwxrwx 1 root root 45 oct. 6 23:07 crt.pem -> /etc/letsencrypt/live/toto.fr/fullchain.pem
lrwxrwxrwx 1 root root 43 oct. 6 23:07 key.pem -> /etc/letsencrypt/live/toto.fr/privkey.pem
root@totofr:/etc/yunohost/certs# ls -la toto.fr.beforeLetsEncrypt/
total 32
drwxr-xr-x 2 root root 4096 oct. 6 22:21 .
drwxr-xr-x 8 root root 4096 janv. 3 21:51 ..
lrwxrwxrwx 1 root root 34 oct. 6 22:21 ca.pem -> /etc/ssl/certs/ca-yunohost_crt.pem
-rw-r----- 1 root metronome 5609 oct. 6 22:21 crt.pem
-rw-r----- 1 root metronome 1704 oct. 6 22:21 key.pem
-rw------- 1 root root 8866 oct. 6 22:21 openssl.cnf
root@totofr:/etc/yunohost/certs# ls -la /etc/letsencrypt/live/toto.fr/
total 8
drwxr-xr-x 2 root root 4096 déc. 11 01:39 .
drwxr-x--- 3 root metronome 4096 oct. 6 23:07 ..
lrwxrwxrwx 1 root root 33 déc. 11 01:39 cert.pem -> ../../archive/toto.fr/cert2.pem
lrwxrwxrwx 1 root root 34 déc. 11 01:39 chain.pem -> ../../archive/toto.fr/chain2.pem
lrwxrwxrwx 1 root root 38 déc. 11 01:39 fullchain.pem -> ../../archive/toto.fr/fullchain2.pem
lrwxrwxrwx 1 root root 36 déc. 11 01:39 privkey.pem -> ../../archive/toto.fr/privkey2.pem
root@totofr:/etc/yunohost/certs# ls -la /etc/letsencrypt/archive/toto.fr/
total 40
drwxr-xr-x 2 root root 4096 déc. 11 01:39 .
drwxr-x--- 3 root metronome 4096 oct. 6 23:07 ..
-rw-r--r-- 1 root root 2126 oct. 6 23:07 cert1.pem
-rw-r--r-- 1 root root 2126 déc. 11 01:39 cert2.pem
-rw-r--r-- 1 root root 1647 oct. 6 23:07 chain1.pem
-rw-r--r-- 1 root root 1647 déc. 11 01:39 chain2.pem
-rw-r--r-- 1 root root 3773 oct. 6 23:07 fullchain1.pem
-rw-r--r-- 1 root root 3773 déc. 11 01:39 fullchain2.pem
-rw-r--r-- 1 root root 3272 oct. 6 23:07 privkey1.pem
-rw-r--r-- 1 root root 3268 déc. 11 01:39 privkey2.pem

```

---

<div class="post-metadata">

### Author: ![vivien](https://forum.yunohost.org/user_avatar/forum.yunohost.org/vivien/32/1414_2.png) [@vivien](https://forum.yunohost.org/u/vivien)
#### Post date: [January 4, 2017, 1:27pm UTC](https://forum.yunohost.org/t/nginx-wont-start-after-i-changed-domain-name/2337/3 "2017-01-04T13:27:05Z")

</div>

Salut @madmaxlamenace , merci de tenter de m’aider 🙂

En fait, ce certificat n’a plus lieu d’être puisque j’ai changé le nom de domaine mon\_nom\_de\_domaine.fr vers yunohost.mon\_nom\_de\_domaine.fr.  
le fichier /etc/yunohost/certs/yunohost.mon\_nom\_de\_domaine.fr/crt.pem est bien présent lui, et pour moi le système ne devrait pas avoir besoin de l’ancien…

---

<div class="post-metadata">

### Author: ![madmaxlamenace](https://forum.yunohost.org/user_avatar/forum.yunohost.org/madmaxlamenace/32/540_2.png) [@madmaxlamenace](https://forum.yunohost.org/u/madmaxlamenace)
#### Post date: [January 4, 2017, 2:09pm UTC](https://forum.yunohost.org/t/nginx-wont-start-after-i-changed-domain-name/2337/4 "2017-01-04T14:09:16Z")

</div>

Apparemment le domaine n’a pas été supprimé dans nginx. et la conf du domaine par la même occasion.  
Regardes les repertoires dans /etc/nginx/conf.d

---

<div class="post-metadata">

### Author: ![vivien](https://forum.yunohost.org/user_avatar/forum.yunohost.org/vivien/32/1414_2.png) [@vivien](https://forum.yunohost.org/u/vivien)
#### Post date: [January 4, 2017, 2:22pm UTC](https://forum.yunohost.org/t/nginx-wont-start-after-i-changed-domain-name/2337/5 "2017-01-04T14:22:01Z")

</div>

Ok c’est bien ça, j’ai supprimé les 2 fichiers mon\_nom\_de\_domaine.fr.conf et mon\_nom\_de\_domaine.fr.d, puis rebooté et nginx est correctement démarré 🙂  
Merci pour ton aide @madmaxlamenace !

---

<div class="post-metadata">

### Author: ![madmaxlamenace](https://forum.yunohost.org/user_avatar/forum.yunohost.org/madmaxlamenace/32/540_2.png) [@madmaxlamenace](https://forum.yunohost.org/u/madmaxlamenace)
#### Post date: [January 4, 2017, 4:01pm UTC](https://forum.yunohost.org/t/nginx-wont-start-after-i-changed-domain-name/2337/6 "2017-01-04T16:01:57Z")

</div>

De rien  
Par contre y a peut être d’autres choses qui traîne…  
En effet tes infos de domaine ont mal été supprimées, je ne sais pas à quel point. Ça pourrait te poser des problème plus tard si tu ajoutes ce domaine par exemple.

---

<div class="post-metadata">

### Author: ![ljf](https://forum.yunohost.org/user_avatar/forum.yunohost.org/ljf/32/58_2.png) [@ljf](https://forum.yunohost.org/u/ljf)
#### Post date: [January 7, 2017, 8:07am UTC](https://forum.yunohost.org/t/nginx-wont-start-after-i-changed-domain-name/2337/7 "2017-01-07T08:07:05Z")

</div>

@vivien Pour supprimer le domaine précédent tu as bien utilisé l’interface administrateur ou la cli yunohost ?

---

<div class="post-metadata">

### Author: ![vivien](https://forum.yunohost.org/user_avatar/forum.yunohost.org/vivien/32/1414_2.png) [@vivien](https://forum.yunohost.org/u/vivien)
#### Post date: [January 9, 2017, 11:54am UTC](https://forum.yunohost.org/t/nginx-wont-start-after-i-changed-domain-name/2337/8 "2017-01-09T11:54:33Z")

</div>

@ljf j’ai tout fait (création et suppression des noms de domaine) via l’interface administrateur

---

<div class="post-metadata">

### Author: ![Aleks](https://forum.yunohost.org/user_avatar/forum.yunohost.org/aleks/32/1704_2.png) [@Aleks](https://forum.yunohost.org/u/Aleks)
#### Post date: [January 18, 2023, 8:12pm UTC](https://forum.yunohost.org/t/nginx-wont-start-after-i-changed-domain-name/2337/9 "2023-01-18T20:12:41Z")

</div>


