Starting a thin web server as a Windows service

I am trying to deploy in a Redmine application. I heard that thin is the fastest ruby ​​on the rails web server, so I installed it. Now I have a very simple problem: I have to start it every time I reboot the machine using cmd, because there is no ready-made Windows service or something like that that allows me to autorun it. How can I fix the problem? I saw that there is a bat file, so I tried to make the Windows C # service like this, and it starts correctly, but if I stop it, the service will stop, but the web server is still active and it will never shut down. The only way to stop the subtle is to reboot the machine. Perhaps I’m mistaken, could someone post an example of how I should work as a Windows service?

+3
source share
1 answer

I wrote a blogpost about this a while ago, but most of them should be applicable. Hope this helps.

But honestly, I always deploy windows using the mongrel-service gem and configure apache before balancing the load between 3 mongrels. Much easier. Also a big advantage for me was that if something went wrong with the thin-service, it did not restart automatically, while the mongrel-service protects your mongrel-process, and if for some reason it goes down, it will restart it again, For me it was something that I could not miss.

+5
source

Source: https://habr.com/ru/post/1778816/


All Articles