Reputation: 1326
I have a VirtualHost in my Apache2:
<VirtualHost *:80>
ServerName 127.0.0.1
ServerAlias localhost
DocumentRoot /var/www/rocketruby/public
<Directory /var/www/rocketruby/public>
AllowOverride all
Options -MultiViews +ExecCGI
RewriteEngine On
RewriteRule ^(.*)$ /redharbor.rbx
</Directory>
</VirtualHost>
redharbor.rbx
is in /var/www/rocketruby/public
and it's access-mode is 0777.
Sadly I get this message:
Forbidden
You don't have permission to access /redharbor.rbx on this server.
Apache/2.2.22 (Ubuntu) Server at localhost Port 80
What has gone wrong, please help!
Upvotes: 1
Views: 386
Reputation: 35483
Some ideas to try...
Try adding two lines as shown below, for "Order" and "Allow", then reload Apache and try accessing your script:
<Directory /var/www/rocketruby/public>
AllowOverride all
Options -MultiViews +ExecCGI
RewriteEngine On
RewriteRule ^(.*)$ /redharbor.rbx
Order Deny,Allow
Allow from all
</Directory>
Are the public directories open? You want to see an "x" for the last access letter:
$ ls -ld /var/www/rocketruby/public
drwxrwxr-x 4 root root 4096 ...
If you delete the rewrite, then reload Apache, does the script work?
$ wget http://localhost/redharbor.rbx
(or use a web browser)
If you delete the rewrite, then reload Apache, can you access a static page?
$ cd /var/www/rocketruby/public
$ echo "Hello" > index.html
$ wget http://localhost/index.html
(or use a web browser)
Are you able to run the script from your command line, i.e. not via Apache?
$ ruby /var/www/rocketruby/public/redharbor.rbx
Have you turned on Ruby in your Apache conf?
<IfModule mod_ruby.c>
RubyRequire apache/ruby-debug
# Execute *.rbx files as Ruby scripts
<Files *.rbx>
Options ExecCGI
SetHandler ruby-object
RubyHandler Apache::RubyDebug.instance
</Files>
</IfModule>
If you still need help, see if you can take a look at the Apache error logs and post the results here.
Upvotes: 2