Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Selinux prevents apache from connecting to tomcat #18

Open
biddster opened this issue Nov 14, 2013 · 6 comments
Open

Selinux prevents apache from connecting to tomcat #18

biddster opened this issue Nov 14, 2013 · 6 comments
Assignees

Comments

@biddster
Copy link

I'm performing a monolithic install of Stash on Centos6.4 x64. The Cookbook works great but once it's finished apache is unable to connect to tomcat.

I have to ssh to the stash server and issue:

$ sudo setsebool -P httpd_can_network_connect 1
$ sudo service httpd restart

No big deal to sort - but is there anything we can do in the cookbook?

I've checked the apache cookbook docs and they say that it's up to you to sort out selinux.

@ghost ghost assigned bflad Nov 15, 2013
@bflad
Copy link
Owner

bflad commented Nov 15, 2013

I'm open to adding in some additional support for selinux.

@biddster
Copy link
Author

Something quick and dirty like this would probably suffice:

case node[:platform_family]
when 'rhel'
    package "policycoreutils"
    execute "setsebool -P httpd_can_network_connect 1" do
        only_if "getsebool -a | grep "httpd_can_network_connect --> off"
    end
end

@bflad
Copy link
Owner

bflad commented Nov 16, 2013

Thanks for the details. I'll work on implementation tomorrow

@bflad
Copy link
Owner

bflad commented Nov 18, 2013

Personally, I'd rather fix this the "right way" by having the Opscode apache/selinux cookbook handle the SELinux boolean handling. We'd then just add the appropriate default logic here. It looks like a boolean LWRP was sent in a pull request to the selinux cookbook way long ago, but got mixed up with restorecon changes that made it into Chef 11.6 and hence closed out without that functionality being added.

So. Let's resubmit a new issue to Opscode noting the lack of the boolean handling and get that in their (likely selinux) cookbook. Let me know if you want me to do this.

@biddster
Copy link
Author

Thanks, I think we should both pile in on this one and see if we can push it through. I can't believe the entire world runs selinux in permissive mode?

@bflad
Copy link
Owner

bflad commented Jan 23, 2015

Resurrecting this old discussion. Has the Chef landscape changed here with respect to selinux handling?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants