0

I followed this link https://www.digitalocean.com/community/tutorials/how-to-deploy-a-rails-app-with-passenger-and-apache-on-ubuntu-14-04 to install ruby on rails with passenger on ubuntu 14.04 and I got the following error :

'AH00112 Warning: DocumentRoot [/home/rails/testapp/public] does not exist' when it does exist.

When I try and type the URL or IP address into a browser it says I don't have permission to access the server but i followed the steps verbatim on the site. Can anyone please advise me here. ASAP if you can !

1
  • I changed the directory to /root/testapp/public and the error is gone but when i try open the ip or url it says i dont have access to / on the server. I went into permissions for the passenger list file and made sure it was set to root and that Required all granted was in the testapp.conf file for the directory options and it still doesnt stop the error. can some please please help me out on this. Mar 23, 2016 at 1:18

1 Answer 1

0

I noticed that lots of people were commenting on that article with the same problem. What I can see right off the bat is that the directory he created was "rails" inside the user's home directory, which is the first location you tried before moving it to /root/testapp/public

The default permissions keep home directories, including root's, private. This means that although you allow access in the Apache configuration file with the directive Require All Granted, all that does is tell Apache it's ok to serve up the files. But without the right permissions settings on the folders themselves, Apache won't be able to read the directory in order to serve it.

Apache needs both read and execute permissions on the directory, and execute permissions on all directories from there up to root. So, I would move the app back to its original location /home/rails/testapp/public, then run these commands to ensure the permissions are correct:

sudo chmod +x /
sudo chmod +x /home
sudo chmod +x /home/rails
sudo chmod +x /home/rails/testapp
sudo chmod -R +xr /home/rails/testapp/public
6
  • it says i have to create a droplet on digital ocean but our lecturer gave us a registered domain name and we assign it an ip address on the virtual machine with unbuntu 14.04. Do you think that would affect this also? i moved /testapp into rails and then when i opened rails i couldnt find it so I may have to re-do the tutorial. Mar 23, 2016 at 20:03
  • So you have your own virtual machine, not one on digital ocean? Did you start on step 3 of that tutorial? Mar 23, 2016 at 20:27
  • yep i went straight to step 3 and im using a virtual machine with ubuntu Mar 23, 2016 at 22:15
  • Can you post the virtual host configuration file on pastebin, and share the link? cat /etc/apache2/sites-available/testapp.conf Mar 24, 2016 at 0:33
  • i went on to another service i need to install, an ssh server. i have issues with that too. so let me re-do the tutorial and i'll paste u the error asap Mar 24, 2016 at 1:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .