Text

Anonymous asked: Can you help? :) I found your page: randoms.rawjeev.c om/post/1155689146/redmin-on-windows-with-sqlite-mongrel-cluster-apache#notes and on that page, you link to another page: redmine.o rg/projects/redmine/wiki/HowTo_Install_Redmine_in_a_sub-URI_on_Windows_with_Apache which I am using to try to get Redmine setup on Apache Tomcat. Well I am having a problem and am stuck at step where windows services are setup. See my post: redmine.o rg/boards/2/topics/27057

I have installed it on Apache HTTP Server & Not Apache Tomcat. You cant run a PHP or Ruby-Rails applications like Redmine on Tomcat because Tomcat is a servlet container purely meant for java based web applications. Hope this helps.

Tags: redmine
Text

Redmin on Windows with SQLite, Mongrel Cluster + Apache

I wanted to get the latest Redmine working on my Windows 2008 Server as a sub-URI under Apache. I’ve done this before about 6 months back but, having forgotten the detailed steps followed (and the glitches that were resolved), I made up my mind to write a HOWTO (for myself or you) as I get it running again on our new server.

Here is my main software config list:

  • OS: Windows 2008 64 bit
  • DB: SQLite 3.7.2
  • Apache 2.2.16
  • Ruby 1.8.6-p398
  • Redmine 1.0.1

Note on choices:

I have Apache 2.2 because I already use it to publish mercurial repositories and also because there is enough help around to configuring open source software with Apache than with IIS. I chose SQLite in place of the default MySQL for ease of backups & management (I just backup 1 db file), it is good enough to hold redmine data for the team size & projects we have. Another important choice is the Ruby version, I chose Ruby 1.8.6 over 1.8.7 because win32-service which is required for us doesn’t work with 1.8.7 (you’ll come across this in one of the steps).

Note: This HOWTO is actually a variation of HowTo Install Redmine in a sub-URI on Windows with Apache”, which you should be looking at if your database happens to be MySql.

The Steps

1. Apache Setup: Download & install Apache server 2.2.x from here. (There are many HOWTOs around on the web for this, I am not getting into details)

2. SQLite Setup:

  • Download SQLite 3.7.2 windows binaries from here.
  • You need to get both sqlite-3_7_2.zip & sqlitedll-3_7_2.zip
  • Extract both to folders and add them to the PATH. I have extracted them to D:\Software\sqlite-3_7_2 & D:\Software\sqlitedll-3_7_2 respectively and added both to my windows PATH.
  • Decide on where you’d have your redmine database. I am keeping my database under D:\Software\reminedb\
  • Use command prompt to go to the folder and create the database by typing: sqlite3 redmine.db
  • Now redmine.db database should be created and the sqlite3 prompt should be seen “sqlite>”. In the sqlite prompt type .databases and you should see the database listed. You don’t need to create any tables, just exit by typing .quit .You should see your database file in the folder after exiting.

3. Ruby Setup:

  • Download & install Ruby 1.8.6 from here, during setup select “Add Ruby executables to your PATH” and install the required ruby gems.
  • You can check ruby version with: ruby -v & gem version with gem -v at the command prompt.
  • Install the following gems as shown:

        gem install rack -v=1.0.1
        gem install rake -v=0.8.3
        gem install rails -v=2.3.5
        gem install sqlite3-ruby

  • Next you need to download the following gems from here & here to a folder and install them manually.

        mongrel-1.1.5-x86-mingw32.gem
        mongrel_service-0.3.4-i386-mswin32.gem
        win32-service-0.5.2-mswin32.gem

  • From the command prompt I went to the folder where I had downloaded these gems and executed gem install mongrel which installed all the required gems for me (total 5 including gem_plugin-0.2.3, cgi_multipart_eof_fix-2.5.0 & others I have downloaded to the folder).

4. Redmine Setup:

Installing Redmine: Download redmine1.0.1 from here and extract the zip to a folder where you want to have your redmine installation. I kept it under D:\Software\redmine-1.0.1

  • Now copy D:\Software\redmine-1.0.1\config\database.yaml.example to D:\Software\redmine-1.0.1\config\database.yaml
  • Edit the database.yaml and configure your “production” environment, for SQLite my configuration file just has the following lines:

        production:
          adapter: sqlite3
          database: D:\Software\redminedb\redmine.db

  • Next from the command prompt goto the redmine installation folder D:\Software\redmine-1.0.1 and execute command rake generate_session_store
  • Next execute command rake db:migrate RAILS_ENV=”production”
  • Next load the default data with the following command rake redmine:load_default_data RAILS_ENV=”production”

5. Redmine as a sub-URI

    Three things to configure.

     1. Let redmine know that it needs to work as a sub-uri

  • Edit D:\Software\redmine-1.0.1\config\environment.rb
  • Assuming the url to access redmine is http://localhost/ptracker (you can choose anything you want in place of ptracker)
  • Add the following line at the end of the file: ActionController::Base.relative_url_root = “/ptracker” and save the file.

     2. Running Mongrel rails service

  • Start a command prompt and create windows services with the following commands:

        mongrel_rails service::install -N mongrel_redmine_3001 -D “mongrel_redmine_3001” -p 3001 -e production -c D:\Software\redmine-1.0.1

        mongrel_rails service::install -N mongrel_redmine_3002 -D “mongrel_redmine_3002” -p 3002 -e production -c D:\Software\redmine-1.0.1

  • Then start the services. (You can also configure them to start automatically on system start)

        net start mongrel_redmine_3001

        net start mongrel_redmine_3002

     3. Configure Apache as proxy to Mongrel Cluster.

  • You need to enable the following Apache modules: proxy_module (mod_proxy.so), proxy_http_module (mod_proxy_http.so), proxy_balancer_module (mod_proxy_balancer.so). Load these modules by editing the apache configuration file and un-commenting the corresponding LoadModule lines.
  • create a file called redmine_apache.conf with the following lines in it and include it in your apache configuration file. You may also choose to directly add the configuration in httpd.conf but I suggest you keep it in a separate file and include it (just to keep your config clean).

        ProxyPass /ptracker balancer://redminecluster
        ProxyPassReverse /ptracker balancer://redminecluster
        <Proxy balancer://redminecluster>
          BalancerMember http://localhost:3001
          BalancerMember http://127.0.0.1:3002
        </Proxy>

  • If you saved this in a file called redmine_apache.conf placed under D:\Software\redmine-1.0.1\redmine_apache.conf then to include it in apache conf, edit httpd.conf file and add the following line to it.

        Include “D:/Software/redmine-1.0.1/redmine_apache.conf”

All Done, You restart Apache and access redmine in your browser typing the url:

http://localhost/ptracker