Redmine安装故障:Phusion Passenger无法启动Web应用
Hey there, let's work through this permission issue that's stopping Passenger from starting your Redmine app. The core problem here is that Passenger can't create a FIFO file in /tmp, which is often tied to either filesystem permissions or SELinux restrictions on CentOS. Here are the actionable steps to resolve this:
1. Verify /tmp Directory Permissions & SELinux Context
The /tmp directory needs the correct permissions and SELinux label to allow Passenger to create temporary files:
- First, check the basic permissions:
You should see output likels -ld /tmpdrwxrwxrwt. 12 root root 4096 Aug 15 10:00 /tmp(note thetsticky bit). If not, fix it with:chmod 1777 /tmp - Next, check the SELinux context:
The context should bels -Z /tmpsystem_u:object_r:tmp_t:s0. If it's different, restore the default context:restorecon -Rv /tmp - To test if SELinux is the culprit temporarily (don't leave it disabled long-term), run:
If Redmine loads after this, you'll need to adjust SELinux policies instead of keeping it off.setenforce 0 systemctl restart httpd
2. Ensure the Apache User Has Access to /tmp
Passenger runs under the Apache user (usually apache on CentOS). Confirm this user can write to /tmp:
sudo -u apache touch /tmp/passenger-test && rm /tmp/passenger-test
If this command fails, double-check /tmp permissions (step 1) or ensure the apache user isn't restricted by any additional security tools.
3. Configure a Custom Passenger Temporary Directory
If adjusting /tmp doesn't work, you can set a dedicated temp directory for Passenger to avoid conflicts:
- Add this line to your Apache configuration (either
/etc/httpd/conf.d/passenger.confor your Redmine virtual host file):PassengerTempDir /var/lib/passenger/tmp - Create and secure the directory:
mkdir -p /var/lib/passenger/tmp chown apache:apache /var/lib/passenger/tmp chmod 700 /var/lib/passenger/tmp - Restart Apache to apply changes:
systemctl restart httpd
4. Double-Check Redmine Directory Permissions & SELinux
Even though you've adjusted Redmine permissions before, let's confirm everything is set correctly:
- Set ownership and basic permissions:
chown -R apache:apache /opt/redmine chmod -R 755 /opt/redmine - Restore the default SELinux context for Redmine:
restorecon -Rv /opt/redmine - Enable necessary SELinux booleans for Apache to interact with Redmine and PostgreSQL:
setsebool -P httpd_can_network_connect_db on setsebool -P httpd_read_user_content on
5. Enable Verbose Passenger Logging for More Details
If the issue persists, turn on detailed logging to get more clues:
- Add this to your Apache configuration:
PassengerLogLevel 3 - Restart Apache and check the logs:
This should give you more specific details about what's blocking Passenger.tail -f /var/log/httpd/error_log
内容的提问来源于stack exchange,提问作者Glailson Nogueira

