I run a rails app at /home/vincent/Documents/vincentApp/ . The app runs fine with WEBrick on localhost:3000. However, I am getting a Forbidden error when accessing the app on Apache on port 80. I suspect this is more of a problem with my Apache config than with Rails or Passenger. The configs are below. Please help. Thanks. I have Passenger installed. The following is in /etc/apache2/apache2.conf: # Passenger LoadModule passenger_module /var/lib/gems/1.8/gems/passenger-2.2.8/ext/ apache2/mod_passenger.so PassengerRoot /var/lib/gems/1.8/gems/passenger-2.2.8 PassengerRuby /usr/bin/ruby1.8 ====== The following is the content of the file /etc/apache2/sites-enabled/ default <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /home/vincent/Documents/vincentApp/public <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory "/home/vincent/Documents/vincentApp/public/"> Options FollowSymLinks Indexes AllowOverride None Order allow,deny allow from all </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 </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> ======passenger status: sudo /var/lib/gems/1.8/bin/passenger-status ----------- General information ----------- max = 6 count = 0 active = 0 inactive = 0 Waiting on global queue: 0 ----------- Domains ----------- ======Apache log: [Sun Jan 17 18:35:30 2010] [error] [client ::1] (13)Permission denied: access to / denied -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Conrad Taylor
2010-Jan-18 03:12 UTC
Re: Forbidden error on rails app with Passenger and Apache
On Sun, Jan 17, 2010 at 6:42 PM, Vincent P <easebus-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I run a rails app at /home/vincent/Documents/vincentApp/ . The app > runs fine with WEBrick on localhost:3000. However, I am getting a > Forbidden error when accessing the app on Apache on port 80. I > suspect this is more of a problem with my Apache config than with > Rails or Passenger. The configs are below. Please help. Thanks. > > I have Passenger installed. > > The following is in /etc/apache2/apache2.conf: > > # Passenger > LoadModule passenger_module /var/lib/gems/1.8/gems/passenger-2.2.8/ext/ > apache2/mod_passenger.so > PassengerRoot /var/lib/gems/1.8/gems/passenger-2.2.8 > PassengerRuby /usr/bin/ruby1.8 > > ======> > The following is the content of the file /etc/apache2/sites-enabled/ > default > > <VirtualHost *:80> > ServerAdmin webmaster@localhost > > DocumentRoot /home/vincent/Documents/vincentApp/public > <Directory /> > Options FollowSymLinks > AllowOverride None > </Directory> > <Directory "/home/vincent/Documents/vincentApp/public/"> > Options FollowSymLinks Indexes > AllowOverride None > Order allow,deny > allow from all > </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 > </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> > > ======> passenger status: > > sudo /var/lib/gems/1.8/bin/passenger-status > ----------- General information ----------- > max = 6 > count = 0 > active = 0 > inactive = 0 > Waiting on global queue: 0 > > ----------- Domains ----------- > ======> Apache log: > > [Sun Jan 17 18:35:30 2010] [error] [client ::1] (13)Permission denied: > access to / denied > > >You can try adding the following after the second Directory block: RailsBaseURI / Next, I would verify that ''Allow from'' is correct. I have used the following without fail: Allow from all Good luck, -Conrad> > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Alpha Blue
2010-Jan-18 03:24 UTC
Re: Forbidden error on rails app with Passenger and Apache
Learn by Doing wrote:> DocumentRoot /home/vincent/Documents/vincentApp/public > <Directory /> > Options FollowSymLinks > AllowOverride None > </Directory> > <Directory "/home/vincent/Documents/vincentApp/public/"> > Options FollowSymLinks Indexes > AllowOverride None > Order allow,deny > allow from all > </Directory>On the second Directory, you should have: <Directory /home/vincent/Documents/vincentApp/public//> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> You have quotes surrounding your directory which you can remove. You should also add Indexes and MultiViews here as well. Just copy and paste what I placed in there.> CustomLog /var/log/apache2/access.log combined >After this line place: CustomLog /var/log/apache2/access.log combined ServerSignature On Besides not having any expiresheaders etc. placed in, everything else is fine. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Alpha Blue
2010-Jan-18 03:25 UTC
Re: Forbidden error on rails app with Passenger and Apache
Correcting one syntax error: <Directory /home/vincent/Documents/vincentApp/public/> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> No second forward slash - apologies. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Vincent P
2010-Jan-18 19:14 UTC
Re: Forbidden error on rails app with Passenger and Apache
Condrad and Alpha, Thank you for your help. I am still getting the error. Below is the edited section of /etc/apache2/sites-enabled/ default : <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /home/vincent/Documents/vincentApp/public <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /home/vincent/Documents/vincentApp/public/> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny Allow from all </Directory> RailsBaseURI / ... CustomLog /var/log/apache2/access.log combined ServerSignature On ... </VirtualHost> Thanks. On Jan 17, 7:25 pm, Alpha Blue <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Correcting one syntax error: > > <Directory /home/vincent/Documents/vincentApp/public/> > Options Indexes FollowSymLinks MultiViews > AllowOverride None > Order allow,deny > allow from all > </Directory> > > No second forward slash - apologies. > > -- > Posted viahttp://www.ruby-forum.com/.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Ease Bus
2010-Jan-18 19:28 UTC
Re: Re: Forbidden error on rails app with Passenger and Apache
BTW, if it is relevant at all, every time I modify the config files, I restart apache. I am running Apache 2.2.12 on Ubuntu 9.10. Thanks. On Mon, Jan 18, 2010 at 11:14 AM, Vincent P <easebus-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Condrad and Alpha, Thank you for your help. I am still getting the > error. Below is the edited section of /etc/apache2/sites-enabled/ > default : > > <VirtualHost *:80> > ServerAdmin webmaster@localhost > > DocumentRoot /home/vincent/Documents/vincentApp/public > <Directory /> > Options FollowSymLinks > AllowOverride None > </Directory> > <Directory /home/vincent/Documents/vincentApp/public/> > Options Indexes FollowSymLinks MultiViews > AllowOverride None > Order allow,deny > Allow from all > </Directory> > > RailsBaseURI / > > ... > > CustomLog /var/log/apache2/access.log combined > ServerSignature On > > ... > > </VirtualHost> > > Thanks. > > On Jan 17, 7:25 pm, Alpha Blue <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: > > Correcting one syntax error: > > > > <Directory /home/vincent/Documents/vincentApp/public/> > > Options Indexes FollowSymLinks MultiViews > > AllowOverride None > > Order allow,deny > > allow from all > > </Directory> > > > > No second forward slash - apologies. > > > > -- > > Posted viahttp://www.ruby-forum.com/. > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Vincent P
2010-Jan-18 19:32 UTC
Re: Forbidden error on rails app with Passenger and Apache
BTW, if it is relevant at all, every time I modified the config files, I did restart apache. But that did not help. I am running Apache 2.2.12 on Ubuntu 9.10. Thanks. On Jan 18, 11:14 am, Vincent P <ease...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Condrad and Alpha, Thank you for your help. I am still getting the > error. Below is the edited section of /etc/apache2/sites-enabled/ > default : > > <VirtualHost *:80> > ServerAdmin webmaster@localhost > > DocumentRoot /home/vincent/Documents/vincentApp/public > <Directory /> > Options FollowSymLinks > AllowOverride None > </Directory> > <Directory /home/vincent/Documents/vincentApp/public/> > Options Indexes FollowSymLinks MultiViews > AllowOverride None > Order allow,deny > Allow from all > </Directory> > > RailsBaseURI / > > ... > > CustomLog /var/log/apache2/access.log combined > ServerSignature On > > ... > > </VirtualHost> > > Thanks. > > On Jan 17, 7:25 pm, Alpha Blue <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: > > > Correcting one syntax error: > > > <Directory /home/vincent/Documents/vincentApp/public/> > > Options Indexes FollowSymLinks MultiViews > > AllowOverride None > > Order allow,deny > > allow from all > > </Directory> > > > No second forward slash - apologies. > > > -- > > Posted viahttp://www.ruby-forum.com/. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Easebus
2010-Jan-19 07:57 UTC
RE: Re: Forbidden error on rails app with Passenger and Apache
Hi all, It starts working for some reason after I use "git clone local" instead of "scp" to create the vincentApp directory. However, the directory git creates only gives write permission to root (must be a consequence of gitosis). I had to chmod a+w to the log and tmp folder before the app shows through Apache. Is there a better way than to chmod every time I deploy to production? Thanks. -----Original Message----- From: rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org [mailto:rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org] On Behalf Of Vincent P Sent: Monday, January 18, 2010 11:33 AM To: Ruby on Rails: Talk Subject: [Rails] Re: Forbidden error on rails app with Passenger and Apache BTW, if it is relevant at all, every time I modified the config files, I did restart apache. But that did not help. I am running Apache 2.2.12 on Ubuntu 9.10. Thanks. On Jan 18, 11:14 am, Vincent P <ease...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Condrad and Alpha, Thank you for your help. I am still getting the > error. Below is the edited section of /etc/apache2/sites-enabled/ > default : > > <VirtualHost *:80> > ServerAdmin webmaster@localhost > > DocumentRoot /home/vincent/Documents/vincentApp/public > <Directory /> > Options FollowSymLinks > AllowOverride None > </Directory> > <Directory /home/vincent/Documents/vincentApp/public/> > Options Indexes FollowSymLinks MultiViews > AllowOverride None > Order allow,deny > Allow from all > </Directory> > > RailsBaseURI / > > ... > > CustomLog /var/log/apache2/access.log combined > ServerSignature On > > ... > > </VirtualHost> > > Thanks. > > On Jan 17, 7:25 pm, Alpha Blue <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: > > > Correcting one syntax error: > > > <Directory /home/vincent/Documents/vincentApp/public/> > > Options Indexes FollowSymLinks MultiViews > > AllowOverride None > > Order allow,deny > > allow from all > > </Directory> > > > No second forward slash - apologies. > > > -- > > Posted viahttp://www.ruby-forum.com/. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Colin Law
2010-Jan-19 09:33 UTC
Re: Re: Forbidden error on rails app with Passenger and Apache
2010/1/19 Easebus <easebus-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:> Hi all, > > It starts working for some reason after I use "git clone local" instead of > "scp" to create the vincentApp directory. However, the directory git > creates only gives write permission to root (must be a consequence of > gitosis). I had to chmod a+w to the log and tmp folder before the app shows > through Apache. Is there a better way than to chmod every time I deploy to > production?On another thread you said that you used sudo when doing the clone, if so then that is why the permissions are root. You should not need to use sudo, just git clone path/to/file.git provided you have access to the git file and permission to create the folder at the destination. Colin> > Thanks. > > -----Original Message----- > From: rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > [mailto:rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org] On Behalf Of Vincent P > Sent: Monday, January 18, 2010 11:33 AM > To: Ruby on Rails: Talk > Subject: [Rails] Re: Forbidden error on rails app with Passenger and Apache > > BTW, if it is relevant at all, every time I modified the config files, I did > restart apache. But that did not help. I am running Apache > 2.2.12 on Ubuntu 9.10. Thanks. > > On Jan 18, 11:14 am, Vincent P <ease...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> Condrad and Alpha, Thank you for your help. I am still getting the >> error. Below is the edited section of /etc/apache2/sites-enabled/ >> default : >> >> <VirtualHost *:80> >> ServerAdmin webmaster@localhost >> >> DocumentRoot /home/vincent/Documents/vincentApp/public >> <Directory /> >> Options FollowSymLinks >> AllowOverride None >> </Directory> >> <Directory /home/vincent/Documents/vincentApp/public/> >> Options Indexes FollowSymLinks MultiViews >> AllowOverride None >> Order allow,deny >> Allow from all >> </Directory> >> >> RailsBaseURI / >> >> ... >> >> CustomLog /var/log/apache2/access.log combined >> ServerSignature On >> >> ... >> >> </VirtualHost> >> >> Thanks. >> >> On Jan 17, 7:25 pm, Alpha Blue <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: >> >> > Correcting one syntax error: >> >> > <Directory /home/vincent/Documents/vincentApp/public/> >> > Options Indexes FollowSymLinks MultiViews >> > AllowOverride None >> > Order allow,deny >> > allow from all >> > </Directory> >> >> > No second forward slash - apologies. >> >> > -- >> > Posted viahttp://www.ruby-forum.com/. >> >> > > > -- > You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. > > > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.