ports/58290: [new port] www/monkey: A lightweight web server.
Clement Laforet
sheepkiller at cultdeadsheep.org
Mon Oct 20 18:20:21 UTC 2003
>Number: 58290
>Category: ports
>Synopsis: [new port] www/monkey: A lightweight web server.
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Mon Oct 20 11:20:13 PDT 2003
>Closed-Date:
>Last-Modified:
>Originator: Clement Laforet
>Release: FreeBSD 5.1-CURRENT i386
>Organization:
cotds.org
>Environment:
System: FreeBSD lucifer.cultdeadsheep.org 5.1-CURRENT FreeBSD 5.1-CURRENT #0: Mon Sep 22 08:20:10 CEST 2003 clement at lucifer.cultdeadsheep.org:/usr/obj/usr/src/sys/LUCIFER i386
>Description:
Monkey HTTP Daemon is a small, powerful, and fast Web server written in C. Its
features include language support, GET, POST, and HEAD methods, CGI, PHP4 , a
config file (optional for every user), a mime.types file, virtual hosts, the
ability to deny URLs and IPs, to run as a different user (such as nobody),
serve users home directories, resume, and more.
WWW: http://monkeyd.sourceforge.net/
>How-To-Repeat:
N/A.
>Fix:
--- monkey.shar begins here ---
# This is a shell archive. Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file". Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
# monkey
# monkey/files
# monkey/files/patch-users.c
# monkey/files/patch-configure
# monkey/files/patch-lang::en::mconf
# monkey/files/monkey.sh
# monkey/distinfo
# monkey/pkg-plist
# monkey/pkg-descr
# monkey/Makefile
#
echo c - monkey
mkdir -p monkey > /dev/null 2>&1
echo c - monkey/files
mkdir -p monkey/files > /dev/null 2>&1
echo x - monkey/files/patch-users.c
sed 's/^X//' >monkey/files/patch-users.c << 'END-of-monkey/files/patch-users.c'
X--- src/user.c.orig Sat Oct 18 22:21:54 2003
X+++ src/user.c Mon Oct 20 17:26:55 2003
X@@ -23,6 +23,7 @@
X #include <pwd.h>
X #include <sys/types.h>
X #include <unistd.h>
X+#include <sys/time.h>
X #include <sys/resource.h>
X
X #include "monkey.h"
X@@ -79,7 +80,7 @@
X /* Just if i'm superuser */
X rl.rlim_max= (256 * config->maxclients);
X rl.rlim_cur = rl.rlim_max;
X- setrlimit( RLIMIT_OFILE, &rl );
X+ setrlimit( RLIMIT_NOFILE, &rl );
X
X /* Chequear si existe el usuario USER ... */
X if ((usr = getpwnam( config->user )) == NULL) {
END-of-monkey/files/patch-users.c
echo x - monkey/files/patch-configure
sed 's/^X//' >monkey/files/patch-configure << 'END-of-monkey/files/patch-configure'
X--- configure.orig Sat Oct 18 22:21:54 2003
X+++ configure Mon Oct 20 19:42:20 2003
X@@ -221,15 +221,7 @@
X # Monkey HTTP Daemon: Makefile
X # ============================
X default:
X- @(cd src; make all)
X- @echo
X- @echo " Running Monkey :"
X- @echo " ----------------"
X- @echo
X- @echo " # $bindir/monkey"
X- @echo
X- @echo " For more help use '-h' option."
X- @echo
X+ @(cd src; ${MAKE} all)
X clean:
X @(cd src; make clean)
X distclean:
X@@ -250,14 +242,14 @@
X LOGDIR=${logdir}
X
X default:
X- @(cd src; make all)
X+ @(cd src; ${MAKE} all)
X clean:
X @(cd src; make clean)
X distclean:
X @(cd src; make distclean)
X
X install:
X- make -C src all
X+ ${MAKE} -C src all
X install -d \$(BINDIR)
X install -d \$(CGIBIN)
X install -d \$(SYSCONFDIR)
X@@ -269,20 +261,16 @@
X install -s -m 755 bin/monkey \$(BINDIR)
X install -m 755 bin/banana \$(BINDIR)
X install -m 755 ./cgi-bin/* \$(CGIBIN)
X- install -m 600 ./conf/*.* \$(SYSCONFDIR)
X+ @(for f in mime.types modules.conf monkey.conf monkey.deny ; \
X+ do install -m 600 ./conf/\$\${f} \$(SYSCONFDIR)/\$\${f}-dist ;\
X+ if [ ! -e \$(SYSCONFDIR)/\$\${f} ]; then \
X+ install -m 600 ./conf/\$\${f} \$(SYSCONFDIR); \
X+ fi;\
X+ done)
X install -m 644 ./htdocs/*.* \$(DATADIR)
X install -m 644 ./htdocs/imgs/*.* \${DATADIR}/imgs
X install -m 644 ./htdocs/php/*.* \${DATADIR}/php
X install -m 644 ./htdocs/docs/*.* \${DATADIR}/docs
X- @echo
X- @echo " Running Monkey :"
X- @echo " ----------------"
X- @echo
X- @echo " # $bindir/monkey"
X- @echo
X- @echo " For more help use '-h' option"
X- @echo
X-
X EOF
X }
X
X@@ -304,11 +292,11 @@
X cat > src/Makefile<<EOF
X CC = $CC
X DEFS = $mod_defs
X-CFLAGS = \$(DEFS) -g -O2 -Wall
X+CFLAGS = \$(DEFS) ${EXTRA_CFLAGS}
X INCDIR = ./include
X LDFLAGS =
X DESTDIR = ../bin/monkey
X-LIBS = -lpthread $mod_libs $MORE_LIBS
X+LIBS = $mod_libs $MORE_LIBS ${PTHREAD_LIBS}
X OBJ = monkey.o method.o mimetype.o request.o \\
X vhost.o config.o logfile.o signals.o \\
X dir_html.o deny.o cgi.o user.o utils.o \\
END-of-monkey/files/patch-configure
echo x - monkey/files/patch-lang::en::mconf
sed 's/^X//' >monkey/files/patch-lang::en::mconf << 'END-of-monkey/files/patch-lang::en::mconf'
X--- lang/en/mconf.orig Sat Oct 18 22:21:54 2003
X+++ lang/en/mconf Mon Oct 20 19:55:52 2003
X@@ -24,7 +24,7 @@
X # be able to be established as a connection door if the user posesses
X # privledges of Root.
X
X-Port 2001
X+Port 80
X
X # ServerName :
X # ------------
X@@ -52,19 +52,19 @@
X # --------
X # File where the server guards the process number when starting.
X
X-PidFile $logdir/monkey.pid
X+PidFile /var/run/monkey.pid
X
X # AccessLog:
X # ----------
X # Registration file of correct request.
X
X-AccessLog $logdir/access.log
X+AccessLog $logdir/monkey-access.log
X
X # ErrorLog:
X # ---------
X # Registration file of incorrect request.
X
X-ErrorLog $logdir/error.log
X+ErrorLog $logdir/monkey-error.log
X
X # UserDir:
X # --------
X@@ -120,7 +120,7 @@
X # started by a user that doesn't have root priviledges, this variable will
X # be omitted.
X
X-User nobody
X+User www
X
X # AddScript
X # ------------
X@@ -137,8 +137,8 @@
X # "php", should be processed through by "/home/my_home/php/bin/php"
X #
X
X-#AddScript application/x-httpd-php /home/my_home/php/bin/php php
X-#AddScript application/x-httpd-php /home/my_home/php/bin/php php3
X+#AddScript application/x-httpd-php ${prefix}/bin/php php
X+#AddScript application/x-httpd-php ${prefix}/bin/php php3
X
X # VIRTUAL HOST :
X # --------------
END-of-monkey/files/patch-lang::en::mconf
echo x - monkey/files/monkey.sh
sed 's/^X//' >monkey/files/monkey.sh << 'END-of-monkey/files/monkey.sh'
X#!/bin/sh
X
Xif ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
X echo "$0: Cannot determine the PREFIX" >&2
X exit 1
Xfi
X
Xcase "$1" in
X start)
X if [ -x ${PREFIX}/sbin/monkey ]; then
X ${PREFIX}/sbin/monkey -D
X echo -n ' monkey'
X fi
X ;;
X stop)
X kill `cat /var/run/monkey.pid`
X echo -n ' monkey'
X ;;
X *)
X echo "Usage: `basename $0` {start|stop}" >&2
X ;;
Xesac
END-of-monkey/files/monkey.sh
echo x - monkey/distinfo
sed 's/^X//' >monkey/distinfo << 'END-of-monkey/distinfo'
XMD5 (monkey-0.8.0.tar.gz) = fa0afd215e9189db534b3c9537543c30
END-of-monkey/distinfo
echo x - monkey/pkg-plist
sed 's/^X//' >monkey/pkg-plist << 'END-of-monkey/pkg-plist'
X at unexec if cmp -s %D/etc/monkey/mime.types %D/etc/monkey/mime.types-dist; then rm -f %D/etc/monkey/mime.types; fi
Xetc/monkey/mime.types-dist
X at exec [ -f %B/mime.types ] || cp %B/%f %B/mime.types
X at unexec if cmp -s %D/etc/monkey/modules.conf %D/etc/monkey/modules.conf-dist; then rm -f %D/etc/monkey/modules.conf; fi
Xetc/monkey/modules.conf-dist
X at exec [ -f %B/modules.conf ] || cp %B/%f %B/modules.conf
X at unexec if cmp -s %D/etc/monkey/monkey.conf %D/etc/monkey/monkey.conf-dist; then rm -f %D/etc/monkey/monkey.conf; fi
Xetc/monkey/monkey.conf-dist
X at exec [ -f %B/monkey.conf ] || cp %B/%f %B/monkey.conf
X at unexec if cmp -s %D/etc/monkey/monkey.deny %D/etc/monkey/monkey.deny-dist; then rm -f %D/etc/monkey/monkey.deny; fi
Xetc/monkey/monkey.deny-dist
X at exec [ -f %B/monkey.deny ] || cp %B/%f %B/monkey.deny
Xetc/rc.d/monkey.sh.sample
Xsbin/monkey
Xsbin/banana
Xwww/cgi-bin/test.pl
Xwww/data/imgs/logonooficial.jpg
Xwww/data/imgs/titulo.jpg
Xwww/data/php/index.php
Xwww/data/docs/monkey+php.en.html
Xwww/data/docs/monkey+php.es.html
Xwww/data/docs/monkey+php.ru.html
Xwww/data/docs/monkey+php.sv.html
Xwww/data/index.html
X at dirrm etc/monkey
X at dirrm www/cgi-bin
X at dirrm www/data/docs
X at dirrm www/data/imgs
X at dirrm www/data/php
X at dirrm www/data
X at dirrm www/
END-of-monkey/pkg-plist
echo x - monkey/pkg-descr
sed 's/^X//' >monkey/pkg-descr << 'END-of-monkey/pkg-descr'
XMonkey HTTP Daemon is a small, powerful, and fast Web server written in C. Its
Xfeatures include language support, GET, POST, and HEAD methods, CGI, PHP4 , a
Xconfig file (optional for every user), a mime.types file, virtual hosts, the
Xability to deny URLs and IPs, to run as a different user (such as nobody),
Xserve users home directories, resume, and more.
X
XWWW: http://monkeyd.sourceforge.net/
END-of-monkey/pkg-descr
echo x - monkey/Makefile
sed 's/^X//' >monkey/Makefile << 'END-of-monkey/Makefile'
X# New ports collection makefile for: monkey
X# Date created: Mon Oct 20
X# Whom: Clement Laforet <sheepkiller at cultdeadsheep.org>
X#
X# $FreeBSD$
X#
X
XPORTNAME= monkey
XPORTVERSION= 0.8.0
XCATEGORIES= www
XMASTER_SITES= http://monkeyd.sf.net/versions/
X
XMAINTAINER= sheepkiller at cultdeadsheep.org
XCOMMENT= A small, powerful, and fast Web server written in C
X
XLIB_DEPENDS= execinfo.1:${PORTSDIR}/devel/libexecinfo
X
X# Orignal FETCH_CMD arguments (-ARr) make fetching fail.
XFETCH_CMD?= /usr/bin/fetch -Rr
XUSE_GMAKE= YES
XALL_TARGET= default
XHAS_CONFIGURE= YES
XCONFIGURE_ARGS= --prefix=${PREFIX} \
X --bindir=${PREFIX}/sbin \
X --cgibin=${PREFIX}/www/cgi-bin \
X --sysconfdir=${PREFIX}/etc/monkey \
X --datadir=${PREFIX}/www/data \
X --logdir=/var/log \
X --lang=en
X
XCONFIGURE_ENV+= EXTRA_CFLAGS="${CFLAGS}" PTHREAD_LIBS="${PTHREAD_LIBS}"
X
XCFLAGS+= ${PTHREAD_CFLAGS} -I${LOCALBASE}/include
XLDFLAGS+= -L${LOCALBASE}/lib
X
Xpost-install:
X @${INSTALL_SCRIPT} ${FILESDIR}/monkey.sh ${PREFIX}/etc/rc.d/monkey.sh.sample
X
X.include <bsd.port.mk>
END-of-monkey/Makefile
exit
--- monkey.shar ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list