# Apache deployment - Debugging

**URL:** <https://www.ruby-forum.com/t/apache-deployment-debugging/231107>\
**Category:** Deployment\
**Created:** [July 22, 2014, 1:04am UTC](https://www.ruby-forum.com/t/apache-deployment-debugging/231107 "2014-07-22T01:04:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [July 22, 2014, 1:04am UTC](https://www.ruby-forum.com/t/apache-deployment-debugging/231107/1 "2014-07-22T01:04:35Z")

</div>

I have the following setup on a new box (to mimic a machine that failed)

Ruby 1.8.4  
Rails 1.1.6  
RubyGems 0.9.0

Running Apache version 1.33 (as this is an old OSX server build) and  
therefore passenger is not installed on this machine. This is a single  
Rails APP running on a machine with 2 virtual hosts (the same site, just  
one running port 80, which forwards to 443 (the second virtual host) for  
all code execution).

I have the entire subfolder of the project from the previous machine.  
The only difference that I can tell is that PostgreSQL is being hosted  
on another machine, rather than the same machine (as prior) I have  
adjusted the database.yml file to reflect this, for connection details  
in the code execution.

This project is running on a machine, running FastCGI. I installed the  
mod\_fastcgi.so in Apache and added the following lines to httpd.conf

LoadModule fastcgi\_module libexec/httpd/mod\_fastcgi.so  
AddModule mod\_fastcgi.c

 FastCgiIpcDir /tmp/fcgi\_ipc AddHandler fastcgi-script .fcgi

\*\* /tmp/fcgi\_ipc directory has writeable permissions

I then made sure that added the following to one of my site definitions  
under apache in /etc/httpd/sites/

\<Directory “path to public folder of my rails APP”\>  
AllowOverride all  
Allow from all  
Order allow,deny

The .htaccess file in public/ folder is a normal .htaccess file that  
didn’t seem to be any different for the project I brought over,  
including the lines

# General Apache options

AddHandler fastcgi-script .fcgi  
AddHandler cgi-script .cgi  
Options +FollowSymLinks +ExecCGI

AND

RewriteRule ^$ index.html [QSA]  
RewriteRule ^([^.]+)$ $1.html [QSA]  
RewriteCond %{REQUEST\_FILENAME} !-f  
RewriteRule ^(.\*)$ dispatch.fcgi [QSA,L]

I will ALWAYS get a 500 error, and will then see the output of the  
500.html file, in the public folder, which will yield the typical  
“Change this error message for exceptions thrown outside of an action  
(like in Dispatcher setups or broken Ruby code) in public/500.html”

Is there a way I can get some active debugging, to see if my code is  
even being parsed by Apache ?

I tried to start a new project just from scratch to ensure that rails  
produced a project structure, etc, and then ran that project using  
script/server and looked at it through webRICK using 0.0.0.0:3000 and  
all seemed well, with the usual “You’re riding rails” screen…

I really need to try to make this thing work (as I am sure the rails  
side of things is OK, since this is a straight copy of a previous  
deployment), and am willing to provide payment for services if required,  
it just seems quite difficult to find legacy support for old Ruby code  
and updating the code at this point isn’t really a priority, just want  
to get it back on track.

Thanks in advance to you all !
