# Using a cgi perl program?

**URL:** <https://www.ruby-forum.com/t/using-a-cgi-perl-program/170400>\
**Category:** Rails\
**Created:** [June 17, 2009, 4:28am UTC](https://www.ruby-forum.com/t/using-a-cgi-perl-program/170400 "2009-06-17T04:28:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sean\_McGilvray](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/8c91f0/32.png) [@Sean\_McGilvray](https://www.ruby-forum.com/u/Sean_McGilvray)\
**Post date:** [June 17, 2009, 4:28am UTC](https://www.ruby-forum.com/t/using-a-cgi-perl-program/170400/1 "2009-06-17T04:28:35Z")

</div>

I have a cgi/perl program that I want to use on the same server as my  
RoR app and I keep getting:

The page you were looking for doesn’t exist.

You may have mistyped the address or the page may have moved.

I load the program to the cgi-bin directory in its own folder /cgi-bin/  
fump/

In the /public folder of my app I have the following .htaccess file:

# General Apache options

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

# If you don’t want Rails to look in certain directories,

# use the following rewrite rules so that Apache won’t rewrite certain

requests

# 

# Example:

# RewriteCond %{REQUEST\_URI} ^/notrails.\*

# RewriteRule .\* - [L]

# Redirect all requests not available on the filesystem to Rails

# By default the cgi dispatcher is used which is very slow

# 

# For better performance replace the dispatcher with the fastcgi one

# 

# Example:

# RewriteRule ^(.\*)$ dispatch.cgi [QSA,L]

RewriteEngine On

# If your Rails application is accessed via an Alias directive,

# then you MUST also set the RewriteBase in this htaccess file.

# 

# Example:

# Alias /myrailsapp /path/to/myrailsapp/public

# RewriteBase /myrailsapp

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

# In case Rails experiences terminal errors

# Instead of displaying this message you can supply a file here which

will be rendered instead

# 

# Example:

# ErrorDocument 500 /500.html

ErrorDocument 500 “

## Application error
Rails application failed  
to start properly”

In the /public\_html folder I have this .htaccess file:

Options +FollowSymlinks  
RewriteEngine on

### redirect subdomains to user profile page

RewriteCond %{HTTP\_HOST} !^www.timefreedomnow.net [NC]  
RewriteCond %{HTTP\_HOST} !^support.timefreedomnow.net [NC]  
RewriteCond %{HTTP\_HOST} ([^.]+).timefreedomnow.net [NC]  
RewriteRule ^(.\*)$ [http://www.timefreedomnow.net/profile/%1](http://www.timefreedomnow.net/profile/%251) [L,R]

### redirect subdomains to user profile page

RewriteCond %{HTTP\_HOST} !^www.greatcareerplan.com [NC]  
RewriteCond %{HTTP\_HOST} !^support.greatcareerplan.com [NC]  
RewriteCond %{HTTP\_HOST} ([^.]+).greatcareerplan.com [NC]  
RewriteRule ^(.\*)$ [Greatcareerplan.com is for sale | HugeDomains](http://www.greatcareerplan.com/profile/%251) [L,R]

### redirect /support to [greatcareerplan.zendesk.com](http://greatcareerplan.zendesk.com)

RewriteCond %{HTTP\_HOST} ^support.timefreedomnow.net [NC,OR]  
RewriteCond %{HTTP\_HOST} ^support.greatcareerplan.com [NC]  
RewriteRule ^(.\*)$ [http://greatcareerplan.zendesk.com/$1](http://greatcareerplan.zendesk.com/$1) [L,QSA]

### redirect from old GCP username address’s

### [HugeDomains.com](http://www.greatcareerplan.com/?username)

### to

### [HugeDomains.com](http://www.greatcareerplan.com/profile/username)

RewriteCond %{REQUEST\_URI} ^/$  
RewriteCond %{QUERY\_STRING} ^([a-z0-9]+)$ [NC]  
RewriteRule .\* /profile/%1? [L,R=301]

### Redirect all incoming request for GCP domain’s to Ruby On Rails

Application ###  
RewriteCond %{REQUEST\_URI} !^/cpanel/.\*  
RewriteCond %{REQUEST\_URI} !^/support/.\*  
RewriteCond %{REQUEST\_URI} !^/tr/.\*  
RewriteCond %{REQUEST\_URI} !^/\_mmServerScripts/.\*  
RewriteCond %{HTTP\_HOST} ^(www.)?timefreedomnow.net [NC,OR]  
RewriteCond %{HTTP\_HOST} ^(www.)?greatcareerplan.com [NC]  
RewriteRule ^(.\*)$ /gcp/$1 [L,QSA]

Does anyone know how to make this work?

---

<div class="post-metadata">

**Author:** ![Sean\_McGilvray](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/8c91f0/32.png) [@Sean\_McGilvray](https://www.ruby-forum.com/u/Sean_McGilvray)\
**Post date:** [June 17, 2009, 4:41am UTC](https://www.ruby-forum.com/t/using-a-cgi-perl-program/170400/2 "2009-06-17T04:41:26Z")

</div>

I got it to see the files but it is saying:

Application error  
Rails application failed to start properly

Any help?

---

<div class="post-metadata">

**Author:** ![Sean\_McGilvray](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/8c91f0/32.png) [@Sean\_McGilvray](https://www.ruby-forum.com/u/Sean_McGilvray)\
**Post date:** [June 17, 2009, 4:42am UTC](https://www.ruby-forum.com/t/using-a-cgi-perl-program/170400/3 "2009-06-17T04:42:36Z")

</div>

This is not a Rails App. It is a separate application from my RoR  
app.
