Passenger Apache Module install - installer not finding installed libraries - ruby-on-rails-3

I am trying to host a Rails app, in a VPS server. The server already, has Apache, installed, so I am trying to install passenger first, then passenger-apache-module.
I have installed RVM as the user, and ruby 1.9.3 and set it as the default ruby. Then, I installed passenger gem, version 3.0.17, as we are migrating the rails app, and the passenger version in the old server is 3.0.17. I was able to install passenger gem with the command gem install passenger -v 3.0.17.
After installing passenger, I went ahead and tried to install passenger-apache-module using the passenger-install-apache2-module command. I am getting this output:
Checking for required software...
* GNU C++ compiler... not found
* Curl development headers with SSL support... not found
* OpenSSL development headers... not found
* Zlib development headers... not found
* Ruby development headers... found
* OpenSSL support for Ruby... found
* RubyGems... found
* Rake... found at /home/federaltitle/.rvm/wrappers/ruby-1.9.3-p448/rake
* rack... found
* Apache 2... found at /usr/local/apache/bin/httpd
* Apache 2 development headers... found at /usr/bin/apxs
* Apache Portable Runtime (APR) development headers... found at /usr/local/apache/bin/apr-1-config
* Apache Portable Runtime Utility (APU) development headers... found at /usr/local/apache/bin/apu-1-config
Some required software is not installed.
But don't worry, this installer will tell you how to install them.
Press Enter to continue, or Ctrl-C to abort.
When I hit Enter, I am getting this output:
Installation instructions for required software
* To install GNU C++ compiler:
Please run yum install gcc-c++ as root.
* To install Curl development headers with SSL support:
Please run yum install curl-devel as root.
* To install OpenSSL development headers:
Please run yum install openssl-devel as root.
* To install Zlib development headers:
Please run yum install zlib-devel as root.
If the aforementioned instructions didn't solve your problem, then please take
a look at the Users Guide:
/home/federaltitle/.rvm/gems/ruby-1.9.3-p448/gems/passenger-3.0.17/doc/Users guide Apache.html
But, when I try to install the libraries mentioned in the message (yum install gcc-c++, yum install curl-devel, yum install openssl-devel, yum install zlib-devel) as root user, it is saying all the libraries are already installed and up-to-date.
Server Details
OS - CENTOS 6.4 x86_64

I was able to install the rvm, ruby and passenger as root, and the issue was fixed. Something to do with permission, when done as user. But I had to do some workarounds for the user related activities on the ruby part like bundle install, rake assets:precompile (had to do this as root, so gave sudo permission for the local user to perform these).

Related

Homebrew PHP Install Breaks Apache 2.4

When I recently installed PHP56 via Homebrew, Apache would no longer start, with this error in the logs:
Cannot load /usr/local/opt/php56/libexec/apache2/libphp5.so into server: dlopen(/usr/local/opt/php56/libexec/apache2/libphp5.so, 10): image not found
Note: I'm running Apache 2.4 on Mac El-Capitan.
How can I resolve this error and get Apache running again?
I've seen this before. If you brew options php56, it says:
With the release of macOS Sierra the Apache module is now not built by default. If you want to build it on your system
you have to install php with the --with-apache option. See brew options php56 for more details.
Thus, try uninstalling (brew uninstall php56) then reinstalling php56 with the flag --with-apache for Apache v2.4.x (--with-apache22 for Apache 2.2). Generally, you can check your Apache version by typing in command line: httpd -v.
My version is 2.4.18, so I would brew install php56 --with-apache, which creates the proper file path /usr/local/opt/php56/libexec/apache2/libphp5.so.
Now, it is properly compiled with Apache Handler module.
IMPORTANT: installing php56 with this option appears to also install httpd24. From a brew program stance, this makes sense. However, this may break your server set up. If you don't want to use brew's Apache install, do a brew unlink httpd24 after this.
To see additional brew build options, try brew options php56.

Not able to install mod_perl module on the server

In my site I am getting an error : an error occurred while processing this directive
It was working fine before moving to the new server. So when I checked I found that mod_perl module is missing. So I tried to install it by downloading the module to the server and then tried to run using Perl Makefile.pl but it was asking for apache src and I was not able to find it. I can see /usr/bin/apache/ folder but no source file inside the folder.
So I tried to install the module from Cpanel but I got the following error:
The C compiler is not functional and auto repair failed. Perl module installs require a working C compiler. Please repair the C compiler and try again.
Please let me know how to install it as I have tried most of the cases searching the net.
Thanks in advance
It's probably best to use your distro's packaging system to install mod_perl, especially, if apache is installed from a package too.
Yum based systems:
yum install mod_perl
Deb based systems
apt-get install mod_perl
you may need to enable the module using a2enmod
Mostly gcc is either corrupted or not present on your system. Please try to re/install gcc on your system
sudo apt-get update
sudo apt-get install build-essential
On Redhat:
yum update
yum install devtoolset-2-toolchain
It seems like a problem with your installation of gcc. You're using CloudLinux, so you should use yum to reinstall gcc.
$ sudo -i yum install gcc
But you don't need gcc if you install the pre-build packages.
$ sudo -i yum install mod_perl
Either way, you're going to need to get to grips with package installation for your system - and for that you're going to need root access.

Apache 2 instalation / Ubuntu 13.04 - Package not found

No matter what I do I cannot get the package installed :
sudo su
apt-get update
apt-get upgrade
apt-get install apache2
..though my computer is telling me ...
The program 'apache2' can be found in the following packages:
* apache2-mpm-event
* apache2-mpm-prefork
* apache2-mpm-worker
* apache2-mpm-itk
Try: sudo apt-get install
When I do this ... for instance with
root#xxxx:/home/fakler# apt-get install apache2-mpm-prefork
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package apache2-mpm-prefork
pt-get update shows me many errors like that ...
Err http://security.ubuntu.com raring-security/main i386 Packages
404 Not Found [IP: 91.189.92.201 80]
Tried also installing Apache from here :
https://apps.ubuntu.com/cat/applications/raring/apache2.2-common/
but hitting click on the button available on the Software centre does not wor either (Nothing happens).
Someone has an idea ? Thanks.
Well, I could figure it out myself. Somewhere in Ubuntu, forgotten where, I just found it, there is an option where You can allow the user - Yourself - what are the reliable ressources for software upgrade/download. I did confirm that I allow download from the official Ubuntu ressources/servers as well as canonical software, third party software etc. I did also allow access / updates/installs from my CD Rom drive. After that, I could do the Apache 2 installation.

Deploy Rails 3 with Phusion Passenger on Ubuntu WITH ALL GEMS INCLUDED

I need to deploy a Rails 3/Phusion Passenger/Apache2 app to an Ubuntu 12.04 server without installing ANY gems on the server.
I can install any Debian packages.
How can I include all needed gems (including Rails, a couple of gems installed from git projects on github, and a bunch of regular gems installed from rubygems.org) inside my project so that, after deployment, Passenger will find Rails and all the gems and be happy?
(I know many people will probably be curious WHY I would want to do this. I can't talk about that, unfortunately. Sorry.)
Here are some things that have not worked. One of them might work if revised a little, I don't know:
Failed method 1:
On Ubuntu 12.04 dev machine. Ruby 1.9.3. Bundler 1.3.5. bundle package --all. Git commit.
On Ubuntu 12.04 server machine (gem installation from Internet not possible). Deploy project files and install packages (apache2, ruby1.9.3, ruby-bundler, rubygems, libapache2-mod-passenger which brings ruby1.8 with it). bundle -v gives Bundler version 1.0.15 (from ruby-bundler package). Make sure .bundle/config file from dev machine is also deployed. bundle install --local tries to download git gems from github, so fail.
Try using bundle package --all, which should save your gems into ./vendor/cache. You could also unpack the gems on your local environment with gem unpack --target vendor to save them in the vendor directory. Then you can give a location in the Gemfile so that your application can find the gems. Can you just not use the network to install gems, or are you really not allowed to install gems in any way?
Sources:
1,
2
Try using the pkgr tool, which can convert your Rails app and all dependencies into a single installable Debian package.
Download the bundler 1.3.5 gem from http://rubygems.org/downloads/bundler-1.3.5.gem and put it in vendor/
In an Ubuntu 12.04 vm, do bundle package --all. Git commit and push.
Clone on the Ubuntu server.
apt-get install each of apache2, ruby1.9.3, etc. (not rubygems or ruby-bundler. Both provide an old version of Rubygems and Bundler. A newer version of rubygems is included in the ruby1.9.3 package.)
Follow ALL of the instructions in section 2.3 at http://www.modrails.com/documentation/Users%20guide%20Apache.html#install_on_debian_ubuntu
Make sure you have the right Ruby and Rubygems versions set to the ruby and gem commands:
update-alternatives --install /usr/bin/ruby ruby /usr/bin/ruby1.9.3 200
update-alternatives --install /usr/bin/gem gem /usr/bin/gem1.9.3 200
(Phusion Passenger doesn't care about this, but it's probably a good idea for the gems we are about to install and for debugging stuff with the Rails console or whatever in the future.)
gem install --local vendor/bundler-1.3.5.gem
bundle install --local
Set up all your other Apache config...
service apache2 restart

no such file to load -- openssl

Am trying to load my rails app onto a new linux machine and i have done all the installations required and the bundle install is working .Now my problem is when i start the server (rails s) and then try to open the web app its tells me " no such file to load -- openssl "
LoadError in MembersController#index
no such file to load -- openssl
This error occurred while loading the following files:
openssl
i tried uninstalling openssl (apt-get remove openssl) but still the problem persist.Can some body please help me with it.thanks
Am using ruby 1.8.7 and rails 3.0.0
Are you using RVM?
If so you may want to reinstall ruby with the location of your openssl installation passed as an option:
$ rvm remove 1.8.7
$ rvm install 1.8.7 --with-openssl-dir=/usr/local/openssl # or wherever openssl is installed
On a Debian-based system, you can find where openssl is installed by running the following command:
$ dpkg -L openssl
Alternatively you can have RVM install openssl for you:
$ rvm package install openssl
$ rvm remove 1.8.7
$ rvm install 1.8.7 --with-openssl-dir=$HOME/.rvm/usr
Note that afterwards you'll need to re-install rails:
$ gem install rails
I had this problem with OpenSUSE 12.1 after installing rvm (according to website instructions) and using it to install and use ruby 1.9.2.
Specifying --with-openssl-dir DID NOT solve it for me. But, after I installed libopenssl-devel with the OpenSUSE Software Management utility, "bundle install" complleted successfully.
For me, this issue was fixed (on Debian Lenny) by installing libopenssl-ruby:
$ sudo apt-get install libopenssl-ruby
Debian (did) split the openssl support into a separate package, see what's the role of libopenssl-ruby? for more information.
Using rbenv.
I had this issue after upgrading to Ubuntu 20.04 LTS.
Upgrading to newer version of ruby-build by following rbenv documentation ( do not forget dependencies at the beginning of the tutorial )
https://github.com/rbenv/ruby-build/wiki#updating-ruby-build
and then installing new version of ruby 2.7.1 ( previosly 2.6.0 ) and setting the new version locally where I use it, solved the problem.