Apache2 not opening .rb extension files

Discussion in 'Apache' started by dodo00700, Feb 1, 2010.

  1. #1
    Halo to everybody

    i wont to learn programming in ruby on rails so i installed everything as it should be but i ren into a problem.

    Apache will not display ani fils whit the extension of .rb. When i click on a file whit the extension apachi ask me to save the file. I try everything except reinstalling.

    i found some tutorials but it still wont work.

    this is my 000-default file. i add a line to it end now apache throw out the 403 error

    <VirtualHost *:80>
    ServerAdmin webmaster@localhost

    DocumentRoot /var/www
    <Directory />
    Options FollowSymLinks
    AllowOverride None
    </Directory>
    <Directory /var/www/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    Order allow,deny
    allow from all
    AddHandler cgi-script rb cgi pl ---- i add this line
    </Directory>

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
    AllowOverride None
    Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
    Order allow,deny
    Allow from all
    AddHandler cgi-script rb cgi pl ---- i add this line
    </Directory>

    ErrorLog /var/log/apache2/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog /var/log/apache2/access.log combined

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
    Options Indexes MultiViews FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
    Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

    </VirtualHost>

    If somebody knows the solution of this problem please help

    Thanks
     
    dodo00700, Feb 1, 2010 IP
  2. hans

    hans Well-Known Member

    Messages:
    2,923
    Likes Received:
    126
    Best Answers:
    1
    Trophy Points:
    173
    #2
    I am NO ruby expert
    but the solution most likely is in the missing addhandler configuration for your ruby extensions

    hence you may be MISSING one or several of below lines:

    AddType application/x-httpd-ruby .rb
    AddType application/x-httpd-ruby .rbx
    Action application/x-httpd-ruby /cgi-bin/ruby.cgi

    in the PROPER apache configuration file - depending on your distribution
    typically in the default apache configuration where you find your:

    DefaultType text/plain
    AddType text/html .htm .html

    you may Google for something like:

    AddType application .rb ruby site:apache.org
    or
    AddType application .rb ruby

    to find some more help instantly if needed


    NOTE that the addhandler line requires the file extension INCLUDING the preceeding DOT = .rb instead of your rb !!

    then TEST your apache config file with the existing apache config test scripts
    in my opensuse this would be:
    rcapache2 configtest
    rcapache2 extreme-configtest

    your dist may have similar test scripts

    and if OK restart your apache

    hope this helps you a step further on your solution
    good luck
     
    hans, Feb 3, 2010 IP
  3. dodo00700

    dodo00700 Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    hallo

    nice thank you. i will tray your suggestion and post the result

    thanks
     
    dodo00700, Feb 4, 2010 IP