2

I'm new to apache2 and passenger to set-up rails apps and followed a tutorial on how to get redmine (rails app) set up (http://xdissent.com/2010/05/04/github-clone-with-redmine/).

It all works great but to access the app you need to go to the /redmine directory. I have set it up as redmine.local/redmine. It would be great if I could be just redmine.local.

I had a look through the files I set up as part of the apache/mongrel/passenger piece and took out references to the directory but alas its never that easy.

I would appreciate any assistance, or links to more information for beginners that I can learn from.

Thanks for your help! Adam


--- Updated ---

Some additional details, I have the following files which i made edits too as part of the set-up of the server:

/etc/apache2/conf.d/redmine

 Include /opt/redmine/apps/redmine/conf/redmine.conf

/opt/redmine/apps/redmine/conf/redmine.conf

 ProxyPass /redmine balancer://redminecluster
 ProxyPassReverse /redmine balancer://redminecluster

 <Proxy balancer://redminecluster>
   BalancerMember http://127.0.0.1:3001/redmine
   BalancerMember http://127.0.0.1:3002/redmine
   Order deny,allow
   Allow from all
 </Proxy>

/opt/redmine/apps/redmine/config/mongrel_cluster.yml

 --- 
 prefix: /redmine
 log_file: log/mongrel.log
 port: "3001"
 environment: production
 pid_file: tmp/pids/mongrel.pid
 servers: 2

/etc/apache2/sites-available/default

 <VirtualHost *:80>
    ServerAdmin webmaster@localhost

 <Directory /var/www/>
    Options FollowSymLinks
    AllowOverride None
 </Directory>
 <Directory /var/www/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    Order allow,deny
    allow from all
 </Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
 <Directory /var/www/usr/lib/cgi-bin>
    AllowOverride None
    Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
    Order allow,deny
    Allow from all
 </Directory>

ErrorLog /var/log/apache2/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog /var/log/apache2/access.log combined

Alias /doc/ "/usr/share/doc/"
 <Directory /var/www/usr/share/doc/>
    Options Indexes MultiViews FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
    Allow from 127.0.0.0/255.0.0.0 ::1/128
 </Directory>
 DocumentRoot /var/www

 </VirtualHost>

I can't find a file that references the current directory /redmine as a route so not sure the server finds it in the first place - unless its that conf.d thing.

Adam
  • 145
  • 6

1 Answers1

2

UPDATE

  1. Edit the redmine.conf file to the belows content:

    <VirtualHost *:80>
        ServerName redmine.local
        ErrorLog logs/redmine_error_log
    
        RewriteEngine On
        RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
        RewriteRule ^/(.*)$ balancer://redminecluster%{REQUEST_URI} [P,QSA,L] 
    
        <Proxy balancer://redminecluster>
            BalancerMember http://127.0.0.1:3001
            BalancerMember http://127.0.0.1:3002
        </Proxy>
    </VirtualHost>
    
  2. Remove the prefix option from mongrel_cluster.yml.

  3. Restart Apache and try again.

quanta
  • 50,327
  • 19
  • 152
  • 213
  • I tried putting just this in my virtual host file but apache woudn't start. I tried adding it via webmin and it links to the directory but just displays the directory content - it doesn't recognize it as an app. – Adam Oct 31 '11 at 22:50
  • okay, i updated the redmine.conf, and the mongrel_cluster file. I wasn't sure what you wanted me to do with your original suggestion of the virtual host, so I tried adding that to the end of the default file in the available sites directory. That didn't work, so I tried deleting everything in that file and just having what you had above, that didn't work, then I tried integrating the two - which failed. I update the dir in the virtual host you game me above as my rails app is in /opt/redmine/apps/redmine/public but that didn't seem to help. – Adam Nov 01 '11 at 04:17
  • updated my answer. – quanta Nov 01 '11 at 04:34
  • I get the following error when trying to restart apache: Syntax error on line 5 of /opt/redmine/apps/redmine/conf/redmine.conf: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration – Adam Nov 01 '11 at 15:06
  • It means that you haven't loaded the `mod_rewrite` module. – quanta Nov 01 '11 at 15:26
  • I've started the mod_rewrite module, and when i changed the redmine.conf back to the original the server starts, but using the one you outlined above the server cannot start, just says fail. Thanks. – Adam Nov 01 '11 at 16:11
  • Take a look at the error log. – quanta Nov 01 '11 at 16:13
  • OK - looks like the error was log related- it couldn't find it. So I created a blank log and pointed too it. That solved the restart error. Now I'm getting a permission error i didn't have before: In the browser it says:You don't have permission to access / on this server. In the redmine_log it says: [Tue Nov 01 16:34:59 2011] [error] [client 192.168.1.12] client denied by server configuration: proxy:balancer://redminecluster/ – Adam Nov 01 '11 at 16:37
  • okay fixed it - added the Order deny,allow and Allow from all lines back in, restarted the redmine app and server and it worked. Thanks. – Adam Nov 01 '11 at 23:25