RailsAndApache2

From $1

Table of contents
[MISSING]
  • In httpd.conf

NameVirtualHost 127.0.0.1
<VirtualHost localhost>
    ServerName localhost
    DocumentRoot /usr/local/apache/htdocs
    ErrorLog /usr/local/apache/logs/error.log
    <Directory /usr/local/apache/htdocs>
      Options ExecCGI FollowSymLinks
      AddHandler cgi-script .cgi
      AllowOverride all
      Order allow,deny
      Allow from all
    </Directory>
  </VirtualHost>
<VirtualHost zconomy>
    ServerName zconomy
    DocumentRoot /rails/zconomy/public/
    ErrorLog /rails/zconomy/log/apache.log
    <Directory /rails/zconomy/public/>
      Options ExecCGI FollowSymLinks
      AddHandler cgi-script .cgi
      AllowOverride all
      Order allow,deny
      Allow from all
    </Directory>
  </VirtualHost>

You might also find that FastCGI (or even CGI) is a pain:

If you've successfully run a Rails controller via CGI, and you use Oracle, and you're finding that you get a lot of the following messages in your Apache log when you try to switch to FastCGI via dispatch.fcgi:

[warn] FastCGI: (dynamic) server "/rails/msproj/public/dispatch.fcgi" restarted (pid 2327)
[warn] FastCGI: (dynamic) server "/rails/msproj/public/dispatch.fcgi" (pid 2327) terminated by calling exit with status '0'
[warn] FastCGI: (dynamic) server "/rails/msproj/public/dispatch.fcgi" has failed to remain running for 30 seconds given 3 attempts, its restart interval has been backed off to 600 seconds
[warn] FastCGI: (dynamic) server "/rails/msproj/public/dispatch.fcgi" has failed to remain running for 30 seconds given 3 attempts, its restart interval has been backed off to 600 seconds

Then you probably need the following in your httpd.conf file:

SetEnv LD_LIBRARY_PATH=/usr/local/oracle/lib
SetEnv ORACLE_HOME=/usr/local/oracle
SetEnv ORACLE_SID=orcl
FastCgiConfig -initial-env CPATH=/usr/include/oracle/10.1.0.3/client -initial-env LD_LIBRARY_PATH=/usr/local/oracle/lib -initial-env ORACLE_HOME=/usr/local/oracle -initial-env ORACLE_SID=orcl
Tags:
none
 
Images (0)
 
Comments (0)
You must login to post a comment.