plexus [-c config] [-d topdir] [-i | -I sockfd] [-l log] [-p port]
[-P pidfile] [-D diag]
-p port Specify port to open (/etc/service name or number) Without -i or -I plexus will start in daemon mode, [-p port] is only useful in this mode. -d topdir Override default directory (/usr/local/www) -c config Override default config file (server/plexus.conf) -l log Override default log file (log) -P pidfile Override default pid output file (plexus.pid) -D diag Specify diagnosic output file (enable debug) -i Use stdin/stdout (e.g., running under inetd) -I sockfd Use specified socket (mostly for server restarts)
Plexus
contains the main loop that accepts incoming HTTP
connections and forks a process to handle the transaction. The main server
can continue to accept other connections while the child processes the
request in the background. The child vectors though the associative array
%method
, defined in plexus.conf
, to one of the
method routines (e.g., GET is handled by &do_get
).
If started as a normal user, the default port is $http_userport
and is defined in plexus.conf
. It can be changed on the
command line using the -p
option. When started as root, it
will open the standard HTTP port which defaults to
$http_defaultport from plexus.conf
. However, the
port assignment can be overridden either on the command line using the
-p
option or in /etc/services
by adding a line
for the http protocol e.g.: http 80/tcp
. Command
line options always override internal defaults.
Topdir defaults to /usr/local/www
, the
config file defaults to server/plexus.conf
, and the
log file defaults to log
.
Plexus also assumes that perl lives in /usr/bin/perl
.
If this is not the case then it's best if you create a symlink for it.
If you can't do that then you will need to edit a bunch of files. To get
the list run find . -type f -print | xargs grep -l /usr/bin/perl
from the top level Plexus source directory.
local.conf
that affects this file is
locking
, which is set in local.conf
. It should
be set to either flock
or fcntl
; the default is
flock
.
plexus.conf
agree with your local system configuration.
There shouldn't be much need to change
this file unless you are adding new features. The notable exceptions
are $http_chroot, which controls whether or not to
chroot
to the top of the tree; $http_user and
$http_group which define the user and group to switch
to if started as root; and $hostname, which should
contain your fully qualified domain name (it defaults to /bin/hostname).
E.g,: make install DESTDIR=/testing will install everything under /testing.
By default, this installs the server code in
/usr/local/www/server/*
, the bookmark demo in
/usr/local/www/server/bookmark/*
, the walk demo in
/usr/local/www/server/walk/*
, the documentation in
/usr/local/www/server/doc/*
, a few miscellaneous tools in
/usr/local/www/bin/*
, and the bsi-man
utilities
in /usr/local/www/bsdi-man/*
.
After you install the files, test the server from the command line using the following command: /usr/local/www/server/plexus -i -l /dev/tty -D /dev/tty. This will log all information to your tty. You can type your request directly from the keyboard (e.g., GET / HTTP/1.0).
Finally, run plexus in server mode using the following command: /usr/local/www/server/plexus -D /dev/tty &. Once plexus is running, test it using your browser. If you run plexus as root, it opens port 80; if you are running it as a normal user, it opens port 8001.
plexus.conf
).
You may want to look at the tools in bin/*
for doing log file
maintainence. bin/summary
is designed to be run as
the same user as plexus. It summarizes the log files using
bin/usage.byhost
and bin/usage.byurl
into
usage.*
files and appends the log
to
log.summary
. Then it restarts the server using
bin/plexus-restart
. You may archive log.summary
as often as you like (I compress and save them forever).
You will probably want to setup an index.html
file in
$plexus_top because that is what the server will map the root
to (e.g., accessing http://your.server.edu/ will map to index.html).
Basically, just grab someones that you like and put your information in
it. For a simple one you might start with something like
http://www.bsdi.com/.
________________________________________ Tony Sanders