Apache2 server does not start cannot pen shared object file

I am working with Apache and Passenger for a Rails project. And a during a restart I got the following error

Cannot load /usr/lib/ruby/gems/1.8/gems/passenger-2.2.11/ext/apache2/mod_passenger.so into server: /usr/lib/ruby/gems/1.8/gems/passenger-2.2.11/ext/apache2/mod_passenger.so: cannot open shared object file: No such file or directory

However there is no change in the apache configuration file. I have attached the snippet from the conf file

287 LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.2.11/ext/apache2/mod_passenger.so

288 PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.2.11

289 PassengerRuby /usr/bin/ruby1.8

I am also unable to locate the shared object file in the location pointed to by the server though I am not really sure how the .so file is works (created/destroyed)

I would also appreciate it if someone could explain to me what exactly has happened. I understand the shared object file is mission, what could be the reason it got deleted.


Solution 1:

If you don't have it installed.

$ sudo passenger-install-apache2-module

You need to run that so that the apache mod_passenger.so can be compiled after installing the gem (gem install passenger)

And take a look at the output presented by the installer. It will show you where the files are. In fact, it shows you exactly how the configuration must look.

Solution 2:

try

locate mod_passenger.so 

or if that doesn't work issue

find / -type f -name mod_passenger.so

if that doesn't return anything that means you don't have it installed.