Reputation: 21144
I wanted to deploy my app into my local server using apache and passenger. I installed all the pre-requisites like development libraries and passenger gem. Then I included these lines into my /etc/apache2/httpd.conf file;
PassengerRoot /home/insane-36/.rvm/gems/ruby-1.9.3-p125/gems/passenger-3.0.11
PassengerRuby /home/insane-36/.rvm/wrappers/ruby-1.9.3-p125/ruby
Now, I created a file inside /etc/apache2/sites-available with name sampleapp and put the following contents into it;
<VirtualHost *:80>
ServerName sampleapp
RailsEnv development
DocumentRoot /home/insane-36/Documents/Web/Rails/sampleapp/public
<Directory /home/insane-36/Documents/Web/Rails/sampleapp/public>
AllowOverride all
Options MultiViews
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
I enabled the site and then added the hosts name into /etc/hosts file. But, when I try to browse the site now with its ServerName, it gives permission denied error as;
Forbidden
You don't have permission to access / on this server.
Apache/2.2.20 (Ubuntu) Server at sampleapp Port 80
I dont know what is wrong here. I have tried to do it multiple times editing the same files, disabling site, enabling the site, reloading apache. Please kindly suggest me the problem and the solution behind this thing. Thank you for your help in advance.
Upvotes: 4
Views: 3926
Reputation: 3671
I know that is an old question, still is top result for google search for that error.
Solution is to add Require all granted as last line inside
<Directory /home/insane-36/Documents/Web/Rails/sampleapp/public>
AllowOverride all
Options MultiViews
Order allow,deny
Allow from all
Require all granted
</Directory>
Upvotes: 1
Reputation: 26
This is a matter of permissions in the directory, and not the deamon itself; do you have an index file in DocumentRoot /home/insane-36/Documents/Web/Rails/sampleapp/public? Who owns it? What is Apache running as?
Upvotes: 1