1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
|
<link href="jaminid.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {font-family: "Courier New", Courier, mono}
-->
</style>
<table width="800" border="0" cellspacing="5" cellpadding="0">
<tr>
<td width="243"><img src="jaminid.gif" width="243" height="82"></td>
<td width="25%"><div align="center"><a href="index.html">about</a></div></td>
<td width="25%"><div align="center"><a href="http://sourceforge.net/projects/jaminid/">download</a></div></td>
<td width="25%"><div align="center"><a href="doc.html">how-to</a></div></td>
<td width="25%"><div align="center"></div></td>
</tr>
</table>
<table width="800" border="0" cellspacing="5" cellpadding="0">
<tr>
<td width="10"> </td>
<td><h1><strong>Frequently Asked Questions</strong></h1>
<p><strong>1. If jaminid does not serve files, or have scripts, how can you serve active content through it? </strong></p>
<p>jaminid works through demultiplexors of HTTP requests called ContentOracles - that extend the <span class="style1">ContentOracle</span> class. Content oracles by contract do one things: they produce the content as a regular java String.</p>
<p><strong>2. How do I set up a Daemon and a ContentOracle for my Application?</strong></p>
<p>Usually you will need to extend the <span class="style1">ContentOracle</span> class and override the <span class="style1">demultiplex(..)</span> function. A good, quick example is in the <span class="style1">com.prolixtech.jaminid-example.HelloWorldServer</span> class.</p>
<p>Here's a recap: Make a new class that will serve as your ContentOracle</p>
<pre>
public class HelloWorldServer extends ContentOracle {
// other functions you may use
public String demultiplex(Request connRequest, Response connResponse) {
// here you can use the request object to view information about the request,
// and optionally the reply object to inform the server of the response
// (error codes, cookies, and more)
return theWebPageInHTML; // a String you have assembled in the function
}
}
</pre>
<p>Now, in your main class, start a Daemon using the ContentOracle you made:</p>
<pre>
HelloWorldServer s = new HelloWorldServer();
Daemon myDaemon = new Daemon(PORT, s);
// where PORT is the HTTP port (usually HTTP holds port 80)
</pre>
<p>Note that Daemon runs as a thread, so your application will continue to run even after it finishes. Usually, daemons by definition keep running; if you need to close the daemon for some reason, call the <span class="style1">tearDown()</span> function.</p>
<p><strong>3. Is this Daemon HTTP1.1 compliant?</strong></p>
<p>Yes. </p>
<p><strong>4. Are there any security issues with using this Daemon?</strong></p>
<p>No. Remember, on its own, the daemon does not serve any files, nor even accesses the filesystem at all apart from configuration files. That is where the largest errors have been in other major web servers.</p>
<p>If a user needs to implement a file server running on this daemon, they must be careful to follow a few good ideas:</p>
<ul>
<li>Try not to run as root on operating systems that have users and groups. </li>
<li>Make sure the Canonical filenames fall within the root paths allowed by your application - i.e. no symlinks are followed, and the "../.." trick is not used.</li>
<li>Whenever possible, just use a single directory for files and put everything in it. If for some reason you need to have such a large number of files that this becomes impractical, perhaps you should look into a traditional HTTP server.</li>
</ul>
<p><strong>5. Is HTTP authentication implemented?</strong></p>
<p>No, it will be implemented very shortly however. It is very simple to do non-http authentication, and if you have a user authentication system already in place, it is very easy to use that instead.</p>
<p><strong>6. Does jaminid support secure-HTTP?</strong></p>
<p>No. There are plans to implement it in the future. </p>
<p><strong>7. Who wrote this project?</strong></p>
<p><a href="http://myweb.jhu.edu/con/">Constantinos Michael</a> wrote the initial project and is currently the project leader. </p>
<p><strong>8. Why was this project written?</strong></p>
<p>Because surprisingly, there was nothing out there that could perform these simple functions. You'll find Perl code to do what this project does, and you could actually also perform a system reminescent of the ContentOracle by using custom <strong>apache </strong>plugins.</p>
<p>This project was in essence written as part of a larger project - Project MuseBox, however it is good enough to release on its own.</p>
<p><strong>9. What are some examples I can use jaminid for?</strong></p>
<ul>
<li>search engines</li>
<li>file sharing programs</li>
<li>internet jukebox players</li>
<li>remote administration tools</li>
<li>web servers</li>
<li>email / newsreaders</li>
<li>lightweight Web Services - infact, interprocess communication</li>
<li>database accessors</li>
</ul>
<p><strong>10. What does jaminid mean?</strong></p>
<p>JAva MINI Daemon.</p>
<p> </p>
<table width="800" border="0" cellspacing="5" cellpadding="0">
<tr>
<td width="125"><a href="http://sourceforge.net"><img src="http://sourceforge.net/sflogo.php?group_id=127764&type=2" width="125" height="37" border="0" alt="SourceForge.net Logo" /></a></td>
<td><a href="http://sourceforge.net/projects/jaminid/">Download <strong>jaminid</strong> on SourceForge.net</a></td>
</tr>
</table>
<p>The project leader is <a href="http://myweb.jhu.edu/con/">Constantinos Michael</a>. </p>
<p>This project is open source, released under the LGPL. If you need to use this project and would like to obtain it under a different license, please contact the administrators to ask for it. </p>
</td>
</tr>
</table>
<p> </p>
|