![]() |
Server configuration |
version 7.1 feedback: 2step@zentense.com |
![]() |
1. Starting and stopping server |
|
Just execute startup.jar and shutdown.jar to start and stop server. On Windows
just double-click on the icon. For executing a jar from command-line do
java -jar startup.jar from the
STEP_HOME directory (directory where you
uncompressed 2step package). By default server runs on port 8080.
When starting server you can use these options: java [-DDEBUG] -jar startup.jar [stdout] [<config_file>]
For stopping server: java -jar shutdown.jar [<port>] By default server listening at port specified in configuration file is shut down, but another one can be specified as an argument. |
![]() |
2. Package contents |
Into STEP_HOME directory you will find these contents:
|
![]() |
3. Configuration file |
|
In the configuration file all the default options are commented. If you
uncomment them nothing happens because is the default.
Configuration file is divided intro three different sections: listeners, options and contexts. Let's see them in detail: 3.1. Listeners sections Jetty features three different listeners: one for HTTP, other for HTTPS supporting secure connections. These listeners are for serving web pages. There is a third listener for AJP (Apache JServ Protocol) that allows communicate Jetty with different web servers as Apache or IIS. 3.1.1. HTTP server The property http.enabled enables or disables the listener, while the property http.port tells which port the HTTP server is listening to. By default HTTP listener is enabled on port 8080. 3.1.2. HTTPS server The property https.enabled enables or disables this listner, while the property https.port tells which port the HTTP server is listening to. By default HTTPS listener is disabled and its default port is 8443. The property https.needclientauth tells if a secure certificate is requested to authenticate clients. By default this option is disabled. For configuring the server certificates use the Java keystore tool as documented here. 3.1.3. AJP 1.3 server The property ajp.enabled enables or disables the listener, while the property ajp.port tells which port the AJP server is listening to. By default AJP listener is enabled on port 8009. 3.2. Options sections In this section some global options are set up:
3.3. Contexts section A context is a directory on the web space (URI) of localhost that is mapped to a directory on the server file system (web root) for serving HTTP requests, and that may have a 2step application mapped to another directory on the web space (web application URI). You can define as many contexts as you wish but remember that a given host and URI can be only mapped to a unique context 3.3.1. Default context There is always at least one context served by the server, the default context whose URI is '/'. Default context cannot contain web applications! With the default configuration file, the default context can be accessed through http://localhost:8080/ and it maps to directory docs, and the context manager can be accessed through http://localhost:8080/manager. 3.3.2. User defined contexts You can define as many context as you wish, always respecting that each context cannot have the same host and URI than another one. User defined contexts are identified by a name. In the property contexts you can add as many context names as you wish, separated by comma. For each context there are some properties. All of them are optional but usually you will need to define at least the host or the uri if you don't want conflicts between diferents contexts. The properties are:
|
![]() |
4. Context samples |
Suppose the next context named test:
test.root= /www/myweb test.uri=/mywebThis creates a context with no web application that can be accessed through http://localhost:8080/myweb and maps to directory /www/myweb. Notice that coing to default context at http://localhost:8080 would continue to show the same as before. Now look at another definition of test: test.root= /www/myweb test.uri=/myweb test.webapp.uri=/*Now server will try to load the application named test into the default webapps.dir. Supposing that it would exist, going to http://localhost:8080/myweb will show the test application instead of the web root. This context is fully mapped to the web application. Another one: test.root= /www/myweb test.uri=/myweb test.webapp.uri=/webapp/*Now going to http://localhost:8080/myweb will show the web root as in the first sample, and going to http://localhost:8080/myweb/webapp will show the web application. test.root= /www/myweb test.uri=/myweb test.webapp.uri=/webapp/* test.host=www.myweb.orgNow localhost is not the host for this context anymore, but www.myweb.org. This context can only be accessed through http://www.myweb.org:8080/myweb test.root= /www/myweb test.uri=/myweb test.webapp.uri=/webapp/* test.host=www.myweb.org test.alias= myweb.org, www.myweb.comNow context can be accessed through diferent localhost. http://www.myweb.org:8080/myweb, http://myweb.org:8080/myweb and http://www.myweb.com:8080/myweb get the same request from server.
| |||||