views:

274

answers:

2

How can I run solr on a windows server, so it starts up automatically?

I run it with:

java -jar start.jar

but I need the server to do this automatically.

+2  A: 

Create a batch file with the command you need and run it on startup: some of these ideas might be of use.

If you ran solr inside tomcat, you could start tomcat as a windows service and set the service to start automatically.

Tomislav Nakic-Alfirevic
I am using IIS, not tomcat.
Blankman
Can you explain more about how you are deploying a .WAR file inside of IIS? Or are you using IIS as a frontend to some other webcontainer? I think you can't deploy inside of IIS, that you need to have something like Jetty (which is what you are using with java -jar start.jar) or Tomcat.
Eric Pugh
Good point, Eric. IIS is not a servlet container: Blankman is probably simply using it as a frontend to jetty. In that case, my suggestion of using it with tomcat might make sense. Otherwise, Jetty can be set up as a windows service as well: http://docs.codehaus.org/display/JETTY/Win32Wrapper
Tomislav Nakic-Alfirevic
+1  A: 

The Scheduled Tasks feature in Windows Server will let you configure your command to be executed at startup, without the use of a batch file.

Josh