passenger icon indicating copy to clipboard operation
passenger copied to clipboard

Installation error (AlmaLinux 9) potentially linked to SELinux

Open thbar opened this issue 3 months ago • 1 comments

Hello,

I'm following the documentation at https://www.phusionpassenger.com/docs/tutorials/deploy_to_production/installations/oss/ownserver/ruby/nginx/ to install passenger + nginx on AlmaLinux 9 (and later RHEL 9).

It took be a bit of time to figure out that the execution of the service failed (and why):

What I saw after following the installation steps was:

[vagrant@vagrant-worker-rhel ~]$ sudo cat /var/log/nginx/error.log
2025/09/27 12:46:11 [emerg] 17093#17093: mkdir() "/usr/share/nginx/passenger_temp" failed (13: Permission denied)

If I do this, the problem disappears and the web server boots:

sudo setenforce 0
sudo systemctl restart nginx

(of course this is only a temporary test)

Is it a known problem? What is the best / recommended solution? (e.g. using semanage to explicitely authorize access to /usr/share/nginx/passenger_temp ?)

Thank you

thbar avatar Sep 27 '25 12:09 thbar

I ran the same set of scripts on RHEL 9, and installation works.

On AlmaLinux 9, I implemented a quick-fix this way:

- name: Quick-fix for AlmaLinux SELinux bug (https://github.com/phusion/passenger/issues/2630)
  ansible.builtin.file:
    path: /usr/share/nginx/passenger_temp
    state: directory
    owner: nginx
    group: root
    mode: '0700'
    setype: usr_t
  when: ansible_distribution == "AlmaLinux"    

(followed by an extra restart)

This allows the server to boot.

thbar avatar Oct 04 '25 16:10 thbar