# Apache2 échec réinstall : bad group name www-data

**URL:** <https://www.debian-fr.org/t/apache2-echec-reinstall-bad-group-name-www-data/31475>\
**Category:** Support Debian\
**Created:** [Février 21, 2016, 1:07 UTC](https://www.debian-fr.org/t/apache2-echec-reinstall-bad-group-name-www-data/31475 "2016-02-21T01:07:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![loreleil](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/l/77aa72/32.png) [@loreleil](https://www.debian-fr.org/u/loreleil)\
**Post date:** [Février 21, 2016, 1:07 UTC](https://www.debian-fr.org/t/apache2-echec-reinstall-bad-group-name-www-data/31475/1 "2016-02-21T01:07:49Z")

</div>

Salut,

J’ai eu quelques soucis avec mon serveur suite à la suppression de deux utilisateurs.

Au redémarrage j’avais le message suivant :

`root@Debian-pc-1:/home/pc-1-loreleil# /etc/init.d/apache2 start
Starting web server: apache2apache2: bad group name www-data
Action 'start' failed.
The Apache error log may have more information.
 failed!
`  
Cela fait trois jours que je glane des infos sur le web … j’en suis arrivé à la prendre la décision d’une ré-install d’apache … j’ai les boules … toutes mes config à refaire sans parlé de la mise en sécurité … ![:mrgreen:](https://www.debian-fr.org/uploads/default/original/1X/cc83e9b583138e48ff45f96609046b06d06c7f9d.gif "Mr. Green")

J’ai donc tout viré y compris mysql, phpmyadmin … purge complète … ![:12](https://www.debian-fr.org/uploads/default/original/1X/5ab5476dc281287f8b7ad337242a19cb8485624d.gif "grincheux")

`apt-get --purge remove apache2*
dpkg -l | grep apache
dpkg --get-selections | grep apache`  
Un reboot au cas où … là je me croyais sorti d’affaire … ré-install !

`root@Debian-pc-1:/home/pc-1-loreleil# apt-get install --reinstall apache2 apache2-doc  
Lecture des listes de paquets... Fait                                    
Construction de l'arbre des dépendances                                    
Lecture des informations d'état... Fait                         
Les paquets supplémentaires suivants seront installés :       
apache2-mpm-worker apache2-utils apache2.2-bin apache2.2-common         
Paquets suggérés :                                                     
apache2-suexec apache2-suexec-custom                                  
Les NOUVEAUX paquets suivants seront installés :                              
apache2 apache2-doc apache2-mpm-worker apache2-utils apache2.2-bin apache2.2-common 
0 mis à jour, 6 nouvellement installés, 0 à enlever et 0 non mis à jour.
Il est nécessaire de prendre 2 304 ko/4 212 ko dans les archives.             
Après cette opération, 19,1 Mo d'espace disque supplémentaires seront utilisés.     
Souhaitez-vous continuer [O/n] ? 
....
Enabling site default.
......
Enabling module reqtimeout.
Paramétrage de apache2-mpm-worker (2.2.16-6+squeeze1) ...
Starting web server: apache2apache2: bad group name www-data
Action 'start' failed.
The Apache error log may have more information.
 failed!
invoke-rc.d: initscript apache2, action "start" failed.
Paramétrage de apache2 (2.2.16-6+squeeze1) ...
Paramétrage de apache2-doc (2.2.16-6+squeeze1) ...
apache2: bad group name www-data
Action 'configtest' failed.
The Apache error log may have more information.
 failed!
invoke-rc.d: initscript apache2, action "reload" failed.
root@Debian-pc-1:/home/pc-1-loreleil# 
`  
et là c’est la merde … ![:118](https://www.debian-fr.org/uploads/default/original/1X/d1e19597f004a3fd88435bfd0efb9a00e740a16a.gif "langue-yeux")

[code]# /etc/init.d/apache2 stop

# /etc/init.d/apache2 start

# /etc/init.d/apache2 restart

apache2: bad group name www-data  
Action ‹&nbsp;configtest&nbsp;› failed.  
The Apache error log may have more information.  
failed!  
root@Debian-pc-1:/home/pc-1-loreleil#  
[/code]

[quote]apache2: bad groupe www-data nom  
«Configtest 'action a échoué.  
Le journal des erreurs Apache peut avoir plus d’informations.  
a échoué! [/quote]

[code]pc-1-loreleil@Debian-pc-1:~$ grep http /etc/services

# Updated from [Service Name and Transport Protocol Port Number Registry](http://www.iana.org/assignments/port-numbers) and other

# sources like [Je m'assure que vous n'êtes pas un robot&nbsp;!](http://www.freebsd.org/cgi/cvsweb.cgi/src/etc/services) .

www 80/tcp http # WorldWideWeb HTTP  
https 443/tcp # http protocol over TLS/SSL  
https 443/udp  
http-alt 8080/tcp webcache # WWW caching service  
http-alt 8080/udp # WWW caching service  
pc-1-loreleil@Debian-pc-1:~$  
[/code]

`root@Debian-pc-1:/home/pc-1-loreleil# netstat -natupw | grep 80
udp6 0 0 fe80::216:17ff:feba:123 :::* 1927/ntpd       
root@Debian-pc-1:/home/pc-1-loreleil# 
`

[code]pc-1-loreleil@Debian-pc-1:~$ cat /etc/network/interfaces

# This file describes the network interfaces available on your system

# and how to activate them. For more information, see interfaces(5).

# The loopback network interface

auto lo  
iface lo inet loopback

# The primary network interface

allow-hotplug eth0  
#networkmanager#iface eth0 inet dhcp  
pc-1-loreleil@Debian-pc-1:~$  
[/code]

`ls -al /var
drwxr-xr-x 2 root root 4096 1 avril 17:45 www
`

`pc-1-loreleil@Debian-pc-1:~$ grep -RE "USER|GROUP" /etc/apache2
/etc/apache2/envvars:export APACHE_RUN_USER=www-data
/etc/apache2/envvars:export APACHE_RUN_GROUP=www-data
/etc/apache2/apache2.conf:User ${APACHE_RUN_USER}
/etc/apache2/apache2.conf:Group ${APACHE_RUN_GROUP}
pc-1-loreleil@Debian-pc-1:~$ 
`

`pc-1-loreleil@Debian-pc-1:~$ grep -R DocumentRoot /etc/apache2/*
/etc/apache2/sites-available/default-ssl: DocumentRoot /var/www
/etc/apache2/sites-available/default: DocumentRoot /var/www
/etc/apache2/sites-enabled/000-default: DocumentRoot /var/www
pc-1-loreleil@Debian-pc-1:~$ 
`

`pc-1-loreleil@Debian-pc-1:~$ grep ww-data /etc/passwd
www-data:x:33:1002:www-data:/var/www:/bin/sh
pc-1-loreleil@Debian-pc-1:~$ 
`

`pc-1-loreleil@Debian-pc-1:~$ ps aux | grep apache
1000 4117 0.4 3.0 230924 31048 ? S 18:28 0:03 /usr/bin/kwrite /home/pc-1-lorelei ...
1000 4146 0.0 0.0 10092 900 pts/2 S+ 18:39 0:00 grep apache
pc-1-loreleil@Debian-pc-1:~$ 
`

[code]pc-1-loreleil@Debian-pc-1:~$ cat /etc/hosts  
127.0.0.1 localhost  
192.168.1.12 Debian-pc-1.home Debian-pc-1

# The following lines are desirable for IPv6 capable hosts

::1 ip6-localhost ip6-loopback  
fe00::0 ip6-localnet  
ff00::0 ip6-mcastprefix  
ff02::1 ip6-allnodes  
ff02::2 ip6-allrouters  
pc-1-loreleil@Debian-pc-1:~$  
[/code]  
je ne sais pas quoi faire avec ça … ![:017](https://www.debian-fr.org/uploads/default/original/1X/7bbea83f89515ab7c7a738dddb86c4d4f140bd13.gif "reflechit")

[quote]apache2: bad group name www-data  
Action ‹&nbsp;configtest&nbsp;› failed.  
The Apache error log may have more information.  
failed![/quote]

[quote][/quote]  
 ![:116](https://www.debian-fr.org/uploads/default/original/1X/eae5ac515968d1af3d7141407139e6921afb85d3.gif "heu!") … ça tombe vraiment très mal … ![:013](https://www.debian-fr.org/uploads/default/original/1X/086709e9e4d48f0fa24e42243bbce857fc2be47f.gif "colere") je lance mon site pro courant semaine prochaine … j’ai les boules …

Toutes aides … conseils seront les bienvenues … ![:023](https://www.debian-fr.org/uploads/default/original/1X/3c587556c0cc11389317c03a60788d77ceebd307.gif "OK")

---

<div class="post-metadata">

**Author:** ![Niloo](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/n/c37758/32.png) [@Niloo](https://www.debian-fr.org/u/Niloo)\
**Post date:** [Février 21, 2016, 1:07 UTC](https://www.debian-fr.org/t/apache2-echec-reinstall-bad-group-name-www-data/31475/2 "2016-02-21T01:07:54Z")

</div>

> [@](#):
>
> The Apache error log may have more information

Tu as regardé les logs ?

[quote]grep ww-data /etc/passwd  
www-data:x:33:1002:www-data:/var/www:/bin/sh[/quote]  
Cela ne semble pas correct.

J’ai cela de mon côté :

[quote]grep www-data /etc/passwd  
www-data:x:33:33:www-data:/var/www:/bin/sh  
grep www-data /etc/group  
www-data:x:33:[/quote]

---

<div class="post-metadata">

**Author:** ![micky979](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/m/d9b06d/32.png) [@micky979](https://www.debian-fr.org/u/micky979)\
**Post date:** [Février 21, 2016, 1:07 UTC](https://www.debian-fr.org/t/apache2-echec-reinstall-bad-group-name-www-data/31475/3 "2016-02-21T01:07:55Z")

</div>

Bonjour,

Ton user www-data est dans le groupe 1002 qui est un groupe user et non system.

Remplace dans ton /etc/passwd le 1002 par 33 au niveau de www-data.

Est-ce que le groupe www-data existe bien dans /etc/group ?

---

<div class="post-metadata">

**Author:** ![loreleil](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/l/77aa72/32.png) [@loreleil](https://www.debian-fr.org/u/loreleil)\
**Post date:** [Février 21, 2016, 1:07 UTC](https://www.debian-fr.org/t/apache2-echec-reinstall-bad-group-name-www-data/31475/4 "2016-02-21T01:07:56Z")

</div>

Salut,

Vous avez mis le doigt dessus … ![:023](https://www.debian-fr.org/uploads/default/original/1X/3c587556c0cc11389317c03a60788d77ceebd307.gif "OK")

Il y a trois où quatre jours j’avais supprimé deux utilisateurs lors d’une install de «&nbsp;vsftpd&nbsp;» qui à aboutit à un échec, d’ou la suppression des deux «&nbsp;users&nbsp;» créer faite à l’arrache graphiquement avec «&nbsp;kuser&nbsp;». C’est là que j’ai merdé …

Et je n’arrivai pas à rétablir … correctement ![:017](https://www.debian-fr.org/uploads/default/original/1X/7bbea83f89515ab7c7a738dddb86c4d4f140bd13.gif "reflechit")

`:~$ grep ww-data /etc/passwd
www-data:x:33:1002:www-data:/var/www:/bin/sh
`

`:~$ grep www-data /etc/group
apache:*:33:www-data
`

C’est donc là ou j’ai merdé «&nbsp;graphiquement&nbsp;» … Voilà ce que j’ai actuellement !

`nano /etc/passwd
www-data:x:33:1002:www-data:/var/www:/bin/sh
`

`nano /etc/group
apache:*:33:www-data
`  
Là si comprend bien j’ai un «&nbsp;group&nbsp;» «&nbsp;apache&nbsp;» mais pas de de «&nbsp;group&nbsp;» «&nbsp;www-data&nbsp;» … ?  
Donc pour faire propre … supprimé le «&nbsp;group&nbsp;» «&nbsp;apache&nbsp;» … ❓

```auto
delgroup apache
```

Puis … créer

`groupadd www-data
`  
qui rétablirai «&nbsp;id&nbsp;» à 33

En fait j’avais créer un «&nbsp;user&nbsp;» «&nbsp;www-data&nbsp;» et un «&nbsp;group&nbsp;» «&nbsp;apache&nbsp;» … non ?

est ce bien ça … c’est la bonne procédure à suivre … ?

Et … le plus couillon c’est qu’il n’y avait pas là nécessité à tous viré … ![:118](https://www.debian-fr.org/uploads/default/original/1X/d1e19597f004a3fd88435bfd0efb9a00e740a16a.gif "langue-yeux") ..comme je l’ai fait … ![:mrgreen:](https://www.debian-fr.org/uploads/default/original/1X/cc83e9b583138e48ff45f96609046b06d06c7f9d.gif "Mr. Green")

---

<div class="post-metadata">

**Author:** ![loreleil](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/l/77aa72/32.png) [@loreleil](https://www.debian-fr.org/u/loreleil)\
**Post date:** [Février 21, 2016, 1:07 UTC](https://www.debian-fr.org/t/apache2-echec-reinstall-bad-group-name-www-data/31475/5 "2016-02-21T01:07:57Z")

</div>

Salut,

C’est rétablit … ![:023](https://www.debian-fr.org/uploads/default/original/1X/3c587556c0cc11389317c03a60788d77ceebd307.gif "OK")

`:~$ grep www-data /etc/group
apache:*:33:www-data
`

`:~$ grep www-data /etc/passwd
www-data:x:33:33:www-data:/var/www:/bin/sh `

`# /etc/init.d/apache2 restart
Restarting web server: apache2.
`

`:~$ ps aux | grep apache
root 13015 0.0 0.2 71320 2864 ? Ss 09:40 0:00 /usr/sbin/apache2 -k start
www-data 13017 0.0 0.1 71052 1980 ? S 09:40 0:00 /usr/sbin/apache2 -k start
www-data 13021 0.0 0.2 294748 2624 ? Sl 09:40 0:00 /usr/sbin/apache2 -k start
www-data 13022 0.0 0.2 294748 2628 ? Sl 09:40 0:00 /usr/sbin/apache2 -k start
1000 13110 0.0 0.0 10092 900 pts/3 S+ 09:42 0:00 grep apache
`

[code]:~$ grep http /etc/services

# Updated from [Service Name and Transport Protocol Port Number Registry](http://www.iana.org/assignments/port-numbers) and other

# sources like [Je m'assure que vous n'êtes pas un robot&nbsp;!](http://www.freebsd.org/cgi/cvsweb.cgi/src/etc/services) .

www 80/tcp http # WorldWideWeb HTTP  
https 443/tcp # http protocol over TLS/SSL  
https 443/udp  
http-alt 8080/tcp webcache # WWW caching service  
http-alt 8080/udp # WWW caching service  
[/code]

Je vous dois une fière chandelle … ![:041](https://www.debian-fr.org/uploads/default/original/1X/bfe857c9119752799c3eac55ca37a50312c51282.gif "applaudit") merci à vous deux … ![:023](https://www.debian-fr.org/uploads/default/original/1X/3c587556c0cc11389317c03a60788d77ceebd307.gif "OK")

Me reste plus qu’a tout re-configurer et sécuriser … j’ai trois jours devant moi, ça va le faire !

Je vous en serre cinq … merci … 😉
