Centos 6.4 - Failed to map segment from shared object: Permission denied
Asked Answered
W

2

11

Hi, I am trying to install Phusion Passenger. Installation was successful but I am getting the following error on doing service httpd start

Starting httpd: httpd: Syntax error on line 221 of /etc/httpd/conf/httpd.conf: Syntax error on line 1 of /etc/httpd/conf.d/passenger.conf: Cannot load /usr/local/rvm/gems/ruby-2.0.0-p353/gems/passenger-4.0.33/buildout/apache2/mod_passenger.so into server: /usr/local/rvm/gems/ruby-2.0.0-p353/gems/passenger-4.0.33/buildout/apache2/mod_passenger.so: failed to map segment from shared object: Permission denied [FAILED]

Wick answered 4/1, 2014 at 10:31 Comment(0)
N
24

You may refer the following link for Phusion Passenger installation guide. http://www.modrails.com/documentation/Users%20guide%20Apache.html#installation

Or else execute this command in root to change the security context of “httpd_sys_script_exec_t” which allows Apache to execute.

chcon -R -h -t httpd_sys_script_exec_t /usr/local/rvm/gems/ruby-2.0.0-p353/gems/passenger-4.0.33/buildout/apache2/mod_passenger.so

Negativism answered 4/1, 2014 at 10:33 Comment(2)
It's interesting that this is an SELinux error. I didn't get a any errors logged to /var/log/messages.Baleful
Also, found to be the case for psycopg2: <virtualenv/path/>lib/python3.4/site-packages/psycopg2/_psycopg.cpython-34m.so. SELinux note: To make the change permanent use something like semanage fcontext -a -t httpd_sys_script_exec_t </full/path/to/file>; restorecon -v </full/path/to/file>;Normy
T
2

This might be irrelevant to this version of centOS. But just putting this out.

This issue might come due to selinux policy.

$ uname -a Linux enc02 3.10.0-327.el7.x86_64 #1 SMP Thu Nov 19 22:10:57 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

$ cat /etc/centos-release CentOS Linux release 7.5.1804 (Core)

Try with the following command for disabling selinux sudo setenforce 0

Try running your application and test.

To get it back sudo setenforce 1

If this works then you can try and configure some policys for your application/user.

Source: failed to map segment from shared object

Threephase answered 3/7, 2018 at 6:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.