Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I installed Redmine on MacOSX Server 10.6.8 according to this installation description. So far everything works fine: When I start webrick the server serves the Redmine pages. The gems and redmine are installed under the user "redmine".

After that I aimed configuring apache2 with passenger as described here. As suggested by the description I also installed the passenger-pane which stores its virtual host configuration files in /private/etc/apache2/passenger_pane_vhosts. This is what I came up with after a lot of manual try and error. At least, now I can reach a passenger error page.

// redmine.vhost.conf
<VirtualHost *:80>    
  ServerName myserver
  ServerAlias localhost
  DocumentRoot "/Users/redmine/Sites/redmine"
# RackEnv production
# RackBaseURI /
  RailsEnv production
  RailsBaseURI /
# PassengerUser www-data
# PassengerGroup www-data
  <Directory "/Users/redmine/Sites/redmine">
    Order allow,deny
    Allow from all
  </Directory>
</VirtualHost>

However, the passenger module still runs into the following errors.

Error message: No such file or directory - config/environment.rb

Screenshot of the passenger error page

The /var/log/apache2/error_log of the web server stated the following.

[warn] NameVirtualHost *:80 has no VirtualHosts
[notice] Apache/2.2.21 (Unix) Phusion_Passenger/3.0.12 configured -- resuming normal operations
[ pid=21824 thr=2151905620 file=utils.rb:176 time=2012-06-01 18:22:07.126 ]: *** Exception Errno::ENOENT in PhusionPassenger::ClassicRails::ApplicationSpawner (No such file or directory - config/environment.rb) (process 21824, thread #<Thread:0x0000010086f2a8>):

I experimented with the user switch functionality of passenger as described in the documentation - as you can tell from my configuration file. Though, I was not successful.


UPDATE: (04.06.2012)

After I changed the DocumentRoot and Directory path to /Users/redmine/Sites/redmine/public as suggested by Holger the Redmine site is reachable under http://myserver. However, it is not reachable under http://myserver/redmine; the 404.html of the public/ folder is served.
I guess Redmine is reachable under http://myserver because I overwrite the DocumentRoot for the whole Apache server (?). That is not what I want, though. Without setting the DocumentRoot in redmine.vhost.conf I encounter the following error page.

Forbidden
You don't have permission to access / on this server.
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
Apache/2.2.21 (Unix) Phusion_Passenger/3.0.12 Server at myserver Port 80

Question: How must I configure the server to get the desired http://myserver/redmine url?

share|improve this question
add comment

3 Answers

According to the Passenger documentation you have to use the public directory as the document root. In your case this would be /Users/redmine/Sites/redmine/public.

That way, only truly public files are in the document root and Passenger finds the correct application root. You should never put any actual code files (or even worse: configuration files) into the document root as they are freely readable by anyone.

share|improve this answer
    
Sounds good. When I change the path the server delivers the /Users/redmine/Sites/redmine/public/404.html page. How can I retrieve Redmine instead? –  JJD Jun 4 '12 at 9:10
add comment

Only for Users, which installed Redmine with the Bitnami-Stack:

I realy wonder, why i got the same Error which described the ThreadOpener after upgrade and restart my OS. The Distribution also had installed apache and mysql, and start this one. BitNami has its own apache- & Mysql-Server inside of the Bundle.

Solution: stop Apache & mysql, and start the BitNami one with:

cd /opt/redmine-2.3.1-3
ctlscript.sh start mysql
ctlscript.sh start apache

That solve my problem!

share|improve this answer
    
Thanks for your answer but it doesn't seem to relate to the question. The OP does not mention using BitNami and his error was that a config file could not be found rather than Apache and MySQL were not running. –  Ladadadada Oct 23 '13 at 12:09
add comment

To mount as a /redmine URL, try a

RewriteBase /redmine/

in your VirtualHost

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.