Help, I need a working boa.conf file

Madison Kelly linux-5ZoueyuiTZhBDgjK7y7TUQ at public.gmane.org
Thu Jun 8 02:03:19 UTC 2006


Walter Dnes wrote:
>   This *SHOULD* be simple, but the manpage is rather sparse, and it also
> seems to assume that I'm intimately familiar with NCSA-httpd, whose
> directives boa.conf is modelled after.  After a couple of fruitless days
> of banging head against brick wall, I'm swallowing my pride, and asking
> for a working config.  I need...
> 
>   a) a working boa.conf file
> 
>   b) where do I put it
> 
>   c) what commandline ("-c" and/or "-r") parameters to pass to the
> invocation of boa.
> 
>   I want to run boa on port 1024, and serve out /usr/portage/distfiles/
> to another machine at home (*PLEASE* don't bother with httpd-replicator
> as there are other issues).  Here's what I have so far...
> 
> Port 1024
> Listen 192.168.123.252
> User nobody
> Group nogroup
> DocumentRoot /usr/portage/distfiles
> MimeTypes /dev/null
> DirectoryMaker /usr/lib/boa/boa_indexer
> 
>   The client machine does connect to the server on port 1024, but gets a
> 404 error for the file it's trying to download.  I've manually confirmed
> that the requested file exists.  I temporarily disconnected the ADSL
> modem from the LAN, and shut down iptables, to remove the possibility of
> blockage there.
> 

Sorry for not cleaning out the clutter, but I just finished a 17 hour 
day... This is my (relevant) stuff for TLE-BU which uses a very slightly 
modified Boa web server. You should be able to dig out the relevant 
stuff but if not ask me and I will give you a cleaner version tomorrow 
or Friday.

I added a bunch of comments in the 'tb_httpd.conf' (boa.conf) file which 
should help (I hope).

Madison

Files:

My init.d script which starts/stops Boa (called tb_httpd in my program):

-= TLE-BU (Boa + (TLE-BU daemon <- ignore)) start script =-
#!/bin/sh
#
#               Written by Miquel van Smoorenburg <miquels-+QrN+Ec1w2rz+pZb47iToQ at public.gmane.org>.
#               Modified for Debian GNU/Linux
#               by Ian Murdock <imurdock-uOfJb789lUI8qNwGfFDJ/Q at public.gmane.org>.
#               Modified for boa by Bill Allombert <ballombe-8fiUuRrzOP0dnm+yROfE0A at public.gmane.org>.
#
# Modified by Madison Kelly (digimer-agcygxvf9jodnm+yROfE0A at public.gmane.org) for use in TLE-BU
#

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
SERVER=/usr/share/tle-bu/httpd/tb_httpd
DAEMON=/usr/share/tle-bu/cgi-bin/tbd
D_PID=/usr/share/tle-bu/cgi-bin/tmp/tbd.pid
NAME=tb_httpd
DESC="TLE-BU"

test -x $SERVER || exit 0
test -x $DAEMON || exit 0

set -e

case "$1" in
   start)
         echo -n "Starting $DESC:"
         start-stop-daemon --start --quiet --exec $SERVER -- -f 
/etc/tb_httpd.conf -c /usr/share/tle-bu/httpd/
         echo -n " webserver,"
         start-stop-daemon --start --quiet --exec $DAEMON
         echo -n " daemon,"
         echo " done."
         ;;
   stop)
         echo -n "Stopping $DESC:"
         start-stop-daemon --stop --quiet --oknodo --exec $SERVER
         echo -n " webserver,"
         start-stop-daemon --stop --quiet --oknodo -p $D_PID
         echo -n " daemon,"
         echo " done."
         ;;
   restart)
         $0 stop
         sleep 1
         $0 start
         ;;
   *)
         N=/etc/init.d/$NAME
         echo "Usage: $N {start|stop|restart}" >&2
         exit 1
         ;;
esac

exit 0
-= TLE-BU (Boa + (TLE-BU daemon <- ignore)) start script =-


-= /etc/tb_httpd.conf (change to 'boa.conf' if you wish) =-
#
# This is the configuration file for the internal webserver used by 
'TLE-BU'.
# It must be in the '/etc' directory and it must be readable by the user 
defined
# in this file. This is a modified version of the 'Boa' web server. The 
rest of
# this config file is a near-exact copy of the default 'boa.conf' file 
save for
# the values used.
#
# Boa v0.94 configuration file
# Modified for TLE-BU, probably no longer compatible with normal Boa 
installs.
#
# The Boa configuration file is parsed with a custom parser.  If it
# reports an error, the line number will be provided; it should be easy
# to spot.  The syntax of each of these rules is very simple, and they
# can occur in any order.  Where possible these directives mimic those
# of NCSA httpd 1.3; I saw no reason to introduce gratuitous
# differences.

# $Id: tb_httpd.conf,v 1.3.2.6 2003/02/02 05:02:22 jnelson Exp $
# Port: The port Boa runs on.  The default port for http servers is 80.
# If it is less than 1024, the server must be started as root.
#Port 853
Port 853

# Listen: the Internet address to bind(2) to.  If you leave it out,
# it takes the behavior before 0.93.17.2, which is to bind to all
# addresses (INADDR_ANY).  You only get one "Listen" directive,
# if you want service on multiple IP addresses, you have three choices:
#    1. Run boa without a "Listen" directive
#       a. All addresses are treated the same; makes sense if the addresses
#          are localhost, ppp, and eth0.
#       b. Use the VirtualHost directive below to point requests to 
different
#          files.  Should be good for a very large number of addresses (web
#          hosting clients).
#    2. Run one copy of boa per IP address, each has its own configuration
#       with a "Listen" directive.  No big deal up to a few tens of 
addresses.
#       Nice separation between clients.
# The name you provide gets run through inet_aton(3), so you have to use 
dotted
# quad notation.  This configuration is too important to trust some DNS.
#Listen 127.0.0.1
Listen 127.0.0.1

#  User: The name or UID the server should run as.
# Group: The group name or GID the server should run as.
#User tle-bu
#Group tle-bu
User tle-bu
Group tle-bu

# ServerAdmin: The email address where server problems should be sent.
# Note: this is not currently used, except as an environment variable
# for CGIs.
#ServerAdmin root at localhost
ServerAdmin root at localhost

# ErrorLog: The location of the error log file. If this does not start
# with /, it is considered relative to the server root.
# Set to /dev/null if you don't want errors logged.
# If unset, defaults to /dev/stderr
# Please NOTE: Sending the logs to a pipe ('|'), as shown below,
#  is somewhat experimental and might fail under heavy load.
# "Usual libc implementations of printf will stall the whole
#  process if the receiving end of a pipe stops reading."
#ErrorLog "|/usr/sbin/cronolog --symlink=/var/log/boa/error_log 
/var/log/boa/error-%Y%m%d.log"
#ErrorLog /usr/share/tle-bu/cgi-bin/logs/tb_httpd-error.log
ErrorLog /usr/share/tle-bu/cgi-bin/logs/tb_httpd-error.log

# AccessLog: The location of the access log file. If this does not
# start with /, it is considered relative to the server root.
# Comment out or set to /dev/null (less effective) to disable.
# Useful to set to /dev/stdout for use with daemontools.
# Access logging.
# Please NOTE: Sending the logs to a pipe ('|'), as shown below,
#  is somewhat experimental and might fail under heavy load.
# "Usual libc implementations of printf will stall the whole
#  process if the receiving end of a pipe stops reading."
#AccessLog  "|/usr/sbin/cronolog --symlink=/var/log/boa/access_log 
/var/log/boa/access-%Y%m%d.log"
#AccessLog /usr/share/tle-bu/cgi-bin/logs/tb_httpd-access.log
AccessLog /usr/share/tle-bu/cgi-bin/logs/tb_httpd-access.log

# CGILog: The location of the CGI stderr log file. If this does not
# start with /, it is considered relative to the server root.
# The log file would contain any contents send to /dev/stderr
# by the CGI. If this is commented out, it defaults to whatever
# ErrorLog points.  Set to /dev/null to disable CGI stderr logging.
# Please NOTE: Sending the logs to a pipe ('|'), as shown below,
#  is somewhat experimental and might fail under heavy load.
# "Usual libc implementations of printf will stall the whole
#  process if the receiving end of a pipe stops reading."
#CGILog  "|/usr/sbin/cronolog --symlink=/var/log/boa/cgi_log 
/var/log/boa/cgi-%Y%m%d.log"
#CGILog /usr/share/tle-bu/cgi-bin/logs/tb_httpd-cgi.log
CGILog /usr/share/tle-bu/cgi-bin/logs/tb_httpd-cgi.log

# UseLocaltime: Logical switch.  Uncomment to use localtime
# instead of UTC time
UseLocaltime

# ServerName: the name of this server that should be sent back to
# clients if different than that returned by gethostname + gethostbyname
#ServerName www.domain.com

# ScriptAlias: Maps a virtual path to a directory for serving scripts
# Example: ScriptAlias /htbin/ /www/htbin/
#ScriptAlias /cgi-bin/ /usr/share/tle-bu/cgi-bin/
ScriptAlias /cgi-bin/ /usr/share/tle-bu/cgi-bin/

# DocumentRoot: The root directory of the HTML documents.
# Comment out to disable server non user files.
#DocumentRoot /usr/share/tle-bu/non-cgi
DocumentRoot /usr/share/tle-bu/non-cgi

# DirectoryIndex: Name of the file to use as a pre-written HTML
# directory index.  Please MAKE AND USE THESE FILES.  On the
# fly creation of directory indexes can be _slow_.
# Comment out to always use DirectoryMaker
#DirectoryIndex index.html
DirectoryIndex index.html

# KeepAliveMax: Number of KeepAlive requests to allow per connection
# Comment out, or set to 0 to disable keepalive processing

#KeepAliveMax 1000
KeepAliveMax 1000

# KeepAliveTimeout: seconds to wait before keepalive connection times out
#KeepAliveTimeout 1200
KeepAliveTimeout 1200

# MimeTypes: This is the file that is used to generate mime type pairs
# and Content-Type fields for boa.
# Set to /dev/null if you do not want to load a mime types file.
# Do *not* comment out (better use AddType!)
#MimeTypes /etc/mime.types
MimeTypes /etc/mime.types

# DefaultType: MIME type used if the file extension is unknown, or there
# is no file extension.
#DefaultType text/plain
DefaultType text/plain

# CGIPath: The value of the $PATH environment variable given to CGI progs.
#CGIPath /bin:/usr/bin:/usr/local/bin
CGIPath /bin:/usr/bin:/usr/local/bin
-= /etc/tb_httpd.conf (change to 'boa.conf' if you wish) =-


Compile call (note that '$install_dir/httpd' is where the boa binary 
goes, change to suit your needs). I move the 'boa' binary to another 
directory to a new name 'tb_httpd'. Update anything above to reflect the 
name you use ('boa', I assume).

./configure --prefix=$install_dir/httpd --exec-prefix=$install_dir/httpd
make
mv src/boa $install_dir/httpd/tb_httpd


HTH!
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list