Installation
Anvil can be ran as a standalone, with its own HTTP listener,
or as a servlet in any servlet container.
This file covers Unix only but Anvil's distribution contains quick start files
README.Unix and
README.Windows for getting the standalone running in few minutes.
Standalone
Standlone mode is primarily for development purposes as
the HTTP listener does not
fully conform to HTTP standard.
To start standalone service (in unix) do following:
- Unpack the distribution to desired location, referred hereafter
with
${INSTALL}.
$ cd ${INSTALL}
$ tar xvfz /location/of/anvil-VERSION.tar.gz
- Change directory to
${INSTALL}/anvil
$ cd anvil
- Edit the
bin/setenv.sh to reflect
to location of your JDK or JRE installation.
Version 1.2.2 or greater is required for Anvil.
- Import the environment:
$ ./source bin/setenv.sh
Script reads all the .jar and .zip files in
${INSTALL}/anvil/lib and adds them to CLASSPATH
environment.
- Edit the configuration file
conf/anvil.site.properties
to reflect the location ${INSTALL}/anvil/site.
This is accomplished by changing with container attribute in
server section.
If required, the port in
listener section can be changed to
reflect the port.
- Start the server:
$ ./bin/listener
Now the Anvil server should be running, you should see a log
messages like this:
anvil 2.5 build 2509 2002/05/07 12:32:15
type 'help' for help
server starting up: conf/anvil.site.properties
2002-04-22 12:06.00 main Created: Log @stdout BasicLogLayout({date} {time} {thread} {message}\n{exception})
2002-04-22 12:06.00 SessionCleaner Starting...
2002-04-22 12:06.00 main SessionEventHandler anvil.session.LoggingSessionEventHandler@960f05 initialized
2002-04-22 12:06.00 main Session handler registered: anvil.session.LoggingSessionEventHandler
2002-04-22 12:06.00 main SessionContainer anvil.session.basic.BasicSessionContainer@b42cbf initialized
2002-04-22 12:06.00 main Zone /doc/ started.
2002-04-22 12:06.00 main Zone /console/pics/ started.
2002-04-22 12:06.00 main Zone /console/ started.
2002-04-22 12:06.00 main Zone /examples/site/ started.
2002-04-22 12:06.00 main Zone /examples/music/ started.
2002-04-22 12:06.00 main Zone /examples/ started.
2002-04-22 12:06.01 main Zone / started.
2002-04-22 12:06.01 main ZoneClassLoader(/) started
2002-04-22 12:06.01 main Domain started.
2002-04-22 12:06.01 main Server started.
2002-04-22 12:06.01 Listener:8080 Endpoint created at port 8080
Server is now started and commands may be issued to it:
help
- Shows list of available commands
status
- Shows the status of server, including memory usage
gc
- Issues full garbage collection
start
- Starts the server, if not started already
stop
- Starts the server, if not stopped already
restart
- Stops and restarts the server
reread
- Starts, rereads the configuration, and starts the server
read configfile
- Starts, reads the supplied configuration file, and starts the server
exit
- Exits console. Will also stop server unless server is detached
shutdown
- Stops the server and exits console
Also pressing Control-C will terminate the server.
If desired, the invocation of java anvil.server.ServerControl
in bin/listener may be modified
with following flags:
-d
- Starts the server in detached mode, commands may
not be supplied to standard input, instead special
adminstration server is set up. Telnetting to specified
port opens connection into which above commands
may be issued. Note that there
is no access control to adminstration console.
-p port
- Specifies administration port, default is
7077.
If using detached mode it might a be good idea to start java
process as background by adding et (&) into end of
java invocation, thus making it a background process.
As servlet
The name of servlet is anvil.server.AnvilServlet.
It requires one initialization parameter
configFile={location of anvil.properties}.
Anvil servlet is initialized and started
on the first request coming to it. If configuration has
errors they are reported to requestor, and subsequnet calls
will try to initialized to server again, until is succeeeds.
|