Rori
Rori

Reputation: 97

Making Fedena a Windows Service Failed

I successfully installed Fedena on Windows using this tutorial:

http://en.wikibooks.org/wiki/Fedena/Installation

The problem is that each time I start windows, I need to run the command ruby script/server so that I can access the project locally. I tried making Fedena a Windows Service that starts automatically by following the steps mentioned in the tutorial, but it seems that it didn't work.

Making a Windows Service If you want to run Fedena as a Windows Service (which automatically starts), do the following commands: Open the Ruby Command prompt and go to your Fedena Installation director //do they mean by this C:/Fedena?

Install a Gem:

gem install win32-service

Install a Gem:

gem install mongrel_service

Run the command:

mongrel_rails service::install -N Fedena -c C:\FEDENA -p 3001 -e production

(Replace C:\FEDENA with whatever your Fedena installation Directory is.) You may also wish to change the port from 3001 to 80 so when entering the address from other computers, it is not required that you enter a port. Go to windows search at the start menu, type: services.msc Look for service named 'Fedena' and set it to automatic Restart your computer and see if the fedena start automatically. Always make sure that your server is running.

Any ideas what could be the problem?

Upvotes: 0

Views: 422

Answers (1)

ravi kumar
ravi kumar

Reputation: 107

Right after Fedena is configured, the start of the application is via console which should stay open for all the times if we want the application to be up and running. But quite often will get closed (human error, server down etc) and the application will go down. The same applies if the server is rebooted/bounced and all over again.

So here is the solution if you don't want to go over this hassle:

  1. Download http://nssm.cc/download/?page=download
  2. Unpack it (lets say C:\NSSM)
  3. Create a batch file ( lets say C:\Fedena\StartFedena.bat)
  4. Edit the batch file ( right click on the bat file and click Edit) Past the following code (change the paths accordingly) ********************************** (without the stars and this comment)

cd \ cd Fedena mongrel_rails start -e production

Note: If you want to start it as development mode remove -e production from the last line

  1. Open CMD
  2. Type cd\
  3. Type cd NSSM
  4. depending on the system type: "cd win32" ot "cd win64" 9.Type in the cmd : "nssm install"
  5. A modal window will pop-up
  6. Click Browse
  7. Navigate to the location where the batch file is and select it;
  8. Leave options empty
  9. Service name "Fedena"
  10. Install Service
  11. Go to "Services" (usually under Control Panel\System and Security\Administrative Tools)
  12. Start Services
  13. You should find service named "Fedena"
  14. Start Service
  15. Navigate to http://example.com:3000 and Fedena should be up
  16. The service should be already set as automatic so if the server is restarted Fedena will come up automatically.

If you need to bounce the application just restart the Fedena Service.

That is,

Thank you

Upvotes: 1

Related Questions