Download Apache with Passenger / mod_rails successfully when Fedora launches

ROOM AND PURPOSE

There is this topic about Passenger / mod _rails does not start in Fedora 12 when Apache starts . Bottom line, the problem is related to resolution, and you can avoid this by calling

setenforce 0 

before launch

 service httpd start 

and challenge

 setenforce 1 

then install it. It works cool, but I want the sequence to start automatically when Fedora restarts.



PROBLEM

I looked through /etc/init.d/httpd and found that it just redirects to etc/rc.d/init.d/functions , and the key call

 systemctl_redirect $0 $1 

So, I thought that just surrounding this call with setenforce calls like this would work.

 setenforce 0 systemctl_redirect $0 $1 setenforce 1 

But that will not work. It generates a new error similar to this error (in the httpd error log):

 Cannot change the directory '/tmp/passenger.1.0.8581/generation-0/buffered_uploads' its UID to 48 and GID to 48: Operation not permitted (1) 

When I omit the last setenforce 1 , it finally works! But obviously, I want to get it back somewhere.



Question

How can I connect these calls to setenforce 0 and setenforce 1 to the httpd boot sequence? I feel that the most correct way would be to write your own /etc/init.d/httpd script that does not use systemctl , but I want to avoid this because it looks like a thorny path ... But if I am wrong and if you can offer an easy way to write my own etc/init.d/httpd script, I would also appreciate this.

+4
source share
1 answer

You are using the wrong approach to your problem. You MUST NOT disable SELinux on your system. What you need to do is try to find out the problem using SELinux Troubleshooter, and add a rule to allow you to perform the required operation. Usually they give you the commands you need to execute.

First, make sure that you are using the latest versions, and if the problem persists, consider creating a bug report here , you will get help from the developers.

0
source

Source: https://habr.com/ru/post/1390505/


All Articles