Forum: Ruby on Rails Error installing Rails/FastCGI/Apache2

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
6661ef9d747db3af8896cd94959d717d?d=identicon&s=25 Paul Barry (Guest)
on 2006-01-21 15:40
(Received via mailing list)
Trying to install rails/fcgi/apache2.  Following these instructions:

http://xmlareas.com/ruby-rails-howto.html

Using Fedora Core 4.  I installed ruby and ruby-devel using apt-get.
Everything under Adding FastCGI (optional) works fine up to the gem
install
fcgi part.  Here is what happens:

[root@paulbarry fcgi-2.4.0]# gem install fcgi -r --
-with-fcgi-lib=/usr/local/fcgi/lib
--with-fcgi-include=/usr/local/fcgi/include
Attempting remote installation of 'fcgi'
Building native extensions.  This could take a while...
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/usr/bin/ruby
        --with-fcgi-dir
        --without-fcgi-dir
        --with-fcgi-include=${fcgi-dir}/include
        --with-fcgi-lib
        --without-fcgi-lib=${fcgi-dir}/lib
        --with-fcgilib
        --without-fcgilib
ERROR:  While executing gem ... (RuntimeError)
    ERROR: Failed to build gem native extension.
Gem files will remain installed in
/usr/lib/ruby/gems/1.8/gems/fcgi-0.8.6.1for inspection.
  ruby extconf.rb install fcgi -r -- -with-fcgi-lib=/usr/local/fcgi/lib
--with-fcgi-include=/usr/local/fcgi/include\nchecking for fcgiapp.h...
yes
checking for FCGX_Accept() in -lfcgi... no

Here's what mkmf.log has to say:

[root@paulbarry fcgi-2.4.0]# cat /usr/lib/ruby/gems/1.8/gems/fcgi-
0.8.6.1/ext/mkmf.log
have_header: checking for fcgiapp.h... -------------------- yes

"i386-redhat-linux-gcc -E -I. -I/usr/lib/ruby/1.8/i386-linux
-I/usr/local/fcgi/include  -O0 -g -pipe -Wp,-D_FORTIFY_SOURCE=2
-fexceptions
-m32 -march=i386 -mtune=pentium4 -fasynchronous-unwind-tables -Wall
-fPIC
conftest.c -o conftest.i"
checked program was:
/* begin */
#include <fcgiapp.h>
/* end */

--------------------

have_library: checking for FCGX_Accept() in -lfcgi...
--------------------
no

"i386-redhat-linux-gcc -o conftest -I. -I/usr/lib/ruby/1.8/i386-linux
-I/usr/local/fcgi/include  -O0 -g -pipe -Wp,-D_FORTIFY_SOURCE=2
-fexceptions
-m32 -march=i386 -mtune=pentium4 -fasynchronous-unwind-tables -Wall
-fPIC
conftest.c  -L"/usr/lib"      -lruby-static -lfcgi  -ldl -lcrypt -lm
-lc"
conftest.c: In function 't':
conftest.c:4: warning: implicit declaration of function 'FCGX_Accept'
/usr/bin/ld: cannot find -lfcgi
collect2: ld returned 1 exit status
checked program was:
/* begin */

/*top*/
int main() { return 0; }
int t() { FCGX_Accept(); return 0; }
/* end */

"i386-redhat-linux-gcc -o conftest -I. -I/usr/lib/ruby/1.8/i386-linux
-I/usr/local/fcgi/include  -O0 -g -pipe -Wp,-D_FORTIFY_SOURCE=2
-fexceptions
-m32 -march=i386 -mtune=pentium4 -fasynchronous-unwind-tables -Wall
-fPIC
conftest.c  -L"/usr/lib"      -lruby-static -lfcgi  -ldl -lcrypt -lm
-lc"
conftest.c: In function 't':
conftest.c:5: error: 'FCGX_Accept' undeclared (first use in this
function)
conftest.c:5: error: (Each undeclared identifier is reported only once
conftest.c:5: error: for each function it appears in.)
checked program was:
/* begin */


/*top*/
int main() { return 0; }
int t() { void ((*volatile p)()); p = (void ((*)()))FCGX_Accept; return
0; }
/* end */

--------------------

Help!
9ab183bb240ffd3a3966d5a615b4bdeb?d=identicon&s=25 Philip Ross (Guest)
on 2006-01-21 15:40
(Received via mailing list)
Paul Barry wrote:
> --with-fcgi-include=/usr/local/fcgi/include
Looks like you're missing a hyphen in the with-fcgi-lib option. It
should be

gem install fcgi -r -- --with-fcgi-lib=/usr/local/fcgi/lib
--with-fcgi-include=/usr/local/fcgi/include

Phil

--
Philip Ross
http://tzinfo.rubyforge.org/ -- DST-aware timezone library for Ruby
9b7647d55df4584d7031130915556040?d=identicon&s=25 Will Briggs (Guest)
on 2006-01-21 15:40
(Received via mailing list)
Did you install the fast CGI development libraries?  If so, what path
are
they located in?  Is this path in your LD_LIBRARY_PATH, or in your
/etc/ld.so.conf file?  If you added the appropriate path to your
ld.so.conffile, did you run ldconfig afterwards?

-Will
6661ef9d747db3af8896cd94959d717d?d=identicon&s=25 Paul Barry (Guest)
on 2006-01-21 15:40
(Received via mailing list)
I started over with this method, which I had more success with:

$ tar zxvf fcgi-2.4.0.tar.gz
$ cd fcgi-2.4.0
$ ./configure
$ make
$ make install
$ gem install fcgi
$ wget http://www.wesmo.com/redhat/i386/mod_fastcgi-2.4.2...
$ rpm -ivh mod_fastcgi-2.4.2-1.i386.rpm

That got fastcgi and mo_fastcgi installed.  I added this to my
httpd.conf:

LoadModule fastcgi_module modules/mod_fastcgi.so

<IfModule mod_fastcgi.c>
  FastCgiIpcDir /tmp/fcgi_ipc
  FastCgiServer /home/paulbarry/public/dispatch.fcgi \
    -initial-env RAILS_ENV=development \
    -idle-timeout 60
</IfModule>

And I set the set the permissions on /tmp/fcgi_ipc:

$ mkdir /tmp/fcgi_ipc
$ chown apache.apache /tmp/fcgi_ipc -R
$ chmod 755 /tmp/fcgi_ipc -R
$ ls -l /tmp
drwxr-xr-x   2 apache apache   4096 Jan 14 16:19 fcgi_ipc

When I start apache, I get this error:

$ /etc/init.d/httpd start
Starting httpd: Syntax error on line 195 of /etc/httpd/conf/httpd.conf:
FastCgiIpcDir /tmp/fcgi_ipc: access for server (uid -1, gid -1) failed:
write not allowed
                                                           [FAILED]

Any ideas as to what is causing that error?  In the meantime I think it
is
time to give lightty a try...
Bb4bdf2b184027bc38d4fb529770cde5?d=identicon&s=25 Wes Gamble (weyus)
on 2006-04-04 17:25
I couldn't get the fcgi to work unless I gave /tmp/fcgi_ipc AND
/tmp/fcgi_ipc/dynamic 777.

Wes

Paul Barry wrote:
<IfModule mod_fastcgi.c>
>   FastCgiIpcDir /tmp/fcgi_ipc
>   FastCgiServer /home/paulbarry/public/dispatch.fcgi \
>     -initial-env RAILS_ENV=development \
>     -idle-timeout 60
> </IfModule>
>
> And I set the set the permissions on /tmp/fcgi_ipc:
>
> $ mkdir /tmp/fcgi_ipc
> $ chown apache.apache /tmp/fcgi_ipc -R
> $ chmod 755 /tmp/fcgi_ipc -R
> $ ls -l /tmp
> drwxr-xr-x   2 apache apache   4096 Jan 14 16:19 fcgi_ipc
>
> When I start apache, I get this error:
>
> $ /etc/init.d/httpd start
> Starting httpd: Syntax error on line 195 of /etc/httpd/conf/httpd.conf:
> FastCgiIpcDir /tmp/fcgi_ipc: access for server (uid -1, gid -1) failed:
> write not allowed
>                                                            [FAILED]
>
> Any ideas as to what is causing that error?  In the meantime I think it
> is
> time to give lightty a try...
435630373f6ee0fd7d1e0142d1ccb625?d=identicon&s=25 Peter Gibbons (Guest)
on 2006-04-04 18:22
Paul Barry wrote:
>
> That got fastcgi and mo_fastcgi installed.  I added this to my
> httpd.conf:
>
> LoadModule fastcgi_module modules/mod_fastcgi.so
>

If you use Apache 2.x, use mod_fcgid instead of mod_fastcgi.

This is noted in the rails FAQ.

http://wiki.rubyonrails.com/rails/pages/FAQ
9e3303ca543a7e422e3867cdb57f1f89?d=identicon&s=25 Denis (Guest)
on 2007-02-19 22:53
Paul Barry wrote:
> I started over with this method, which I had more success with:
>
> $ tar zxvf fcgi-2.4.0.tar.gz
> $ cd fcgi-2.4.0
> $ ./configure
> $ make
> $ make install
> $ gem install fcgi
> $ wget http://www.wesmo.com/redhat/i386/mod_fastcgi-2.4.2...
> $ rpm -ivh mod_fastcgi-2.4.2-1.i386.rpm
>
> That got fastcgi and mo_fastcgi installed.  I added this to my
> httpd.conf:
>
> LoadModule fastcgi_module modules/mod_fastcgi.so
>
> <IfModule mod_fastcgi.c>
>   FastCgiIpcDir /tmp/fcgi_ipc
>   FastCgiServer /home/paulbarry/public/dispatch.fcgi \
>     -initial-env RAILS_ENV=development \
>     -idle-timeout 60
> </IfModule>
>
> And I set the set the permissions on /tmp/fcgi_ipc:
>
> $ mkdir /tmp/fcgi_ipc
> $ chown apache.apache /tmp/fcgi_ipc -R
> $ chmod 755 /tmp/fcgi_ipc -R
> $ ls -l /tmp
> drwxr-xr-x   2 apache apache   4096 Jan 14 16:19 fcgi_ipc
>
> When I start apache, I get this error:
>
> $ /etc/init.d/httpd start
> Starting httpd: Syntax error on line 195 of /etc/httpd/conf/httpd.conf:
> FastCgiIpcDir /tmp/fcgi_ipc: access for server (uid -1, gid -1) failed:
> write not allowed
>                                                            [FAILED]
>
> Any ideas as to what is causing that error?  In the meantime I think it
> is
> time to give lightty a try...

Hi, the problem is that apache server isn't allowed to read that
directory

this is not user and group

this is how your apache configure in httpd.conf

you need to add something like
<Directory /tmp/fcgi_ipc>
Allow from all
</Directory>
This topic is locked and can not be replied to.