Antiweb is not written in Common Lisp for the sake of novelty. Common Lisp was selected because it is the best. Instead of writing our own config file parsers, string routines, memory allocators, condition systems, dynamic binding systems, just-in-time compilers, etc, etc., we rely heavily on many features of Common Lisp (but not its I/O or pathnames).
If you haven't used lisp before, Antiweb may require a major shift in thinking. Many things you may think are impossible are easy. Languages like C are designed to be easy to implement—Common Lisp is designed to be powerful to program. Antiweb Tip The primary description of our lisp programming style is Doug Hoyte's book: Let Over Lambda. Even if you have programmed in lisp before, "The Antiweb Way" might still seem foreign. Just like Antiweb is not a conventional webserver, it is also not a conventional lisp program.
This section describes the most important data-structures for installing, configuring, extending, and creating content for Antiweb: confs and xconfs.
As an administrator, almost all Antiweb files you interact with are called conf files.
Conf files are text files filled with lisp forms. Every one of these lisp forms must be a list with the first element a symbol identifying the type of the form. This might be an example conf:
(worker blah)
(uid "my-user")
If a worker contains an inherit element, the corresponding file will also be parsed as a conf and its contents are appended to the current file's conf:
(inherit "/absolute/path/to/inherited.conf")
Circular inherits are detected and signal errors.
The forms inside confs are called xconfs. They must begin with an identifying symbol, and then are optionally followed by arguments. The xconfs in the example confs from the previous section each had one mandatory argument, like this:
(name "value")
But here is an xconf with no mandatory arguments and one optional argument:
(name :arg "value")
Xconfs superficially resemble Common Lisp destructuring but are in fact very different. For instance, the same argument can be given multiple values in a single xconf:
(name :arg "value1" :arg "value2")
Depending on the type of xconf, Antiweb may use only "value1" or it may use both "value1" and "value2".
The presence of the :boolean-arg keyword in the above examples turns on some functionality. In this respect, xconfs are closer to unix shell arguments than Common Lisp destructuring.
Confs and xconfs are designed to be intuitive and extremely flexible. The src/conf.lisp file has more details on how and why confs and xconfs work.
Antiweb's installation procedure adds three (3) files to your filesystem. Their paths can be changed by editing build.lisp before compiling Antiweb. By default they are:
/usr/bin/antiweb - The perl launch script. All Antiweb processes are launched through this script interface.
/usr/lib/libantiweb32.so or /usr/lib/libantiweb64.so - The Antiweb shared library. Most of the code for accessing the network and filesystem is compiled and stored here. The name depends on your architecture.
/usr/lib/antiweb.cmu.image or /usr/lib/antiweb.clisp.image or /usr/lib/antiweb.ccl.image - A frozen image of the memory of an Antiweb lisp process. The name depends on your lisp environment.
You also need to create a hub directory. Inside this directory (typically /var/aw/):
hub.conf - Hub configuration. Includes which interaces/ports to listen for connections on (though you can add more later without restarting), the user or UID the hub and logger processes should run as, and the file descriptor limit for the hub process.
hub.socket - Unix domain socket for connecting to the hub. It is owned by root and no other user can connect. All Antiweb administration, development, and inter-process communication is done through this socket.
empty/ - An empty directory. The hub process is chroot()ed to this directory. It should have no write permission to this directory.
aw_log/ - The log directory. The logger process is chroot()ed to this directory. This directory name starts with the "aw_" prefix because that is a special prefix and such directories will never be served by Antiweb through HTTP in case of an incorrectly configured HTML root. This convention dates back to Antiweb2. In any case, both of Antiweb's log files are owned and only readable by the logger user. The two log files are:
syslog - System log messages. Always check this file first if something isn't working.
axslog - Access logs. All valid HTTP requests are recorded here.
Workers pass log messages to the hub after which they are passed to the logger process. There are two ways to make the logger reopen its log files.
There is one worker.conf file per worker process. These files can live anywhere but a good place is in the /var/aw/ hub directory. They should not be owned (or writeable) by any user that a worker or hub runs as.
Antiweb Tip Although all data is internally stored as (and enforced to be) UTF-8, you can map static files to different charsets with the :mime-type parameter of the worker conf. Also, in CGIs you can send any mime-type you want.
Antiweb4 supports exactly one type of character data:
UTF-8 encoded unicode code points.
All filenames must be UTF-8. The HTML content in Anti Webpages is always UTF-8. Here are some technologies NOT supported:
ASCII
Latin-1
UTF-16
etc...
The plan is to store user data in Normalization Form C (but this is not implemented yet).
We love Perl. Anti Webpages are an attempt to bring the Perl spirit to the modern web and to make this style of programming extremely efficient. Anti Webpages are not idealist, they are pragmatic. The manual you are reading now is an Anti Webpage.
Anti Webpages: When you just gotta git 'er done dammit.
If you want to write straight HTML or Javascript or CSS, go ahead and do it. Anti Webpages don't judge, they glue.
If you can't solve it with a regular expression, you aren't trying hard enough.
There's Even More Ways To Do It Than In Perl (TEMWTDITIP).
It doesn't matter how deep you go. There's no bottom.
Why duct-tape when you can super-glue?
See the Anti Webpages section of the manual for more details.