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'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.

share|improve this question
    
what does your apache config look like? –  luckytaxi Oct 31 '11 at 15:00
    
How would i find that out? I'm using webmin for a lot of this (cheating I know) to avoid being stuck by lack of command knowledge. –  Adam Oct 31 '11 at 20:29
    
@luckytaxi - I've added the file details I could find the original question. –  Adam Oct 31 '11 at 23:06
add comment

1 Answer

up vote 2 down vote accepted

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.

share|improve this answer
    
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 1 '11 at 4:17
    
updated my answer. –  quanta Nov 1 '11 at 4: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 1 '11 at 15:06
    
It means that you haven't loaded the mod_rewrite module. –  quanta Nov 1 '11 at 15:26
show 4 more comments

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.