6

I'm trying to install Redmine under apache. The apache server works on a local network. My apache setup consist on a single virtual host. I can get insto different directories using simply the path corresponding:

http://ip_address/folder_of_the_project_1

How can I setup the virtualhost to make redmine works in this situation? Here is my current virtualhost setup:

NameVirtualHost *
<VirtualHost *>
    ServerAdmin webmaster@localhost

    DocumentRoot /var/www/
    RailsBaseURI /redmine
    <Directory />
            Options FollowSymLinks
            AllowOverride None
    </Directory>

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

    <Directory /var/www/redmine/public>                
            Options FollowSymLinks
            AllowOverride None
            Order allow,deny
            Allow from all
    </Directory>

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/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
    ServerSignature On

Alias /doc/ "/usr/share/doc/"
<Directory "/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>

Thank you, Ingo86

jtimberman
  • 7,511
  • 2
  • 33
  • 42
Ingo86
  • 61
  • 1
  • 1
  • 2

3 Answers3

4

Point DocumentRoot at your Redmine public directory, and RailsBaseURI to point at /.

Here's an example from my working Ubuntu server:

<VirtualHost *:80>
  ServerName redmine.int.example.com
  ServerAlias redmine
  DocumentRoot /var/www/redmine/public

  RailsBaseURI /
  RailsEnv production

  PassengerMaxPoolSize 4

  <Directory /var/www/redmine/public>
    Options FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
  </Directory>

  LogLevel info
  ErrorLog /var/log/apache2/redmine-error.log
  CustomLog /var/log/apache2/redmine-access.log combined
</VirtualHost>
jtimberman
  • 7,511
  • 2
  • 33
  • 42
  • I have other directory here: http://ip_addr/redmine http://ip_addr/docs With your suggestion how can I access my docs directory? – Ingo86 Jul 28 '09 at 10:09
  • http://redmine.int.example.com/projects/myproject/documents accesses the documents directory of the 'myproject' project. – jtimberman Jul 28 '09 at 10:11
  • How can i access my other directories with your setup? for example http :// lan_ip_add/ other_dir – Ingo86 Jul 28 '09 at 10:27
  • Is 'other_dir' another web application? You'd need to set up virtualhosts for them, or specify them with directives. – jtimberman Jul 28 '09 at 19:15
  • Yes, it's another application. How can i set up different virtualhost on a server inside a LAN? I can't use subdomains! – Ingo86 Jul 29 '09 at 17:35
  • Hi, I have a wiki (php mediawiki base url /wiki ), and a django app (base url /) in the same virtual host, now we'd like to add redmine at /bugs - using passenger. Is it possible to set all of that up in the same virtualhost? – Evgeny Aug 24 '10 at 20:27
  • Evgeny you should probably ask that as a new question :) – jtimberman Aug 25 '10 at 06:33
0

Someone suggested pointing the DocumentRoot to the root of redmine directory as this:

NameVirtualHost *:80
<VirtualHost *:80>
    ServerName golem.it
    DocumentRoot "/var/www/redmine/public"

    <Directory /var/www/redmine/public>
            AllowOverride all
            Options -MultiViews
    </Directory>
</VirtualHost>

the above of course works however it does neither answer the specific question asked neither does it give a general solution which doesn't require stealing the documentroot completely from other applications.

The solution I found requires to create a symlink to /var/www/redmine-2.2/public named redmines (notice it is not redmine but redmines due to a possible Passenger naming bug!), the solution is shown below (ignore the ssl part):

NameVirtualHost *:443
<VirtualHost *:443>
    ServerName golem.it
    DocumentRoot "/var/www"
    Options +Indexes
    Options +ExecCGI

    <Directory />
            Options FollowSymLinks
            AllowOverride None
    </Directory>

    PassengerAppRoot /var/www/redmine-2.2
    RailsBaseURI /redmines
    Alias /redmine /var/www/redmines
    <Directory /var/www/redmines>
            AllowOverride All
            Options -MultiViews
    </Directory>

    SSLEngine On
    SSLCertificateFile /etc/apache2/dwewe.crt
    SSLCertificateKeyFile /etc/apache2/wefew.key
    SSLCACertificateFile /etc/apache2/wefer/ca.crt
    SSLCipherSuite ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
</VirtualHost>
dendini
  • 103
  • 3
0

Did you try RailsBaseURI /redmine/public instead of RailsBaseURI /redmine? just in case.

Maxwell
  • 5,026
  • 1
  • 25
  • 31