Solved

How to set up server on WinNT?

Posted on 1997-11-07
12
172 Views
Last Modified: 2012-05-04
Ok, I have everything done now, applets(and html files), mutlithreaded server. but how can I setup the server as a service which runs in the background even when I do not log on? please note: On Windows NT.

Thanks in advance.

Peggy
0
Comment
Question by:pyang051597
  • 6
  • 5
12 Comments
 
LVL 5

Expert Comment

by:msmolyak
ID: 1230216
Is server a Java application?

If it is there is a sequence of steps you have to take to make it  run as an NT service. I have it documented somewhere, I'll try to find it.

Michael
0
 

Author Comment

by:pyang051597
ID: 1230217
Yes, the server is java application.

Thanks for your help

0
 
LVL 3

Expert Comment

by:eugenem
ID: 1230218
0
 
LVL 5

Expert Comment

by:msmolyak
ID: 1230219
I did find a write-up on how to set up a Java application as an NT service. Let me know if you want it.
0
 

Author Comment

by:pyang051597
ID: 1230220
I visited the site, but that is for FaxMail, is it possible for other applications to be setup as services? I dont want to download those files right now because it said some moves might be dangeous.  Can you give me some ideas about that?

yes, please, msmolyak, I need your help, but I dont know if you can get the credits, sorry about that.

thanks, again.


0
 
LVL 5

Expert Comment

by:msmolyak
ID: 1230221
Peggy,

1. My write-up uses steps similar to those outlined in the abovementioned Web site only they are customized fro a Java application.
2. You will need the two programs which are downloadable from that Web site (I am not sure what dangers are you talking about), they sound pretty tame to me. You are going to be modifying the NT registry but unless start deleting the keys right and left there is no danger ther either provided you follow the instructions.
3. If you feel that my answer is more relevant (complete, correct, etc) then the previous one you can always reject the original answer and let me claim the points. This is up to you.

The write up follows. It is about configuring java application called JetPort (part of JetConnect product). I am sure that your application has different name and parameters and thus disregard whatever is specific to my application and customize it for your case. (I did it while creating the write-up and it worked). Let me know if you need additional help.

Michael

--------------------------------

This file contains the instructions on how to confugure JetPort to run
as an NT service.  The following description assumes
that
- You installed JetConnect in c:\java directory;
- You have instsrv.exe and srvany.exe programs which are part of NT
Resource Kit.
Also I was able to find those utilities on the Web under the following
URL: http://www.electrasoft.com/srvany/srvany.htm.
- You are able to successfully run JetPort as a Java application under
certain user account.

The main benefit of being able to run JetPort as an NT service is that
this way JetPort does not depend on the login
sequence.  That is the users can log on and off without affecting
ability of JetPort to run on a given computer.

The disadvantages of running JetPort as a service rather than as a Java
application are inability use the JetPort Monitor
and inability to do the tracing.  The reason for that is the restriction
imposed by NT: a service can either be interactive
(have access to Console, read keyboard input, etc.) or have network
access, but not both at the same time. Clearly, JetPort
needs a network access, thus the limitations listed above.

The following steps describe the procedure of configuring JetPort as a
service.

1. Install SRVANY.EXE as an NT service by running the following command:
        instsrv <serviceName> <path to srvany.exe>, for example
        instsrv JETPORT c:\bin\srvany.exe

2. From Control Panel/Services/Startup dialog box configure the newly
insatlled service (JETPORT in out example). Set
Startup Type to Manual or Automatic as appropriate. Set Log On As to the
account under which you were able to run JetPort
as Java application.

3. Start the registry editor (REGEDT32.EXE) and find the key
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\JETPORT.
Create "Parameters" key under JETPORT key.  Under Parameters key create
3 values:
        Application :REG_SZ: <path to Java VM>    
        AppParameters: REG_SZ: -classpath <CLASSPATH> jet.connect.port.Main ,
where CLASSPATH contains c:\java\classes directory and classes.zip file
containing standard java libraries.
        AppDirectory: REG_SZ: <directory path>     (this should be a
directory containing the correct jetcnnct.dll as well
as license.dat file if more than one license is used).

For example,
        Application :REG_SZ: c:\java\jdk1.1\bin\java.exe
        AppParameters: REG_SZ: -classpath c:\java\jdk1.1\lib\classes.zip;c:\java\classes  jet.connect.port.Main
        AppDirectory: REG_SZ: c:\java\bin

Once the above steps are completed you should be able to run JetPort as
an NT service.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:pyang051597
ID: 1230222
well, I guess I am quite dumb, I followed the steps and failed. here is what I did(my java server application is run as : java APSServer at c:\server, using jdk1.0.2):

1. instsrv NAPS c:\bin\srvany.exe
   OK
2. Control panel/services/startup & logon
   choose "automatic, System account, and Allow Service to interact with desktop".
3. Application :REG_SZ: c:\jdk1.0.2\bin\java.exe
   AppParameters: REG_SZ: -classpath    c:\jdk1.0.2\lib\classes.zip;c:\server APSServer
                                     ^^ (space?)
   AppDirectory: REG_SZ: c:\server

but when I tried to start the server on control panel/service( I clicked the start button), I got an error message: "error 002: the System cound not find the file specified."

Please help.

thanks.

Peggy
0
 

Author Comment

by:pyang051597
ID: 1230223
well, I guess I am quite dumb, I followed the steps and failed. here is what I did(my java server application is run as : java APSServer at c:\server, using jdk1.0.2):

1. instsrv NAPS c:\bin\srvany.exe
   OK
2. Control panel/services/startup & logon
   choose "automatic, System account, and Allow Service to interact with desktop".
3. Application :REG_SZ: c:\jdk1.0.2\bin\java.exe
   AppParameters: REG_SZ: -classpath    c:\jdk1.0.2\lib\classes.zip;c:\server APSServer
                                     ^^ (space?)
   AppDirectory: REG_SZ: c:\server

but when I tried to start the server on control panel/service( I clicked the start button), I got an error message: "error 002: the System cound not find the file specified."

Please help.

thanks.

Peggy
0
 
LVL 5

Expert Comment

by:msmolyak
ID: 1230224
Peggy,

Make sure all your files are where you think they are (srvany.exe, java.exe). Why did you choose system account. Try running it under your own (I assume that's where you normally run your server). Make sure your Registry structure is correct. (Tha is you have Parameters key with three values). Try adding c:\server and c:\bin to the path under the account you use to run.

Michael
0
 

Author Comment

by:pyang051597
ID: 1230225
Thanks for your quick response, I add those 2 files to c:\server and it worked! thanks:)

I have one last question: how to delete disabled server from control panel/service? I just re-setup my server and decided to use a new name, but at last I found I cannot delete the old one.

again, thanks, sorry eugenem, I have to give the credits to michael, although the web site you suggested was the right one.
 
0
 

Author Comment

by:pyang051597
ID: 1230226
i already remove the old service by using "instsrv .. remove", thanks.

I am going to close this question, michael, please say sth here so I can give you the credits.  btw, how useful are the credits?
I know they are useful for asking Qs, but for experts?

again, I appreciate your help.

peggy

0
 
LVL 5

Accepted Solution

by:
msmolyak earned 70 total points
ID: 1230227
Those points are useful mainly as ego boosters (by the way I cannnot use my expert points to ask questions). The Experts Excahnge claim that if you collect many-many expert points you become a paid expert (they sort of knight you). I am not holding my breath though.

Glad to be of assistance.

Michael
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now