uniq_

setup redmine on debian 7 with sqlite backend in document root, listen on a dedicated port

  1. install redmine dependencies

     apt-get install apache2-mod-passenger redmine redmine-sqlite
    
  2. add desired listening port to apache config

    apache ports are configured here on debian 7 /etc/apache2/ports.conf

     Listen 8083
    
  3. create redmine apache config

    I named the site file: /etc/apache2/sites-available/redmine

     <VirtualHost *:8083>
       DocumentRoot /usr/share/redmine/public
       <Directory /usr/share/redmine/public>
         AllowOverride all
         Options -MultiViews
       </Directory>
     </VirtualHost>
    
  4. enable site and restart apache

     a2ensite redmine
     service apache2 restart
    

access to redmine

    redmine is now running you can access it with

    redmine default username: admin
    redmine default password: admin

apache reverse proxy to the fresh redmine installation

  1. install apache2 to run as reverse proxy

    install debian packages

     apt-get install libapache2-mod-proxy-html
    

    enable mod

     a2enmod proxy
     a2enmod proxy_http
     a2enmod proxy_html
    
  2. create reverse proxy config eg. under /etc/apache2/sites-available/redmine.example.com

     <VirtualHost *:80>
    
       ServerName redmine.example.com
       ServerAlias redmine.example.com
    
       ProxyRequests Off
    
       ProxyPass / http://192.168.100.178:8083/
       ProxyPassReverse / http://192.168.100.178:8083/
    
     </VirtualHost>
    
  3. enable site and restart apache

     a2ensite redmine.example.com
     service apache2 reload
    
  4. if you want to use virtual hosts in combination with ssl you must configure SNI (server name indication)

    Actually it's already enabled in debian 7 packages, all you need to do is to add this line to your /etc/apache2/ports.conf file to make it work:

     NameVirtualHost *:443
    

    make sure /etc/apache2/sites-available/default-ssl does not define <VirtualHost _default_:443> rather than *:443 and that ServerName is set.

     <VirtualHost *:443>
       ServerName example.com
    

Sources:

written by uniq on 2013-11-23