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