Bonjour,

Comme indiqué sur le wiki j'ai installé le serveur Apache, mais au démarage de celui-ci, j'ai l'erreur suivante
[gg@localhost conf.d]$ service httpd start
Starting httpd (via systemctl):  Failed to issue method call: Access denied
                                                           [FAILED]

voici ce que retourne Selinux
SELinux is preventing /usr/sbin/httpd from using the execstack access on a process.

*****  Plugin catchall_boolean (89.3 confiance) suggéré***********************

Siyou want to allow httpd scripts and modules execmem/execstack
Alorsyou must tell SELinux about this by enabling the 'httpd_execmem' boolean.
Faire
setsebool -P httpd_execmem 1

*****  Plugin catchall (11.6 confiance) suggéré*******************************

Siyou believe that httpd should be allowed execstack access on processes labeled httpd_t by default.
Alorsyou should report this as a bug.
You can generate a local policy module to allow this access.
Faire
allow this access for now by executing:
# grep httpd /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Contexte source               system_u:system_r:httpd_t:s0
Contexte cible                system_u:system_r:httpd_t:s0
Objets du contexte            Unknown [ process ]
Source                        httpd
Chemin de la source           /usr/sbin/httpd
Port                          <Inconnu>
Hôte                          localhost.localdomain
Paquetages RPM source         httpd-2.2.17-10.fc15.1
Paquetages RPM cible          
RPM de la statégie            selinux-policy-3.9.16-24.fc15
Selinux activé                True
Type de stratégie             targeted
Mode strict                   Enforcing
Nom de l'hôte                 localhost.localdomain
Plateforme                    Linux localhost.localdomain
                              2.6.38.6-27.fc15.x86_64 #1 SMP Sun May 15 17:23:28
                              UTC 2011 x86_64 x86_64
Compteur d'alertes            12
Première alerte               mar 31 mai 2011 16:28:26 CEST
Dernière alerte               mar 31 mai 2011 20:37:51 CEST
ID local                      f06f7e00-1c29-460b-8048-1d0842e99c2f

Messages d'audit bruts 
type=AVC msg=audit(1306867071.681:147): avc:  denied  { execstack } for  pid=16886 comm="httpd" scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:system_r:httpd_t:s0 tclass=process


type=SYSCALL msg=audit(1306867071.681:147): arch=x86_64 syscall=mprotect success=no exit=EACCES a0=7fff4525f000 a1=1000 a2=1000007 a3=7faac47a4f89 items=0 ppid=16885 pid=16886 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=httpd exe=/usr/sbin/httpd subj=system_u:system_r:httpd_t:s0 key=(null)

Hash: httpd,httpd_t,httpd_t,process,execstack

audit2allow

#============= httpd_t ==============
#!!!! This avc can be allowed using the boolean 'httpd_execmem'

allow httpd_t self:process execstack;

audit2allow -R

#============= httpd_t ==============
#!!!! This avc can be allowed using the boolean 'httpd_execmem'

allow httpd_t self:process execstack;



Merci de votre aide.

EDIT: j'ai remplacé les balises quote par les balises code
Démarre apache en root.
Comment l'as-tu installé exactement ?
MrTom wrote:Démarre apache en root.
[gg@localhost conf.d]$ su -
Mot de passe : 
[root@localhost ~]# /etc/init.d/httpd start
Starting httpd (via systemctl):  Job failed. See system logs and 'systemctl status' for details.
                                                           [FAILED]

pingou wrote: Comment l'as-tu installé exactement ?
Comme présenté dans le Wiki
sudo yum install httpd httpd-manual 
su -lc "service httpd start"
Pourquoi cherches-tu à passer par init.d alors que tu avais la bonne commande la dernière fois ? 🙂

Sinon
su -lc "/etc/init.d/httpd configtest"
Pas mieux
[gg@localhost Documents]$ su -lc "/etc/init.d/httpd configtest"
Mot de passe : 
Syntax OK
[gg@localhost Documents]$ su -lc "service httpd start"
Mot de passe : 
Starting httpd (via systemctl):  Job failed. See system logs and 'systemctl status' for details.
                                                           [FAILED]
[gg@localhost Documents]$ 


Peut-être qu'il tourne déjà ?
su -lc "service httpd status"
Non il ne tourne pas, et cela devient embêtant 🙁
[gg@localhost ~]$ su -lc "service httpd status"
Mot de passe : 
httpd.service - LSB: start and stop Apache HTTP Server
      Loaded: loaded (/etc/rc.d/init.d/httpd)
      Active: failed since Wed, 01 Jun 2011 08:55:08 +0200; 4min 15s ago
     Process: 1011 ExecStart=/etc/rc.d/init.d/httpd start (code=exited, status=1/FAILURE)
      CGroup: name=systemd:/system/httpd.service

Le boot
Starting LSB: start and stop Apache HTTP Server...
Starting Permit User Sessions...
Started LSB: start and stop sendmail.
Started Permit User Sessions.
Starting LSB: start and stop Apache HTTP Server failed, see 'systemctl status httpd.service' for details.

Messages
May 31 22:31:28 localhost rsyslogd: [origin software="rsyslogd" swVersion="5.7.9" x-pid="828" x-info="http://www.rsyslog.com"] exiting on signal 15.
Jun  1 08:55:07 localhost rsyslogd: [origin software="rsyslogd" swVersion="5.7.9" x-pid="847" x-info="http://www.rsyslog.com"] start
Jun  1 08:55:08 localhost kernel: [   27.206544] systemd[1]: httpd.service: control process exited, code=exited status=1
Jun  1 08:55:08 localhost kernel: [   27.220999] systemd[1]: Unit httpd.service entered failed state.
Jun  1 08:55:08 localhost vmnet-dhcpd: For info, please visit http://www.isc.org/dhcp-contrib.html
Jun  1 08:55:08 localhost vmnet-dhcpd: For info, please visit http://www.isc.org/dhcp-contrib.html
Jun  1 08:55:08 localhost dhclient[1128]: For info, please visit https://www.isc.org/software/dhcp/
Jun  1 08:55:10 localhost setroubleshoot: SELinux is preventing /usr/sbin/httpd from using the execstack access on a process. For complete SELinux messages. run sealert -l f06f7e00-1c29-460b-8048-1d0842e99c2f
Jun  1 08:55:10 localhost setroubleshoot: SELinux is preventing /usr/sbin/httpd from using the execstack access on a process. For complete SELinux messages. run sealert -l f06f7e00-1c29-460b-8048-1d0842e99c2f

Rien dans /var/log/http
Regarde dans /var/log/message si tu as quelque chose en rapport avec httpd

si tu as un truc du genre
systemd[1]: Unit httpd.service entered failed state
tu peux essayer un :
restorecon -R -v /var
Tu peux essayer les commandes suivantes :
systemctl enable httpd.service
systemctl restart httpd.service
systemctl status httpd.service
Enfin, vérifie la syntaxe de ton fichier de config :
httpd -t
Dans messages, je n'ai rien de plus que noté ci-dessus.

[root@localhost log]# restorecon -R -v /var
restorecon reset /var/log/vnetlib context unconfined_u:object_r:var_log_t:s0->system_u:object_r:vmware_log_t:s0
restorecon reset /var/log/vmware-installer context unconfined_u:object_r:var_log_t:s0->system_u:object_r:vmware_log_t:s0
[root@localhost log]# systemctl enable httpd.service
httpd.service is not a native service, redirecting to /sbin/chkconfig.
Executing /sbin/chkconfig httpd on
[root@localhost log]# systemctl restart httpd.service
Job failed. See system logs and 'systemctl status' for details.
[root@localhost log]# systemctl status httpd.service
httpd.service - LSB: start and stop Apache HTTP Server
      Loaded: loaded (/etc/rc.d/init.d/httpd)
      Active: failed since Wed, 01 Jun 2011 10:03:12 +0200; 1min 32s ago
     Process: 2473 ExecStart=/etc/rc.d/init.d/httpd start (code=exited, status=1/FAILURE)
      CGroup: name=systemd:/system/httpd.service
[root@localhost log]# httpd -t
Syntax OK
[root@localhost log]# 


Tu peux vérifier que tu as bien httpd dans /var/run/ ?
IndyGroumpf wrote:Tu peux vérifier que tu as bien httpd dans /var/run/ ?
Oui, mais le répertoire est vide !!
ok, regarde si tu as ce fichier :
/etc/tmpfiles.d/httpd.conf
sinon, créé le avec la ligne :
d /var/run/httpd 710 root apache
(à priori il devrait y être)

Et tu peux toujours créer httpd.pid dans /var/run/httpd à la main. Avant ça, tu peux aussi essayer de vérifier dans les fichiers de config où est supposé être créé le pid de httpd et éventuellement mettre /var/run/httpd si ce n'est pas le cas
Pour tester aussi
su -lc "setenforce 0 && service httpd restart"
SELinux is preventing /usr/sbin/httpd from using the execstack access on a process. For complete SELinux messages. run sealert -l f06f7e00-1c29-460b-8048-1d0842e99c2f
ca sent un peu le bloquage par SELinux !

que remonte le commande :
 run sealert -l f06f7e00-1c29-460b-8048-1d0842e99c2f
Ai tout fait
mais même erreur
[root@localhost httpd]# su -lc "service httpd start"
Starting httpd (via systemctl):  Job failed. See system logs and 'systemctl status' for details.
                                                           [FAILED]

Selinux m'annonce une erreur d'accès a AVC , je pense que le souci vient de là, mais je ne comprend pas
pingou wrote:Pour tester aussi
su -lc "setenforce 0 && service httpd restart"
Yes ceci marche
[root@localhost httpd]# su -lc "setenforce 0 && service httpd restart"
Restarting httpd (via systemctl):                          [  OK  ]

penthium2 wrote: ca sent un peu le bloquage par SELinux !

que remonte le commande :
run sealert -l f06f7e00-1c29-460b-8048-1d0842e99c2f
[root@localhost httpd]# run sealert -l f06f7e00-1c29-460b-8048-1d0842e99c2f
bash: run: command not found...

edit de ma commande :
sealert -l f06f7e00-1c29-460b-8048-1d0842e99c2f