There''s got to be something simple that I''m missing. I''m running apache 1.3.33 on Windows XP and I can''t seem to get simple CGI working with a simple rails app. I''m hoping one of you can spot my mistake. In my httpd.conf file I''ve got mod_rewrite loaded and added: LoadModule rewrite_module modules/mod_rewrite.so ... AddModule mod_rewrite.c and I''ve got an alias pointing to my rails app like this: Alias "/sample_rails_app" "E:/Dev//www/sample_rails_app/public/" <Directory "E:/Dev/www/sample_rails_app/public"> Options ExecCGI FollowSymLinks AllowOverride all Order allow,deny Allow from all </Directory> When I browse to: http://localhost/sample_rails_app/index.html I get the standard "Congratulations, you''ve put Ruby on Rails!" page, so I know the alias is correct. I''ve got the first line of dispatch.cgi pointing to my installed ruby: #!E:/Dev/ruby/bin/ruby But when I try to browse into a "test" controller I created: http://localhost/sample_rails_app/test/index I get this from apache: Bad Request Your browser sent a request that this server could not understand. Apache/1.3.33 Server at localhost Port 80 What am I doing wrong? Corky __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
I''ve made a little bit of progress by switching from using VirtualHost instead of Alias in my httpd.conf. Now, when I navigate to my app in the browser, apache actually runs rails. But I always get a routing error no matter what URL I try. So far I tried these: http://localhost/sample_rails_app http://localhost/sample_rails_app/ http://localhost/sample_rails_app/index.html http://localhost/sample_rails_app/test/ http://localhost/sample_rails_app/test/index I have a test controller with an index method. In each case I get this error (or similar): Routing Error Recognition failed for "/sample_rails_app/" Even the index.html that holds the Rails "Congratulations" page gets this error. What am I doing wrong? Here''s my VirtualHost definition: <VirtualHost *:80> ServerName localhost DocumentRoot E:/Dev/sample_rails_app/public/ ErrorLog E:/Dev/sample_rails_app/log/server.log <Directory E:/Dev/sample_rails_app/public/> Options ExecCGI FollowSymLinks AllowOverride all Allow from all Order allow,deny </Directory> </VirtualHost> Thanks, in advance for any help. Corky --- Corky Robertson <corkyrobertson-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote:> There''s got to be something simple that I''m missing. > I''m running apache 1.3.33 on Windows XP and I can''t > seem to get simple CGI working with a simple rails > app. I''m hoping one of you can spot my mistake. > > In my httpd.conf file I''ve got mod_rewrite loaded > and > added: > > LoadModule rewrite_module modules/mod_rewrite.so > ... > AddModule mod_rewrite.c > > and I''ve got an alias pointing to my rails app like > this: > > Alias "/sample_rails_app" > "E:/Dev//www/sample_rails_app/public/" > <Directory "E:/Dev/www/sample_rails_app/public"> > Options ExecCGI FollowSymLinks > AllowOverride all > Order allow,deny > Allow from all > </Directory> > > When I browse to: > > http://localhost/sample_rails_app/index.html > > I get the standard "Congratulations, you''ve put Ruby > on Rails!" page, so I know the alias is correct. > > I''ve got the first line of dispatch.cgi pointing to > my > installed ruby: > > #!E:/Dev/ruby/bin/ruby > > But when I try to browse into a "test" controller I > created: > > http://localhost/sample_rails_app/test/index > > I get this from apache: > > Bad Request > Your browser sent a request that this server could > not understand. > Apache/1.3.33 Server at localhost Port 80 > > What am I doing wrong? > > Corky > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam > protection around > http://mail.yahoo.com > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >__________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
I figured it out. Once I switched fro using Alias to VirtualHost, I needed to get rif of my application name in the URL (since that was part of the base document root). So, I should have been using: http://localhost/ http://localhost/index.html http://localhost/test/ http://localhost/test/index Now everything works as expected! Corky --- Corky Robertson <corkyrobertson-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote:> I''ve made a little bit of progress by switching from > using VirtualHost instead of Alias in my httpd.conf. > Now, when I navigate to my app in the browser, > apache > actually runs rails. But I always get a routing > error > no matter what URL I try. So far I tried these: > > http://localhost/sample_rails_app > http://localhost/sample_rails_app/ > http://localhost/sample_rails_app/index.html > http://localhost/sample_rails_app/test/ > http://localhost/sample_rails_app/test/index > > I have a test controller with an index method. In > each > case I get this error (or similar): > > Routing Error > Recognition failed for "/sample_rails_app/" > > Even the index.html that holds the Rails > "Congratulations" page gets this error. > > What am I doing wrong? > > Here''s my VirtualHost definition: > > <VirtualHost *:80> > ServerName localhost > DocumentRoot E:/Dev/sample_rails_app/public/ > ErrorLog E:/Dev/sample_rails_app/log/server.log > <Directory E:/Dev/sample_rails_app/public/> > Options ExecCGI FollowSymLinks > AllowOverride all > Allow from all > Order allow,deny > </Directory> > </VirtualHost> > > Thanks, in advance for any help. > Corky > > --- Corky Robertson <corkyrobertson-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> > wrote: > > > There''s got to be something simple that I''m > missing. > > I''m running apache 1.3.33 on Windows XP and I > can''t > > seem to get simple CGI working with a simple rails > > app. I''m hoping one of you can spot my mistake. > > > > In my httpd.conf file I''ve got mod_rewrite loaded > > and > > added: > > > > LoadModule rewrite_module modules/mod_rewrite.so > > ... > > AddModule mod_rewrite.c > > > > and I''ve got an alias pointing to my rails app > like > > this: > > > > Alias "/sample_rails_app" > > "E:/Dev//www/sample_rails_app/public/" > > <Directory "E:/Dev/www/sample_rails_app/public"> > > Options ExecCGI FollowSymLinks > > AllowOverride all > > Order allow,deny > > Allow from all > > </Directory> > > > > When I browse to: > > > > http://localhost/sample_rails_app/index.html > > > > I get the standard "Congratulations, you''ve put > Ruby > > on Rails!" page, so I know the alias is correct. > > > > I''ve got the first line of dispatch.cgi pointing > to > > my > > installed ruby: > > > > #!E:/Dev/ruby/bin/ruby > > > > But when I try to browse into a "test" controller > I > > created: > > > > http://localhost/sample_rails_app/test/index > > > > I get this from apache: > > > > Bad Request > > Your browser sent a request that this server > could > > not understand. > > Apache/1.3.33 Server at localhost Port 80 > > > > What am I doing wrong? > > > > Corky > > > > __________________________________________________ > > Do You Yahoo!? > > Tired of spam? Yahoo! Mail has the best spam > > protection around > > http://mail.yahoo.com > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam > protection around > http://mail.yahoo.com > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >____________________________________________________ Start your day with Yahoo! - make it your home page http://www.yahoo.com/r/hs