Ask Your Question

How to disable fedora 17 selinux? [closed]

asked 2012-07-02 02:56:40 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.

After installing Apache, Php, Mysql. I get always following:

$ service httpd status
Redirecting to /bin/systemctl  status httpd.service
httpd.service - The Apache HTTP Server (prefork MPM)
      Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled)
      Active: failed (Result: exit-code) since Mon, 02 Jul 2012 09:45:07 +0200; 5min ago
     Process: 32040 ExecStop=/usr/sbin/httpd $OPTIONS -k stop (code=exited, status=0/SUCCESS)
     Process: 32561 ExecStart=/usr/sbin/httpd $OPTIONS -k start (code=exited, status=1/FAILURE)
    Main PID: 24283 (code=exited, status=0/SUCCESS)
      CGroup: name=systemd:/system/httpd.service

Jul 02 09:45:07 example httpd[32561]: (13)Permission denied: make_sock: co...7
Jul 02 09:45:07 example httpd[32561]: no listening sockets available, shut...n
Jul 02 09:45:07 example httpd[32561]: Unable to open logs

To make it work, i need to do SELinux disable, but how do i do it? I have tried following:

$ vim /etc/selinux/config

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
# SELINUXTYPE= can take one of these two values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected. 
#     mls - Multi Level Security protection.
  • Need to reboot once, but i just needed on the fly

    $ setenforce 0

Do we have any way like service selinux stop | start | restart simple way? or something like chkconfig selinux off

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by sideburns
close date 2014-07-10 14:21:46.009104



For better or worse, there are legitimate reasons to disable selinux. For instance, when creating a livecd image, one must disable selinux, or at least (I suspect) not have it enforcing. Ideally it would not have to be this way, but it is. So the choice is either disable selinux or don't get the job done. Hm...

macracan gravatar imagemacracan ( 2012-12-24 09:23:26 -0500 )edit

3 Answers

Sort by ยป oldest newest most voted

answered 2012-07-02 12:30:36 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.

It's very simple.

Make a backup

cp /etc/selinux/config /etc/selinux/config.bak

Disable SELinux

sed -i s/SELINUX=enforcing/SELINUX=disabled/g /etc/selinux/config

You can also try PostInstallerF, it's very simple disable or enable SELinux with it.

edit flag offensive delete link more


What should I do if after applying your solution I still get SELinux messages and even errors? The only two non-commented lines in my '/etc/selinux/config' are 'SELINUX=permissive' and 'SELINUXTYPE=targeted '. I used FedoraUtils to set SEL to permissive mode right after I installed Fedora. Then I used your soultion, recently.

Bucic gravatar imageBucic ( 2013-04-15 14:00:15 -0500 )edit

answered 2013-02-07 08:35:48 -0500

Dan Walsh gravatar image

You should not need to disable or put the System into permissive mode to build a livecd. Do you have a bug report for this.

You should run with targeted policy since this is the most used. minimum, is just for people who want to experiment with SELinux.

SELinux is not a service, it is the way the kernel is configured and the way the system is labeled. Disabling SELinux requires a reboot. You can put the machine into permissive mode by executing setenforce 0.

Read for lots of Info on SELinux.

I would recommend you google for SELinux info using

edit flag offensive delete link more

answered 2012-07-02 06:21:15 -0500

Akshay gravatar image

i recommend you to set selinux to permissive and SELINUXTYPE=minimum to know more on selinux go to

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2012-07-02 02:56:40 -0500

Seen: 50,088 times

Last updated: Jul 10 '14