Skip to content

Instantly share code, notes, and snippets.

@paridin
Last active August 28, 2015 23:10
Show Gist options
  • Save paridin/b676e9979e274cc9ce93 to your computer and use it in GitHub Desktop.
Save paridin/b676e9979e274cc9ce93 to your computer and use it in GitHub Desktop.
A helper for install fcgi using ruby in a share hosting.

Some times we have a share hosting without privileges, my goal for today, is set up a redmine instance in my hosting actually I have a instance with a2hosting, but i think it will be the same steps for others because I always work with my home directory

Currently I work with custom struct $HOME/.local for every local install and my custom temp dir is $HOME/.local/tmp

$HOME/.local/share
$HOME/.local/bin
$HOME/.local/lib
$HOME/.local/include
$HOME/.local/tmp

so I change to my temp dir, and I download the source from http://www.fastcgi.com wget http://www.fastcgi.com/dist/fcgi.tar.gz

Unpackage the tar.gz
tar -xvzf fcgi.tar.gz
cd fcgi-* # at this moment fcgi-2.4.1-SNAP-0311112127
./configure --prefix=$HOME/.local

gem install fcgi

Errors during installation, Fix them

first error
fcgio.cpp: In destructor 'virtual fcgi_streambuf::~fcgi_streambuf()':
fcgio.cpp:50: error: 'EOF' was not declared in this scope
fcgio.cpp: In member function 'virtual int fcgi_streambuf::overflow(int)':
fcgio.cpp:70: error: 'EOF' was not declared in this scope
fcgio.cpp:75: error: 'EOF' was not declared in this scope
fcgio.cpp: In member function 'virtual int fcgi_streambuf::sync()':
fcgio.cpp:86: error: 'EOF' was not declared in this scope
fcgio.cpp:87: error: 'EOF' was not declared in this scope
fcgio.cpp: In member function 'virtual int fcgi_streambuf::under
To fix, we only need include <stdio.h> on fcgio.cpp and then we add #include <stdio.h> in line 24

vi ./libfcgi/fcgio.cpp

23: #endif
24: #include <stdio.h>
25: 
26: #include <limits.h>
second error
ERROR:  Error installing fcgi:
	ERROR: Failed to build gem native extension.

    $HOME/.rvm/rubies/ruby-2.2.1/bin/ruby -r ./siteconf20150828-277-zyb84x.rb extconf.rb
checking for fcgiapp.h... no
checking for fastcgi/fcgiapp.h... no
To fix, we only need export the CONFIGURE_ARGS variable with our headers and libs recently installed.

export CONFIGURE_ARGS="with-fcgi-include=$HOME/.local/include with-fcgi-lib=$HOME/.local/lib"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment