Error 403 after rails capistrano deployment on apache - ruby-on-rails-3

Deployed an app to a VPS running apache + passenger.
User:Group → rails:rails
Deployed to /home/rails/www/appname
Here are the permissions on the files: https://gist.github.com/2549332
Here are user groups: https://gist.github.com/2549336
But I continue getting a 403 error when trying to request the app.
The access log just sais Permission denied for /, nothing else.
What could be the problem and how to solve it.
OS running Fedora 14.
UPDATE 1
Here is the virtualhost config:
https://gist.github.com/2550383
UPDATE 2
added Passenger_enabled to vhost
Passenger options in the httpd.conf are as follows
#Passenger for RubyOnRails apps
LoadModule passenger_module /home/rails/.rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.12/ext/apache2/mod_passenger.so
PassengerRoot /home/rails/.rvm/gems/ruby-1.9.3-p194/gems/passenger-3.0.12
PassengerRuby /home/rails/.rvm/wrappers/ruby-1.9.3-p194/ruby
Passenger processes, listed by ps:
root 32342 0.0 0.6 213928 1948 ? Ssl 13:38 0:00 PassengerWatchdog
root 32345 0.0 0.7 288308 2208 ? Sl 13:38 0:00 PassengerHelperAgent
root 32347 0.0 2.9 112704 8520 ? Sl 13:38 0:00 Passenger spawn server
nobody 32350 0.0 1.3 147996 3788 ? Sl 13:38 0:00 PassengerLoggingAgent
UPDATE 3
Tried putting the standard Rails index.html in the public folder. No reaction.
Tried putting a plain index.html with just head and title, no changes either.
UPDATE 4
Even tried commenting out the Passenger lines in httpd.conf and restarting the server, and still I get the same error. Looks like it is something in Apache configs, but Ican't find what.
*UPDATE 5
Renamed the vhost.conf to see how the server acts withought it, everything seems ok.

It may be that Passenger doesn't hook up to your site and Apache decides to list the public directory instead, and directory listing is disabled in Apache.
Are there Passenger processes visible in ps?
Do you have PassengerRoot set correctly?
Try adding PassengerEnabled on to the vhost config.

The problem was solved by changing permissions for /home/rails directory so group could read and execute it.
Thanks to everybody!

Related

pi raspbian buster apache2 www-data forbidden on different directory 2021

I have searched for recent posts on this, and older ones do not fix the issue.
I have Rasbian Buster (2021) on a pi4. Apache2.
The default /var/www/html works
trying to move it to a hdd /media/pi/Data/www/html fails
I have given it www-data user and group permissions for all folders.
I have checked that it has this in GUI and console.
Looking at the permissions on /var/www/html they are ROOT when apache2 is installed and this site works. BUT all documents say it should be www-data. Ihave not tried changing it as it will probably break it and is my reference.
I have checked that apache2 envars APACHE_RUN_USER = www-data and APACHE_RUN_GROUP=www-data
So why does it install /var/www/html as ROOT but all documents (rightly) say www-data should have permissions then it still not work?
For example I followed https://pimylifeup.com/raspberry-pi-apache/ and logged ou etc and it still fails ith Forbidden :Yu dn'thave permission to access this resource.
There seem to be varying ways to fix it, but not so only www-data has access, and I shouldn't need ROOT to have it as its very bad practice...so why does the default site have it?!
Wht is the correct fix to use adifferent directory for the website (eventualy it will be webdav but one simple step at a time!)
Thank you

Permission denied error when creating cache folder - Apache httpd

I am using Apache HTTPD with the Dispatcher module running on RHEL.
The dispatcher works fine but it's unable to cache the file. On inspecting the logs I see the following error -
Unable to create parent directory /var/www/html/bla/bla/static: Permission denied
My apache is running with the default user and usergroup - apache
I have also changed the ownership of my docroot (/var/www/html) to apache.
drwxrwxrwx. 20 apache apache 278 Jun 14 04:08 var
Does anyone know what the problem is? Please help!

Forbidden You don't have permission to access / on this server

I'm trying to set up a webserver on my VPS (Running Debian 7). I have installed apache and configured it. However, when I try to connect to my IP I am faced with a 403 forbidden error saying that I don't have access to / on the server. I have attempted to set it up so that when connecting the webserver should direct to the directory: /home/webmaster/website. My main apache.conf file is as follows: http://pastebin.com/zgyik39y
and my site config, called "web.conf" is: http://pastebin.com/jpRJAaCw I don't know what to do, I've tried many suggestions on here and in other places and none so far have worked.
Line 18 of web.conf should be:
Allow from all
For apache 2.2 or:
Require all granted
For apache 2.4

Set up RefineryCMS with Passenger

I'm trying to get a RefineryCMS install running on my CentOS VPS (which has DirectAdmin installed, which I don't think makes any difference for my problem) but somehow I cannot get it to host.
In my httpd.conf I've added the following:
RailsEnv development
PassengerHighPerformance on
|?DOCROOT=/home/user/domains/domain.name/public_html/rails/refinery_test_install/|
The paths are all correct and my normal Rails 3 applications work perfectly when I put these lines in my httpd.conf yet now it will just load the index.html file I've put in the directory pure for testing.
Any ideas on how I could get this up and running?
I was totally missing I didn't forwarded passenger to Rails' public folder. The configuration works with the following docroot:
|?DOCROOT=/home/user/domains/domain.name/public_html/rails/refinery_test_install/public/|

Apache, FastCGI - Error 503

It was pointed out to me that my server is insecure, because anyone could read any file through PHP, even if it was out of his DocumentRoot.
I decided to reconfigure whole apache and all configuration files for virtual hosts and installed Mod FastCGI and I managed to get it running quite nicely, I don't have problems with rights anymore.
But there seems to be another problem. When I try to load more than 3 sites (on different VirtualHosts => different users on different threads) page loads for a while and than crashes on "Error 503: Service Temporarily Unavailable".
I tried increasing PHP_FCGI_CHILDREN var from my default setting for all VirtualHosts which is 0 to higher numbers, but without luck. I also tried to set KeepAlive var in my apache2.conf to Off as I read in some tutorial, but it seems like nothing helps.
Does anyone know how to resolve this issue? [My Apache error.log and suexec.log is empty.]
Found the answer to my own question. There are few more settings I overlooked.
FcgidMaxProcesses 15
FcgidFixPathinfo 1
FcgidProcessLifeTime 0
FcgidTimeScore 3
FcgidZombieScanInterval 10
FcgidMaxRequestsPerProcess 0
FcgidMaxRequestLen 33554432
FcgidIOTimeout 60
Those are my settings in apache.conf and everythings works as expected.