Navigate
Home
ArticleWiki
Forum
Newsletter
Links
Tech News
Welcome Guest.
Username:

Password:

Remember me

Setting up Apache for Ruby
Welcome, Guest. Please login or register.
February 08, 2012, 05:47:35 PM
11513 Posts in 1262 Topics by 496 Members
Latest Member: Beerdernill
Experts Round Table Network  |  Webservers  |  Apache  |  Setting up Apache for Ruby « previous next »
Pages: [1]
Author Topic: Setting up Apache for Ruby  (Read 849 times)
ScottInTexas

Offline Offline

Posts: 10


« on: October 21, 2009, 06:18:16 AM »

I hope someone can help with this. I have recently installed Ruby and Ruby on Rails. I already have Apache, MySQL and PHP running. After reading Roy Thomas Fielding's Disertation on Architectual Styles and the Design of Network-based Software Architectures I decided to learn Ruby. So I have to get it working on my machine  (Windows XP, SP3). The problem: When I navigate to my test program called blog, I get the index of the directory. It seems to me this happened when I installed php a few years ago. It is obvious I am not executing the cgi. Information on the web keeps talking about the .htaccess file which I don't have. I don't want to create a new problem. Other information on the web is mostly Linux setups and don't seem to fit my system enough to figure out where to look for the answers.

My hosts file;
127.0.0.1   localhost
127.0.0.1   blog

My httpd file:
Code:
#10-04-09

ServerRoot "C:/Apache Software Foundation/Apache2.2"
Listen 80
LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule asis_module modules/mod_asis.so
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule authn_default_module modules/mod_authn_default.so
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authz_default_module modules/mod_authz_default.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule cgi_module modules/mod_cgi.so
LoadModule dir_module modules/mod_dir.so
LoadModule env_module modules/mod_env.so
LoadModule include_module modules/mod_include.so
LoadModule isapi_module modules/mod_isapi.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule setenvif_module modules/mod_setenvif.so

LoadModule php5_module "c:/webdevelop/php/php5apache2_2.dll"
AddType application/x-httpd-php .php
# configure the path to php.ini
PHPIniDir "C:/WebDevelop/php"


<IfModule !mpm_netware_module>
<IfModule !mpm_winnt_module>
User daemon
Group daemon
</IfModule>
</IfModule>

# 'Main' server configuration
ServerAdmin im1in260m@yahoo.com
ServerName www.mynet.com:80

NameVirtualHost *
<VirtualHost *>
ServerName localhost:80
# Document Location Root
DocumentRoot "C:/Apache Software Foundation/Apache2.2/htdocs"

<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>
<Directory "C:/Apache Software Foundation/Apache2.2/htdocs">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
    DirectoryIndex index.html
</IfModule>

#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<FilesMatch "^\.ht">
    Order allow,deny
    Deny from all
    Satisfy All
</FilesMatch>

ErrorLog "logs/error.log"

LogLevel warn

<IfModule log_config_module>
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogFormat "%h %l %u %t \"%r\" %>s %b" common

    <IfModule logio_module>
      # You need to enable mod_logio.c to use %I and %O
      LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
    </IfModule>
    CustomLog "logs/access.log" common
</IfModule>

<IfModule alias_module>

Alias "/AlaskaErrands" "C:/WebDevelop/AlaskaErrands"
<Directory "C:/WebDevelop/AlaskaErrands">
AllowOverride None
Options Indexes FollowSymLinks
Order allow,deny
Allow from all
</Directory>

Alias "/phpmyadmin" "C:/Webdevelop/phpMyAdmin"
<Directory "C:/WebDevelop/phpMyAdmin">
AllowOverride None
Options Indexes FollowSymLinks
Order allow,deny
Allow from all
</Directory>
    ScriptAlias /cgi-bin/ "C:/Apache Software Foundation/Apache2.2/cgi-bin/"
</IfModule>

<IfModule cgid_module>
</IfModule>

<Directory "C:/Apache Software Foundation/Apache2.2/cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
</Directory>

DefaultType text/plain

<IfModule mime_module>
TypesConfig conf/mime.types
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz
</IfModule>

# Virtual hosts
#Include conf/extra/httpd-vhosts.conf
<VirtualHost *>
ServerName blog

DocumentRoot "C:/rails/blog/public"
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory "C:/rails/blog/public">
                Options +ExecCGI indexes FollowSymLinks
                AllowOverride all
                Allow from all
                Order allow,deny
        </Directory>
        <Directory "C:/rails/blog">
                Options +ExecCGI indexes FollowSymLinks
                AllowOverride all
                Allow from all
                Order allow,deny
        </Directory>
       
</VirtualHost>

# Local access to the Apache HTTP Server Manual
Include conf/extra/httpd-manual.conf

<IfModule ssl_module>
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin
</IfModule>

Apache is running and MySQL is running. I can navigate to phpMyAdmin without a problem.

I am sure there is something simple going on here, but I don't know what, so my assurances may just be BS.

Thanks for looking.

Scott
Logged

Thanks,
Scott
The Answer is 42
VGR
Mentor

Offline Offline

Posts: 724



WWW
« Reply #1 on: November 12, 2009, 11:10:54 AM »

first, you don't run a CGI at all. Your PHP is configured to be an Apache SAPI module, apprently.

If you get the directory list in accessing http://localhost/ or http://blog/ it's normal. You probably don't have an index page... (index.html or index.php). You could also pay attention to the httpd.conf settings about index page' allowed extensions.

HTH
Logged

techie overlord, answers all kind of questions on http://www.europeanexperts.org
Pages: [1]
« previous next »
    Jump to: