I'm tryig to run ruby on rails and redmine on xampp. My operating system is windows 7.
I followed this tutorial: http://nlb-creations.com/2013/06/26/installing-ruby-on-rails-and-redmine-with-xampp-on-windows-7/
When I try to access localhost:3000 I get this:
Access forbidden!
You don't have permission to access the requested directory. There is either no index document or the directory is read-protected.
This is my setup in httpd.conf:
Listen 3000
LoadModule rewrite_module modules/mod_rewrite.so
#################################
# RUBY SETUP
#################################
<VirtualHost *:3000>
ServerName rails
DocumentRoot "c:/xampp/htdocs/dev-ruby/redmine/public/"
<Directory "c:/xampp/htdocs/dev-ruby/redmine/">
Options ExecCGI FollowSymLinks
AllowOverride all
Allow from all
Order allow,deny
Require all granted
AddHandler cgi-script .cgi
AddHandler fastcgi-script .fcgi
</Directory>
</VirtualHost>
#################################
# RUBY SETUP
#################################
I tried many solutions but none of them worked. I also deleted .htaccess file but nothing changed. Any ideas please??
If your document root in C:\ disk, you should change the xampp folder (and subfolders) permissions for your user.
Related
I am deploying a ruby-on-rails application.
I have configured apache and passenger and the http server is listening on port 80.
When I try to access the home page using the browser, I simply get a list of files and directories instead of the home page.
Following are snippets from the apache config.
/etc/apache2/apache2.conf
<Directory />
#Options FollowSymLinks
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order deny,allow
Allow from all
</Directory>
/etc/apache2/httpd.conf
LoadModule passenger_module /home/user1/.rvm/gems/ruby-2.3.0/gems/passenger-5.0.27/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
PassengerRoot /home/user1/.rvm/gems/ruby-2.3.0/gems/passenger-5.0.27
PassengerDefaultRuby /home/user1/.rvm/gems/ruby-2.3.0/wrappers/ruby
</IfModule>
/etc/apache2/sites-available/ubuntuvm-4.conf
<VirtualHost *:80>
ServerAdmin admin#ubuntuvm-4.com
ServerName ubuntuvm-4
ServerAlias www.ubuntuvm-4.com
DocumentRoot /home/user1/www/myapp/public
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
What is going wrong?
Could it be that I am trying to access the page via the ip address
http://192.168.0.12?
If you want me to put any other config, please shout.
try to copy the content of the file /etc/apache2/sites-available/ubuntuvm-4.conf
to /etc/apache2/sites-enabled/ubuntuvm-4.conf
cp /etc/apache2/sites-available/ubuntuvm-4.conf /etc/apache2/sites-enabled/ubuntuvm-4.conf
You need to create your config like this
<VirtualHost *:80>
ServerName ubuntuvm-4
<Location /home/user1/www/myapp/public>
PassengerBaseURI /
PassengerAppRoot /home/user1/www/myapp
</Location>
DocumentRoot /home/user1/www/myapp/public
<Directory /home/user1/www/myapp/public>
AllowOverride all
RailsEnv production
# MultiViews must be turned off.
Options -MultiViews
# Uncomment this if you're on Apache >= 2.4:
Require all granted
</Directory>
</VirtualHost>
I had the same problem trying to deploy a 4.2.1 Rails app on Ubuntu 12.04 using Ruby 2.3.2 (RVM because .deb packaged version is damn too old !!) Apache 2.2 and Passenger 5.0.4 (.deb).
Well, after wasting days to try to figure out why passenger wouldn't start (I did this a thousand times, it always worked), I realized it was only because Passenger couldn't print its logs anywhere. So, if you already tried everything you read on forums, just try to add a path to a log file in your apache configuration :
PassengerLogFile /var/log/passenger.log
and it worked like magic. Hope this helps.
I've been struggling with this for hours. It's the first time that I try to establish a server.
I have rails, passenger and apache installed.
In the httpd.conf here is what I wrote:
ServerRoot "/etc/httpd"
# Here I wrote the IP address, since I still did not manage the DNS
Listen ##.##.##.94:80
ServerAdmin root#localhost
ServerName ##.##.##.94:80 # Do I need this?
<Directory />
AllowOverride none
Require all denied
Options Indexes FollowSymLinks Includes ExecCGI
</Directory>
<Directory "/var/www">
AllowOverride None
# Allow open access:
Require all granted
</Directory>
LoadModule passenger_module /usr/local/rvm/gems/ruby-1.9.3-p551/gems/passenger-4.0.59/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
PassengerRoot /usr/local/rvm/gems/ruby-1.9.3-p551/gems/passenger-4.0.59
PassengerDefaultRuby /usr/local/rvm/gems/ruby-1.9.3-p551/wrappers/ruby
</IfModule>
<VirtualHost *:80>
ServerName ##.##.##.##
# !!! Be sure to point DocumentRoot to 'public'!
DocumentRoot /var/www/blah_blah/public_html/public
<Directory /var/www/blah_blah/public_html>
# This relaxes Apache security settings.
AllowOverride all
# MultiViews must be turned off.
Options -MultiViews
# Uncomment this if you're on Apache >= 2.4:
Require all granted
</Directory>
</VirtualHost>
The last section was produced by passenger (I did not! copy it from the instructions :-) ).
When I go to the IP address I get an error that the page was not found.
I have rails running with "rails s". Before that I reloaded the server and restarted it for the config file to take effect.
Also, I granted apache user permission to the www folder.
What is the problem?
I even tried to put an index.html file in the public folder of rail and tried to go there, but failed.
BTW - when I do it from the console:
wget http://0.0.0.0:3000
I get a 200 response which means that it is OK.
Where is the fault?
I think you should change the port:
<VirtualHost *:3000>
Because when you run rails s it run on port 3000.
I am using the Google Cloud Engine ruby stack, which uses RVM and Passenger on Debian 7. After following the Passenger configuration manual, I am only seeing a directory of the app's files when I navigate to the server root.
Here's the /etc/apache2/apache2.conf
<VirtualHost *:80>
ServerName http://130.211.149.208
DocumentRoot /var/www/myapp
<Directory /var/www/myapp>
Allow from all
Options -MultiViews
# Uncomment this if you're on Apache >= 2.4:
#Require all granted
</Directory>
</VirtualHost>
Figured it out. The problem was /var/www/myapp should be /var/www/myapp/public
I am trying to allow sub urls on my apache/rails/phusion passenger install so that I can have php files at the top level and then rails apps in sub directories like blog for example:
I've followed the documentation here: http://www.modrails.com/documentation/Users%20guide%20Apache.html#deploying_rails_to_sub_uri
here is my httpd.conf virtual host entry:
<VirtualHost *:80>
ServerName xx.xx.xx.xx
DocumentRoot /var/www/html
<Directory /var/www/html>
Allow from all
</Directory>
RailsBaseURI /blog
<Directory /var/www/html/blog>
Options -MultiViews
</Directory>
</VirtualHost>
the apache user owns /var/www/html and here is my shortcut link:
http://d.pr/i/aLkP made with the ln command
and here is the error: http://d.pr/i/M3r4
The apache group must also be able to read and execute the the config and public folders and all parent folders. Try changing the permissions and restarting apache.
Your symlink should have the same name as the suburl, so your symlink should be named "blog". It looks like it's named "public" right now. You may want to place your symlinks in a separate folder in your www directory.
I had the same problem when trying to install Redmine. To solve this problem I had to change the /etc/apache2/sites-available/default and specify the PassengerAppRoot:
<Directory /var/www/redmine>
RailsBaseURI /redmine
PassengerAppRoot /var/lib/redmine
PassengerResolveSymlinksInDocumentRoot on
</Directory>
I also modified the /etc/apache2/mods-available/passenger.conf and specified the PassengerDefaultUser.
<IfModule mod_passenger.c>
PassengerRoot /usr
PassengerRuby /usr/bin/ruby
PassengerDefaultUser www-data
</IfModule>
I am trying to deploy my first rails app onto an Ubuntu/Apache/Passenger server, deployed with Capistrano. I have setup a virtual host to point to a directory where all my rails apps will live:
Here is my virtual host file:
<VirtualHost *:80>
ServerName rails.mydomain.com
ServerAlias rails.mydomain.com
DocumentRoot /var/www/vhosts/rails.mydomain.com
<Directory /var/www/vhosts/rails.mydomain.com>
Allow from all
AllowOverride all
Options -MultiViews -Indexes
</Directory>
# PassengerAppRoot /var/www/vhosts/rails.mydomain.com
RailsBaseURI /myappname
# RailsBaseURI /myappname2
# RailsBaseURI /myappname3
Include /etc/apache2/production-expires.conf
CustomLog /var/log/apache2/rails.mydomain.com-access_log common
ErrorLog /var/log/apache2/rails.mydomain.com-error_log
</VirtualHost>
Upon loading the rails app (rails.mydomain.com/myappname) i get:
Error message:
No such file or directory - config/environment.rb
Exception class:
Errno::ENOENT
Application root:
/var/www/vhosts/rails.mydomain.com
The config/environment.rb is there, I verified it's existence through SSH after running cap deploy.
So what am I missing, i feel like something is not pointing properly, you can see the Application root is pointing to my /rails.mydomain.com folder, not the actual /rails.mydomain.com/myappname folder.
Did you symlink myappname to the public directory of your app?
ln -s /path/to/the/myappname/public/ /var/www/vhosts/rails.mydomain.com/myappname
According to the Passenger docs (see "3.1. Deploying to a virtual host's root"), you need to set your DocumentRoot to your app's public directory. Try this:
DocumentRoot /var/www/vhosts/rails.mydomain.com/public
<Directory /var/www/vhosts/rails.mydomain.com/public>
Allow from all
Options +MultiViews
</Directory>