How to configure apache to run redmine

I have a working Redmine installation on my Debian server, but I don't know how to configure Apache2 properly so that neither the content of the Redmine folder nor the Redmine start page will be displayed as the homepage of my website. Suppose the URL of the website was www.myexample.com.

Current state

  • www.myexample.com shows files of /var/www/redmine folder
  • with the symbolic link /var/www/redmine -> /usr/local/lib/redmine-2.1/public/

Wanted state

  • www.myexample.com should be my usual website homepage (e.g. showing index.html)
  • www.redmine.myexample.com or www.myexample.com/redmine should show the redmine page

I guess it is just a configuration problem but I cannot figure out the problem. So here are my configuration files. Do you see what I am missing here?

  1. /etc/apache2/httpd.conf

    
      ServerName redmine.example.com
      DocumentRoot /var/www
      
        AllowOverride all
        Options -MultiViews
      
    
    
  2. /etc/apache2/sites-available/redmine

    
      DocumentRoot /var/www/redmine
      
        AllowOverride all
        Options -MultiViews
        RailsBaseURI /redmine
      
    
    
  3. /etc/apache2/sites-available/default

    
        ServerAdmin webmaster@localhost
    
        DocumentRoot /var/www
        
                Options FollowSymLinks
                AllowOverride None
        
        
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        
    
        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        
    
        ErrorLog ${APACHE_LOG_DIR}/error.log
    
        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn
    
        CustomLog ${APACHE_LOG_DIR}/access.log combined
    
    

After changing any of these files, do I have to restart Apache2 or use a2ensite to activate any of the hosts?

asked Nov 25, 2012 at 12:29

2

I've written a how-to including this. While it is about Redmine 1.3.x it should be still relevant for the Apache part.

Full how-to: Redmine stable on Debian stable. Basically, it comes down to this:

  • Install and configure mod_passenger in /etc/apache2/mods-available/passenger.conf:

    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
    
  • Extend your current main 'site', for example /etc/apache2/sites-available/mymainsite:

    
            RailsBaseURI /redmine
            PassengerResolveSymlinksInDocumentRoot on
    
    
  • Create another 'site' and include the same as above, changing the RailsBaseURI value to /.

answered Nov 26, 2012 at 14:44

gertvdijkgertvdijk

3,3724 gold badges30 silver badges46 bronze badges

3

  1. Change the owner and the group of the Redmine directory to "apache".
    # chown -R apache:apache /var/lib/redmine
    
    
  2. Execute Redmine in Apache's root directory. Update DocumentRoot in /etc/httpd/conf/httpd.conf as follows:
    DocumentRoot "/var/lib/redmine/public"
    
    

    Update ServerName. Specify the FQDN or IP address of the server that will run Redmine (in this example, we specify "example.com").

    ServerName example.com:80
    
    

    If the FQDN was specified in /etc/httpd/conf/http, then in /etc/hosts register its IP address as follows: Specify the FQDN of the server running Redmine (in this example, we specify "example.com".)

    127.0.0.1       example.com
    
    
  3. Restart Apache. Check the configuration file:
    # /etc/init.d/httpd configtest
    
    

    Check the status of SELinux.

    # getenforce
    
    

    If the command returns "Enforcing", then perform the steps described in "Configuring Redmine to run when SELinux is enabled". Otherwise, restart Apache.

    # /etc/init.d/httpd graceful
    
    

How do I run a redmine server?

Installation procedure.
Step 1 - Redmine application. ... .
Step 2 - Create an empty database and accompanying user. ... .
Step 3 - Database connection configuration. ... .
Step 4 - Dependencies installation. ... .
Step 5 - Session store secret generation. ... .
Step 6 - Database schema objects creation. ... .
Step 7 - Database default data set..

How do I start redmine on Windows?

Install Redmine.
Download "redmine-1.0.4.zip" from here..
Extract the contents of the redmine-1.0.4 directory in the archive to C:\webserver\Redmine..
Log into MySQL as root using "MySQL Workbench". ... .
Copy C:\webserver\Redmine\config\database.yml.example to C:\webserver\Redmine\config\database.yml..