File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Linux / UNIX and the fly likes which Linux servers? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "which Linux servers?" Watch "which Linux servers?" New topic
Author

which Linux servers?

Bret Waldow
Ranch Hand

Joined: Aug 04, 2000
Posts: 59
I am starting the design of an application primarily for Linux machines, although perhaps it might be used on Macs too. I am not targeting Windows at all.

I'm probably going to use the GWT in a browser as the main UI - Firefox or Google Chrome when it's generally available. I expect either can run Javascript locally, but there are some features that may require a server. One would be to access a shared system library to ask for computation - it appears this violates one of the design choices for browsers, and so would require a local server (servlet, REST, or SOA) to allow access.

The question is not 'which one'. The question is 'how do I know if the user has already installed a server, and how do I install my app to that if it's already there?'

If I were to choose Tomcat, how would I know if they already have Tomcat installed? If they have Apache, what do I do then?

How is this question resolved for applications that require a server to function on Linux (and Mac) machines?

Thanks for help and pointers.

Regards,
Bret
Cloudgen C.F. Wong
Greenhorn

Joined: Jul 15, 2009
Posts: 19
Bret Waldow wrote:I am starting the design of an application primarily for Linux machines, although perhaps it might be used on Macs too. I am not targeting Windows at all.

I'm probably going to use the GWT in a browser as the main UI - Firefox or Google Chrome when it's generally available. I expect either can run Javascript locally, but there are some features that may require a server. One would be to access a shared system library to ask for computation - it appears this violates one of the design choices for browsers, and so would require a local server (servlet, REST, or SOA) to allow access.

The question is not 'which one'. The question is 'how do I know if the user has already installed a server, and how do I install my app to that if it's already there?'

If I were to choose Tomcat, how would I know if they already have Tomcat installed? If they have Apache, what do I do then?

How is this question resolved for applications that require a server to function on Linux (and Mac) machines?

Thanks for help and pointers.

Regards,
Bret


If you are going to use the GWT, I think you should consider the "Google App Engine" http://code.google.com/appengine/


cheers
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16140
    
  21

Bret Waldow wrote:
If they have Apache, what do I do then?


How would you know if Java was installed? And by Java, I don't mean "gcj".

Bret Waldow wrote:
You install Tomcat (a/k/a Apache Tomcat"). Apache itself is the name used to refer to the non-Java general web server, although the Apache project as a whole has a lot of Java stuff not related to the original Apache Http Server at all.


There are bigger issues here, however. One of which is that installing server software, if it's going to be on desktop computers, has the potential to really annoy the security people. Another is that there's no such thing as "a" server. Servers come in lots of different flavors: DNS, HTTP, FTP, DHCP, database, etc., etc., etc.. Quite frequently more than one of these servers will be running in the same OS on the same box at the same time.


Customer surveys are for companies who didn't pay proper attention to begin with.
Bret Waldow
Ranch Hand

Joined: Aug 04, 2000
Posts: 59
Cloudgen C.F. Wong wrote:If you are going to use the GWT, I think you should consider the "Google App Engine" http://code.google.com/appengine/


Thanks for the suggestion. I've had a look at it, and I don't think that's a suitable architecture.

Nothing wrong with the app engine.

This is a stand-alone app running on a personal computer. I'm using a browser as there is a lot of capability easily available with browsers - it's a good fit for displaying content.

But while the user might also want to use a browser session to look at a web page off their machine, I'm not doing anything about that - I'm only utilizing content that is on their local machine.

Modern browsers such as FireFox and Chrome are javascript interpreters, and that's what I'm using it for. I'd be quite happy to implement the entire application without any server, just using local javascript files.

The only reason I'm considering a server now is that I also want to be able to call local system libraries to do some computing, and it appears that the security model for browsers does not allow that unless I implement it through a server. Since this is a self-contained local application, I'll have to put a server on their personal machine - they won't be connected to the internet, so there is no central server to use.

So, the question is - how do I go about dealing with the possibility they may already have one, and maybe a different one than the one I choose for the application? I've written servlets and SOA interfaces, deployed on Tomcat and JBoss. But I haven't dealt with the unknown Linux user who may have installed any sort of application they want to before they select mine, and may have any server someone else specified in their package on the system already.

How do I integrate with what they have programmatically? How do I deal with the possibility?

That's what I want to know. I'd have expected there is an approach worked out, or a simple answer explaining why it's not a problem.

What is an effective strategy for dealing with the possibility the user already has a server, and may not know anything about servers themselves? I'm talking about an app to be used by non-technical Linux users who can run 'apt-get' to install 'cool stuff' but cannot resolve server conflicts themselves.

Thanks,
Bret
Bret Waldow
Ranch Hand

Joined: Aug 04, 2000
Posts: 59
Tim Holloway wrote:
Bret Waldow wrote:You install Tomcat (a/k/a Apache Tomcat"). Apache itself is the name used to refer to the non-Java general web server, although the Apache project as a whole has a lot of Java stuff not related to the original Apache Http Server at all.


Umm... I didn't write that.

Tim Holloway wrote:There are bigger issues here, however. One of which is that installing server software, if it's going to be on desktop computers, has the potential to really annoy the security people.


I'd love to find a solution that allows me to access a local system library without installing a server. Can you suggest one?

Tim Holloway wrote:Another is that there's no such thing as "a" server. Servers come in lots of different flavors: DNS, HTTP, FTP, DHCP, database, etc., etc., etc.. Quite frequently more than one of these servers will be running in the same OS on the same box at the same time.


Yes, I know some of this. In my professional life I've written and deployed SOA services on Tomcat and JBoss. Either may have been installed by someone else's Linux package, or perhaps Glassfish.

I'd like to know about strategies to deal with that open-ended possibility, and the possibility they have no server at all installed. Servers can't use the same ports, best I know now.

Best solution would be not to need a server, of course. I'd love to find an approach that doesn't require one to gain access to local computation resources, just as the local mouse is available for use with the browser.

Thanks,
Bret
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16140
    
  21

Have you checked out XulRunner? Unless I'm too badly confused, it's intended to allow pretty much what you're looking for, without kludging your way through a server.

You can probably invoke a native code library, but chances are you'll need to create a signed application and maybe some glue libraries.

Unless you're absolutely dead set on GWT, you'd probably find it less work to use SWT (Eclipse's GUI) or even Swing for Linux desktop apps. You don't need to have Eclipse to run SWT - the Spoon ETL GUI design tool of the Pentaho Business Intelligence Suite is a stand-alone Java application using SWT. Then again, some of the more ambitious systems use Eclipse itself. Eclipse can be used for other purposes besides as an IDE for software development.

And, of course, there's a whole raft of quick-and-dirty GUI app design options that come with the core Linux distros - or as minor add-ons, from dialog-assistes shell scripts to Tcl/Tk on up to and including (but not limited to) Python and Perl. Not even touching the not-so-quick platform options like C/C++ or even Ada.

Come to think of it, however, I presume you did check Google's code resources to see what desktop-only options they might support for GWT?

Sorry to be so pedantic, BTW, but not everyone understands the nuances of servers.
Bret Waldow
Ranch Hand

Joined: Aug 04, 2000
Posts: 59
Tim Holloway wrote:Have you checked out XulRunner?


I think XulRunner allows me to run Mozilla/Firefox code and apps locally without the browser? That's not what I want to do.

I specifically want to use my connected-to-the-internet, fully-set-up-to-handle-mime-content, connected-to-online-resources-like-google-calendar Firefox or Google Chrome browser as the UI for my app BECAUSE it has all that capability already worked out and installed and functioning. And I want to be able to send data to a local computation function I've created as a shared system library on my Linux machine (the one running the browser) and get a computed result back into the scope of the browser for my app to work with.

You could think of what I'm trying to create as a Scientific PIM, and some of the 'Scientific' stuff is processing capability on my local machine and I want to be able to use it to process some of the information I'm getting in the PIM on the web.

And there's no central server 'out there' for this solution/architecture. It's my (or some other scientist's or academic's or engineer's) own computer that hosts their own PIM, gathering their own notes and processing their own transforms on it.


Tim Holloway wrote:You can probably invoke a native code library, but chances are you'll need to create a signed application and maybe some glue libraries


Please tell me the search terms I need to use to find out about how to do this. Any pointers would be helpful.

I have a 'libSomeCompute.so' shared system library on my local machine. I can call it from a C program or from a Java app via JINI with a string input now, and receive a string result back. I want to do that from Firefox.

That led to the thought of a local server & RPC, which led to the question of 'server collisions', which led to this thread. I'd much rather not need a local server to access the local computation resource (which cannot be relocated into Firefox for licensing and language reasons), but if I need one, how do I deal with 'computer-clueless' students and researchers who want to use the app, but can't resolve a collision between the port I specify and the same randomly chosen by some other package maintainer?

That's why the question is in the Linux/Unix section.


Tim Holloway wrote:Unless you're absolutely dead set on GWT, you'd probably find it less work to use SWT (Eclipse's GUI) or even Swing for Linux desktop apps. You don't need to have Eclipse to run SWT - the Spoon ETL GUI design tool of the Pentaho Business Intelligence Suite is a stand-alone Java application using SWT. Then again, some of the more ambitious systems use Eclipse itself. Eclipse can be used for other purposes besides as an IDE for software development.

And, of course, there's a whole raft of quick-and-dirty GUI app design options that come with the core Linux distros - or as minor add-ons, from dialog-assistes shell scripts to Tcl/Tk on up to and including (but not limited to) Python and Perl. Not even touching the not-so-quick platform options like C/C++ or even Ada.


For my use, I think I'd be reinventing a lot of wheels.

Tim Holloway wrote:Sorry to be so pedantic, BTW, but not everyone understands the nuances of servers.


I don't mind at all. I have a lot to learn. Thanks for taking the time to respond.

I'll appreciate anything more you might suggest in light of my description above.

Regards,
Bret Waldow
Bret Waldow
Ranch Hand

Joined: Aug 04, 2000
Posts: 59
It occurs to me that perhaps what I want is a proxy server on the local system that Firefox could be directed to use.

This proxy could add javascript code to support annotation and data extraction features to pages retrieved from the Internet, provide access to local pages for note-taking (and create new ones on request), and provide local access to the system computing resources - javascript code could assemble a request into a URL that is intercepted by the local proxy, translated to a local JINI or JNA call, and the result could be packaged into a reply to the originating javascript for appropriate action in the page.

GWT would be used to easily create on-page UI components and for other on-line resource access.

Can you recommend a good quality proxy server implemented in Java? Or perhaps you can shoot obvious holes in the idea (I would appreciate that too)?

Regards,
Bret Waldow
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16140
    
  21

If you want to perform active logic, by definition a proxy server isn't what you need. The word "proxy" means "standing in for something else". A proxy server forwards content created by a "real" server somewhere.

But using any kind of server just to get access to desktop system resources is pretty much overkill. I'm pretty sure that a signed XUL package can probably escape to a binary API and call desktop-local code. or even include desktop-local code.

I'm at a disadvantage here. I mostly avoid JavaScript, since the speed in development for me is lost in the extra debugging time that results from not having compile-time checking, with additional aggravation coming from the extra hassles in trying to debug in the client. But to each his/her own.

My own experience is that in most cases, you'll suffer less when you put functionality on a central server. It ensures that everyone is running the most up-to-date copy of the code and makes it easier to keep enterprise data backed up and secured. On the other hand, I've got no beef with dumping anything computationally nasty onto the client. After all, there's more clients than servers!

I think overall, your best bet is to get hold of the Firefox plugin developer docs and see what they have to say. That ties you to Firefox, but if you're going to dive into the desktop anyway, you've already limited your choices. Even if you used a Java applet, hooking via JNI would force system dependencies on you. And there are worse platforms than Firefox to be tied to.
Bret Waldow
Ranch Hand

Joined: Aug 04, 2000
Posts: 59
Hi,

I'm going to accept the 'RPC to a local Tomcat servlet' implementation for my shared library while I get on with the GWT coding I want to do, and assume I'll know more about how to pick the best solution from what I learn as I go.

I am curious about your comment against a proxy - I know there are proxies whose purpose is to intercept and re-write pages in the stream - filtering content, for instance. I'd think thus that all the content could safely pass through, be monitored for triggering types, and acted on. But I haven't worked with one yet, myself.

Am I being naive about this?

Thanks,
Bret
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16140
    
  21

Probably a matter of semantics. It would be pointless to have a proxy to do nothing at all, so proxies typically do something, even if it's only forwarding through a firewall. But a proxy isn't a primary originator of content, since part of what makes it a proxy is that it's passing requests through to another server somewhere.

I got tired of the overhead in keeping all my servers updated from the Internet, so I installed Squid as a caching proxy and aimed the YUM systems on my servers at it. One of the best things I ever did. I don't have the overhead of maintaining complete mirrors of the installed software base (including stuff I'll never use), and only the first update runs off the Internet. The subsequent ones come out of cache. Which, being on the LAN, is much faster, and it's less of a burden on the Internet as a whole.

It will be interesting to see what you come up with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: which Linux servers?