# RoR and Apache2 and app in local directory

**URL:** <https://www.ruby-forum.com/t/ror-and-apache2-and-app-in-local-directory/51561>\
**Category:** Rails\
**Created:** [January 3, 2006, 8:04am UTC](https://www.ruby-forum.com/t/ror-and-apache2-and-app-in-local-directory/51561 "2006-01-03T08:04:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnt519](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/cab0a1/32.png) [@johnt519](https://www.ruby-forum.com/u/johnt519)\
**Post date:** [January 3, 2006, 8:04am UTC](https://www.ruby-forum.com/t/ror-and-apache2-and-app-in-local-directory/51561/1 "2006-01-03T08:04:43Z")

</div>

Hi all. I’m at my wits end… I’m trying to set up a Rails app (on a  
Ubuntu system), within the public\_html directory in my home directory  
(as opposed to the /var/www/ directory). ie. in  
/users/john/public\_html/myapp

I have a simple app setup, and using the Webrick server it works fine.

But trying to get Apache to work is becoming a pain in the _&^_.

I followed the directions on this page:

[http://wiki.rubyonrails.com/rails/pages/HowToUseRailsWithRewrittenURLs](http://wiki.rubyonrails.com/rails/pages/HowToUseRailsWithRewrittenURLs)

But when I try going to the URL of a controller I get:

“You don’t have permission to access /~john/myapp/public/dispatch.cgi on  
this server”

I’m guessing it has to do with not having CGI access in the directory,  
but I don’t know how to get it set up. I haven’t touched the default  
apache2.conf file (I’m not sure what to add), and adding the line:

Options +FollowSymLinks +ExecCGI

to the .htaccess file gives an error (‘Options’ is not allowed in the  
.htaccess file)

Does anyone have any hints or tips on what I need to change? I’m sure  
it’s something in the apache2.conf file (or maybe a file in the  
/etc/apache2/sites-available/ directory?)

Thanks a bunch - this seems like a whole lot of hassle to go through  
just to get a simple site up and running!

– John

---

<div class="post-metadata">

**Author:** ![johnt519](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/cab0a1/32.png) [@johnt519](https://www.ruby-forum.com/u/johnt519)\
**Post date:** [January 3, 2006, 2:31pm UTC](https://www.ruby-forum.com/t/ror-and-apache2-and-app-in-local-directory/51561/2 "2006-01-03T14:31:00Z")

</div>

I may be offf base here, but is the owner/group www-data for your  
directories / files?

Michael T.

---

<div class="post-metadata">

**Author:** ![johnt519](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/cab0a1/32.png) [@johnt519](https://www.ruby-forum.com/u/johnt519)\
**Post date:** [January 3, 2006, 12:10pm UTC](https://www.ruby-forum.com/t/ror-and-apache2-and-app-in-local-directory/51561/3 "2006-01-03T12:10:30Z")

</div>

Am Dienstag, den 03.01.2006, 08:04 +0100 schrieb John T.:

> just to get a simple site up and running!
> 
> – John

If that is not your server you should tell your administrator to let you  
execute CGI scripts. This can be done to set the above Options directive  
in the vhost configuration. If your server runs Debian this is in  
fact /etc/apache2/sites-available/[your\_vhost\_file].

If your Administrator is a nice guy he could set the AllowOverride  
Options directive in your vhost configuration, so that your .htaccess  
Options directive will work.

There is no proof that this will solve your problem, but may help you to  
get on the right way.

---

<div class="post-metadata">

**Author:** ![johnt519](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/cab0a1/32.png) [@johnt519](https://www.ruby-forum.com/u/johnt519)\
**Post date:** [January 3, 2006, 2:36pm UTC](https://www.ruby-forum.com/t/ror-and-apache2-and-app-in-local-directory/51561/4 "2006-01-03T14:36:42Z")

</div>

Norman T. wrote:

> If that is not your server you should tell your administrator to let you  
> execute CGI scripts. This can be done to set the above Options directive  
> in the vhost configuration. If your server runs Debian this is in  
> fact /etc/apache2/sites-available/[your\_vhost\_file].
> 
> If your Administrator is a nice guy he could set the AllowOverride  
> Options directive in your vhost configuration, so that your .htaccess  
> Options directive will work.
> 
> There is no proof that this will solve your problem, but may help you to  
> get on the right way.

Ah ha… it was my own error. It is my own server, so I can make  
whatever changes I need. I did have a configuration file in  
/etc/apache2/sites-available … but I had forgotten to create the  
corresponding file in /etc/apache2/sites-enabled. Once I did that, I was  
able to use the Option ExecCGI in my .htaccess.

Thanks!
