LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Run a java socket server (https://www.linuxquestions.org/questions/linux-newbie-8/run-a-java-socket-server-507930/)

gloveny 12-06-2006 12:02 PM

Run a java socket server
 
Hi can anyone point me in the direction of some documentation.

My program is just a simple socker server. Linux = 2.6
I have to code, I just need to know the basics like where to put it on my server so client applets can connect to it, and how to start the server.
Thank you

btmiller 12-07-2006 09:55 PM

Just run the code. Make sure that your firewall allows traffic to/from whatever port your server is listening on. I am assuming you just need to start it once, not on every reboot.

gloveny 12-08-2006 05:39 AM

My questions was were to put the socket server on my server. In which folder. I am a complete beginer and have very little Linux knowledge.

So,
1) which folder should I put it in to be avaliable to only one particular domain name?

2) where to put t to be avaliable to all my domains on the server?

3) how do i start it?

4) how to I stop it?

5) how can I see the out put, like on a windows computer I can run it and a command window type thing opens and I can see the system.out's. How can I do this on a Linux server, bearing in mind my only access is SSH?

Thanks, complete noob.

jlliagre 12-08-2006 05:55 AM

Quote:

Originally Posted by gloveny
My questions was were to put the socket server on my server. In which folder. I am a complete beginer and have very little Linux knowledge.

So,
1) which folder should I put it in to be avaliable to only one particular domain name?

domain name ?
The folder (directory) where a program sits has no relation whatsoever with that.
Quote:

2) where to put t to be avaliable to all my domains on the server?
Same as the above.
Quote:

3) how do i start it?
java <something>
Quote:

4) how to I stop it?
That depends on how it is written, in last case, kill <process-id> should work.
Quote:

5) how can I see the out put, like on a windows computer I can run it and a command window type thing opens and I can see the system.out's. How can I do this on a Linux server, bearing in mind my only access is SSH?
The output of a socket server usually goes to its clients, please be more specific about what output you are talking about.

gloveny 12-10-2006 11:14 AM

jlliagre, thanks for your reply.
When I say out put I mean simple system.outs to the consol window so I can debug my java socket server. I'd liek to just develop it locally and then upload it but ho many programs work first time after you moved its location.
I've only just got used to login in via SSH and perhaps running few commands like getting a password or somthing. I want to be able to start the server and then watch or capture the system.out's. I could always write them to a file instead if its not possible.

Thanks

btmiller 12-10-2006 02:07 PM

You can put the server anywhere and then start it with "java <programname>" anything you write to standard output (e.g. with system.out.println) will be printed onto your console. Running your server with the java command is just like running any other command in Linux -- anything going to the standard output is written to the terminal unless you redirect it somewhere else.

gloveny 12-11-2006 07:38 AM

ok guys, thanks for all the replies. That should get me going.


All times are GMT -5. The time now is 10:45 PM.