Thin_redmine Multi-instance

I want thin_redmine extended from two to four, how should configure

Hi @mzhx,

You must a few lines to the INSTALLDIR\apps\redmine\scripts\serviceinstall.bat file after the following line:

if not ""%1"" == ""INSTALL"" goto remove

Supposing that INSTALLDIR is the installation directory, 33333 is the port for the third server and 44444 is the port for the fourth server, you must add the following lines:

"INSTALLDIR\apps\redmine\scripts\winserv.exe" install "redmineThin3" -start auto "INSTALLDIR\ruby\bin\ruby.exe" "INSTALLDIR\apps\redmine\htdocs\bin\thin" start -p 33333 -e production -c "INSTALLDIR\apps\redmine\htdocs" -a 127.0.0.1 --prefix /redmine
net start redmineThin3 >NUL
"INSTALLDIR\apps\redmine\scripts\winserv.exe" install "redmineThin4" -start auto "INSTALLDIR\ruby\bin\ruby.exe" "INSTALLDIR\apps\redmine\htdocs\bin\thin" start -p 44444 -e production -c "INSTALLDIR\apps\redmine\htdocs" -a 127.0.0.1 --prefix /redmine
net start redmineThin4 >NUL

Also, at the end (but before the exit), you must add the following lines:

net stop redmineThin3 >NUL
"INSTALLDIR\apps\redmine\scripts\winserv.exe" uninstall "redmineThin3"
net stop redmineThin4 >NUL
"INSTALLDIR\apps\redmine\scripts\winserv.exe" uninstall "redmineThin4"

Now, in the INSTALLDIR\apps\redmine\scripts\servicerun.bat file, you must add the following lines before the last net start line:

net start redmineThin3
net start redmineThin4

Also, at the end (but before the exit), you must add the following lines:

net stop redmineThin3
net stop redmineThin4

Next, you must edit the INSTALLDIR\properties.ini and add the following lines at the end:

[Thin_redmine3]
thin_unique_service_name=redmineThin3
thin_server_port=33333
[Thin_redmine4]
thin_unique_service_name=redmineThin4
thin_server_port=44444

Now, you need to add a new BalancerMember to the Apache configuration for Redmine. Just add new lines on INSTALLDIR\apps\redmine\conf\httpd-prefix.conf, like, for example, these ones (depending on your configuration):

BalancerMember http://127.0.0.1:33333/redmine
BalancerMember http://127.0.0.1:44444/redmine

Finally, you need to execute the following in your command prompt:

INSTALLDIR\serviceinstall.bat

Wait until all prompt finish, and then execute:

INSTALLDIR\serviceinstall.bat INSTALL

Wait a bit and you should be able to access your server.

Hope it worked!

Thanks for the reply. it worked !

1 Like

Glad it worked @mzhx!

Don’t hesitate to come back if you have any other question.

Best regards