M
Michael Gebhart
Hi,
I have a server running an apache2. I've decided to play around with ruby
on rails, so I wanted to install rails with apache2. My first idea was to
use fastcgi (mod_fastcgi), but this didn't work at all.
So I tried to get scgi_rails working:
Is it right, that scgi_rails is a server managing all the requests written
in ruby? the mod_scgi for apache is only for forwarding the requests of a
virtualhost to the internal port of scgi_rails? I don't understand how
scgi_rails could have enough performance to manage all the requests on a
often visited webpage. Apache is written in C, so I thought that managing
the requests in apache and using mod_fastcgi should be faster. Can you
explain why scgi_rails is fast enough and if I have understood it right,
that mod_scgi is only for forwarding the requests?
Well, now I've tried to install scgi_rails. And it is nearly working
correct. But I have still a few problems, maybe you can help me:
I've used this tutorial:
http://wiki.rubyonrails.com/rails/pages/SCGI+Rails+Runner+with+Apache+2+on+Linux
This is my virtualHost:
<VirtualHost myIP:80>
AddDefaultCharset utf-8
ServerName myDomain
DocumentRoot /srv/www/htdocs/myRailsDir/public
ErrorDocument 500 /500.html
ErrorDocument 404 /404.html
# handle all requests throug SCGI
SCGIMount /scgi-bin/ 127.0.0.1:9999
<Directory /srv/www/htdocs/myRailsDir/public>
Options Indexes FollowSymLinks
AllowOverride All
</Directory>
</VirtualHost>
Can you tell me, what /scgi-bin/ is for?
I changed my .htaccess and changed the dispatch.fcgi line to:
RewriteRule ^(.*)$ /scgi-bin/$1 [QSA,L]
Now, when calling e.g. the method "hello" of my controller "say" I get
this message:
Unknown action
No action responded to hello.html
When deleting this line from the .htaccess:
RewriteRule ^([^.]+)$ $1.html [QSA]
it is working.
Do you know, where the problem is?
And: I always have to start scgi_rails manually. Is this the right way? Or
is there a chance to get apache starting the scgi_rails when it is needed?
Greetings
Mike
I have a server running an apache2. I've decided to play around with ruby
on rails, so I wanted to install rails with apache2. My first idea was to
use fastcgi (mod_fastcgi), but this didn't work at all.
So I tried to get scgi_rails working:
Is it right, that scgi_rails is a server managing all the requests written
in ruby? the mod_scgi for apache is only for forwarding the requests of a
virtualhost to the internal port of scgi_rails? I don't understand how
scgi_rails could have enough performance to manage all the requests on a
often visited webpage. Apache is written in C, so I thought that managing
the requests in apache and using mod_fastcgi should be faster. Can you
explain why scgi_rails is fast enough and if I have understood it right,
that mod_scgi is only for forwarding the requests?
Well, now I've tried to install scgi_rails. And it is nearly working
correct. But I have still a few problems, maybe you can help me:
I've used this tutorial:
http://wiki.rubyonrails.com/rails/pages/SCGI+Rails+Runner+with+Apache+2+on+Linux
This is my virtualHost:
<VirtualHost myIP:80>
AddDefaultCharset utf-8
ServerName myDomain
DocumentRoot /srv/www/htdocs/myRailsDir/public
ErrorDocument 500 /500.html
ErrorDocument 404 /404.html
# handle all requests throug SCGI
SCGIMount /scgi-bin/ 127.0.0.1:9999
<Directory /srv/www/htdocs/myRailsDir/public>
Options Indexes FollowSymLinks
AllowOverride All
</Directory>
</VirtualHost>
Can you tell me, what /scgi-bin/ is for?
I changed my .htaccess and changed the dispatch.fcgi line to:
RewriteRule ^(.*)$ /scgi-bin/$1 [QSA,L]
Now, when calling e.g. the method "hello" of my controller "say" I get
this message:
Unknown action
No action responded to hello.html
When deleting this line from the .htaccess:
RewriteRule ^([^.]+)$ $1.html [QSA]
it is working.
Do you know, where the problem is?
And: I always have to start scgi_rails manually. Is this the right way? Or
is there a chance to get apache starting the scgi_rails when it is needed?
Greetings
Mike