Problem: Getting Rails to run on apache


#1

hello. I need some help getting rails to run on apache2/red hat. Made
the correct alias and directory in the .conf, but when I point the
browser to the directory it gives me a 404 on the dispatch.cgi. I have
not added fastcgi. i think im missing something basic. possibly
something in .htaccess

pointers appreciated


#2

In article removed_email_address@domain.invalid,
one man army removed_email_address@domain.invalid wrote:

hello. I need some help getting rails to run on apache2/red hat. Made
the correct alias and directory in the .conf, but when I point the
browser to the directory it gives me a 404 on the dispatch.cgi. I have
not added fastcgi. i think im missing something basic. possibly
something in .htaccess

pointers appreciated

I got a little further, now the dispatch.cgi is being invoked, but I get
an internal error 500. ugh.


Internal Server Error

The server encountered an internal error or misconfiguration and was
unable to complete your request.

Please contact the server administrator, xxx and inform them of the time
the error occurred, and anything you might have done that may have
caused the error.

More information about this error may be available in the server error
log.
Apache/2.0.46 (Red Hat) Server at www.mocana-release.com Port 80


#3

On Thursday 01 December 2005 03:07, one man army wrote:

the error occurred, and anything you might have done that may have
caused the error.

More information about this error may be available in the server error
log.
Apache/2.0.46 (Red Hat) Server at www.mocana-release.com Port 80

You’ll find more help and more quickly over at the Rails list:
http://lists.rubyonrails.org/mailman/listinfo/rails

Hope you get it fixed though!


#4

The oldest problem known to computers… CR-LF vs \n !
but with httpd.conf and .htaccess throwing constant doubt, it
was never clear. What an exercise in frustration. The files had come
from Windows, and got sftp’d to the Linux machine. No one sustpected.
In anested heirarchy and no suffixes, not that easy to fix, either.

Here are some resources that opened up during the frantic search:

IRC - not, no one jumped in. REALLY hard to read. Shizo in a window…

http://lists.rubyonrails.org/mailman/listinfo/rails
http://www.ruby-forum.com
http://wiki.rubyonrails.com/rails/pages

<http://66.102.7.104/search?q=cache:M7NBv8GLChEJ:www.numberporn.com/archi
ves/000118.php+htaccess+error+rails&hl=en>
http://httpd.apache.org/docs/1.3/misc/rewriteguide.html

hth


#5

A little shell lovin’ mixed with Ruby would have seen you through.
The find command is incredibly powerful, but set aside a day or two
for digging through the man page. :slight_smile:

$ cd /root/of/cr-lf/nightmare
$ find . -name ‘*.conf’ -exec ruby -pi -e ‘sub(/\r\n/,"\n")’ {} ;

That will walk through the tree and exec that ruby bit against every
file whose name matches *.conf. Note that you need all the gunk all
the way to the last semicolon.

Corey