Project

General

Profile

Accessing Redmine Shows Listing of Public folder

Added by Scott Selvia over 12 years ago

I have read many links involving installation of redmine with RVM, Passenger, Apache, and using sub uri and no sub uri. It does not matter what I do redmine when accessed will only show the listing of the public folder. Does someone have a HOW TO to get redmine working with RVM, Passenger, and Apache using a sub uri on CentOS 5 or 6?

Passenger Conf sections:

LoadModule passenger_module /usr/local/rvm/gems/ruby-1.8.7-p358@global187/gems/passenger-3.0.11/ext/apache2/mod_passenger.so
PassengerRoot /usr/local/rvm/gems/ruby-1.8.7-p358@global187/gems/passenger-3.0.11
PassengerRuby /usr/local/rvm/wrappers/ruby-1.8.7-p358@global187/ruby

<VirtualHost *:80>
ServerName devcodesrv
DocumentRoot /var/www/html
ErrorLog /var/www/html/logs/error.log
CustomLog /var/www/html/logs/access.log common

&lt;Directory /var/www/html&gt;
Allow from all
&lt;/Directory&gt;
RailsBaseURI /redmine
RailsEnv production
&lt;Directory /var/www/html/redmine&gt;
Options -MultiViews
&lt;/Directory&gt;
&lt;/VirtualHost&gt;

My .rvmrc file:

#!/usr/bin/env bash

  1. This is an RVM Project .rvmrc file, used to automatically load the ruby
  2. development environment upon cd'ing into the directory
  1. First we specify our desired <ruby>[@<gemset>], the @gemset name is optional,
  2. Only full ruby name is supported here, for short names use:
  3. echo "rvm use 1.8.7" > .rvmrc
    environment_id="ruby-1.8.7-p358@global187"
  1. Uncomment the following lines if you want to verify rvm version per project
  2. rvmrc_rvm_version="1.10.3" # 1.10.1 seams as a safe start
  3. eval "$(echo ${rvm_version}.${rvmrc_rvm_version} | awk -F. '{print " "$1*65536+$2*256+$3" -ge "$4*65536+$5*256+$6" "}' )" || {
  4. echo "This .rvmrc file requires at least RVM ${rvmrc_rvm_version}, aborting loading."
  5. return 1
  6. }
  1. First we attempt to load the desired environment directly from the environment
  2. file. This is very fast and efficient compared to running through the entire
  3. CLI and selector. If you want feedback on which environment was used then
  4. insert the word 'use' after --create as this triggers verbose mode.
    if [[ d "${rvm_path:$HOME/.rvm}/environments"
    && s "${rvm_path:$HOME/.rvm}/environments/$environment_id" ]]
    then
    \. "${rvm_path:-$HOME/.rvm}/environments/$environment_id"
    [[ s "${rvm_path:$HOME/.rvm}/hooks/after_use" ]] &&
    \. "${rvm_path:-$HOME/.rvm}/hooks/after_use" || true
    else # If the environment file has not yet been created, use the RVM CLI to select.
    rvm --create "$environment_id" || {
    echo "Failed to create RVM environment '${environment_id}'."
    return 1
    }
    fi
  1. If you use bundler, this might be useful to you:
    if -s Gemfile && {
    ! builtin command -v bundle >/dev/null ||
    builtin command -v bundle | grep $rvm_path/bin/bundle >/dev/null
    }
    then
    printf "%b" "The rubygem 'bundler' is not installed. Installing it now.\n"
    gem install bundler
    fi
    if -s Gemfile && builtin command -v bundle >/dev/null
    then
    bundle install | grep -vE '^Using|Your bundle is complete'
    fi

Finally in my environment.rb I place the following line for the suburi

Redmine::Utils::relative_url_root = "/redmine"


Replies (3)

RE: Accessing Redmine Shows Listing of Public folder - Added by Jona Steen over 12 years ago

I have encountered the same problem installing Redmine on Debian Squeeze using Apache and mod_passenger. Accessing the redmine site through the webrick server works fine, but Apache integration does not. I too get a listing of the public folder where I would expect the application to start. According to ps phusion_passenger/ApplicationPoolServerExecutable is running and Apache logs do not display messages related to passenger. It seems like passenger, for some reason, does not handle the location but passes it back to Apache who does a directory listing.

Did you succeed in resolving your issue? Trying to narrow down on the problem, I will look for a minimal passenger sample project and try to get that running.

Here are the Rails versions using 'RAILS_ENV=production script/about'

About your application's environment
Ruby version 1.8.7 (x86_64-linux)
RubyGems version 1.3.7
Rack version 1.1
Rails version 2.3.5
Active Record version 2.3.5
Active Resource version 2.3.5
Action Mailer version 2.3.5
Active Support version 2.3.5
Edge Rails revision unknown
Application root /usr/share/redmine
Environment production
Database adapter mysql
Database schema version 20100819172912

RE: Accessing Redmine Shows Listing of Public folder - Added by Alan Chandler over 12 years ago

Scott Selvia wrote:

<VirtualHost *:80>
ServerName devcodesrv
...
<Directory /var/www/html>
Allow from all
</Directory>

RailsBaseURI /redmine
RailsEnv production
<Directory /var/www/html/redmine>
Options -MultiViews
</Directory>
</VirtualHost>

This doesn't follow the same instructions I followed, which says you need to symlink the redmine/public folder into the the path from document root

I have another problem, which is that passenger is stealing my document root, but the basic redmine is working.

So I have the equivalent of

/var/www/html/ my document root web site

/var/www/redmine (or any offweb directory) as my redmine setup with /var/www/redmine/public in here

Then I symlink ln -s /var/www/redmine/public /var/www/html/redmine

I have RailsBaseURI set to /redmine
I have PassengerAppRoot set to /var/www/redmine

RE: Accessing Redmine Shows Listing of Public folder - Added by Scott Selvia over 12 years ago

Yes I finally resolved my issue. I had to disable SELINUX, that solved the problem.

    (1-3/3)