0

I just finished migrating my Redmine install and after testing it with webrick all went fine and the site worked really well with http://localhost:3000

Next, i installed and configured mod_passenger, added a separate virtual host and basically just copied the configuration from the previous server. Since the app's absolute path did not change i assumed it would work right off the bat but that wasn't true and apparently passenger is not accessing the right directory. Here is what comes up in the error log for that virtual host:

Permission denied: /srv/redmine/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable

Here are the configuration files:

Virtual Host

<VirtualHost *:80>
        ServerName redmine
        DocumentRoot /srv/redmine/public
        ErrorLog /var/log/apache2/redmine_error.log
        RailsEnv production
        PassengerRoot /srv/redmine/public

        <Directory /srv/redmine/public>
                Options Indexes FollowSymLinks
                AllowOverride all
                Order allow,deny
                allow from all

                RailsBaseURI /
                PassengerResolveSymlinksInDocumentRoot on
        </Directory>
</VirtualHost>

Passenger Config File

<IfModule mod_passenger.c>
  PassengerRoot /usr
  PassengerRuby /usr/bin/ruby

  PassengerDefaultUser www-data
  # Below are some lines to tweak mod-passenger.
  # This keeps some Ruby processes running,
  # but the average response time is a lot lower
  # on low-traffic sites.
  RailsSpawnMethod smart
  PassengerPoolIdleTime 3000
  RailsAppSpawnerIdleTime 0
  PassengerMaxRequests 1000
</IfModule>

Any ideas why (according to the error) Passenger is trying to find the .htaccess in the /srv/redmine/ whereas it should have been looking in /srv/redmine/public/ ?

I should also note that the public/ directory under was chmodded 755 recursively

Thanks in advance!

Dany Khalife
  • 209
  • 3
  • 17

1 Answers1

1

It's not only checking /srv/redmine/.htaccess, it's also checking /srv/.htaccess and /.htaccess. Apache will stat those locations for every request if AllowOverride is enabled - it's just only logging that one since it exists but isn't accessible to the user Apache's running as. See here.

The fact that it's attempting to open an .htaccess file that it can't open should have no bearing on whether the application function, though. What problems is the application having other than that warning?

Shane Madden
  • 112,982
  • 12
  • 174
  • 248
  • yes indeed! I chmodded that file correctly and now i get the real passenger error: i was missing a gem required by passenger, once installed all went like a brease! thanks a lot! – Dany Khalife Aug 18 '13 at 13:52