summaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
authorPav Lucistnik <pav@FreeBSD.org>2003-12-05 20:48:42 +0000
committerPav Lucistnik <pav@FreeBSD.org>2003-12-05 20:48:42 +0000
commit56ff16ada7d196d2194dbbff22eabbfb28df6677 (patch)
treed5f8881aba87b8a22d0324dd09a26ced030be488 /www
parentUpdate to 2.8.3. (diff)
Add Monkey HTTP Daemon, a small, powerful, and fast Web server written in C.
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. PR: ports/58290 Submitted by: Clement Laforet <sheepkiller@cultdeadsheep.org>
Notes
Notes: svn path=/head/; revision=95154
Diffstat (limited to 'www')
-rw-r--r--www/Makefile1
-rw-r--r--www/monkey/Makefile37
-rw-r--r--www/monkey/distinfo1
-rw-r--r--www/monkey/files/monkey.sh22
-rw-r--r--www/monkey/files/patch-configure77
-rw-r--r--www/monkey/files/patch-lang::en::mconf54
-rw-r--r--www/monkey/files/patch-users.c19
-rw-r--r--www/monkey/pkg-descr7
-rw-r--r--www/monkey/pkg-plist31
9 files changed, 249 insertions, 0 deletions
diff --git a/www/Makefile b/www/Makefile
index c9b405f84a92..e9797980ca9a 100644
--- a/www/Makefile
+++ b/www/Makefile
@@ -264,6 +264,7 @@
SUBDIR += mod_zap
SUBDIR += moinmoin
SUBDIR += momspider
+ SUBDIR += monkey
SUBDIR += mozilla
SUBDIR += mozilla-bonobo
SUBDIR += mozilla-devel
diff --git a/www/monkey/Makefile b/www/monkey/Makefile
new file mode 100644
index 000000000000..f627c197dca9
--- /dev/null
+++ b/www/monkey/Makefile
@@ -0,0 +1,37 @@
+# New ports collection makefile for: monkey
+# Date created: Mon Oct 20 2003
+# Whom: Clement Laforet <sheepkiller@cultdeadsheep.org>
+#
+# $FreeBSD$
+#
+
+PORTNAME= monkey
+PORTVERSION= 0.8.0
+CATEGORIES= www
+MASTER_SITES= http://monkeyd.sourceforge.net/versions/
+
+MAINTAINER= sheepkiller@cultdeadsheep.org
+COMMENT= A small, powerful, and fast Web server written in C
+
+LIB_DEPENDS= execinfo.1:${PORTSDIR}/devel/libexecinfo
+
+USE_GMAKE= yes
+ALL_TARGET= default
+HAS_CONFIGURE= yes
+CONFIGURE_ARGS= --prefix=${PREFIX} \
+ --bindir=${PREFIX}/sbin \
+ --cgibin=${PREFIX}/www/cgi-bin \
+ --sysconfdir=${PREFIX}/etc/monkey \
+ --datadir=${PREFIX}/www/data \
+ --logdir=/var/log \
+ --lang=en
+
+CONFIGURE_ENV+= EXTRA_CFLAGS="${CFLAGS}" PTHREAD_LIBS="${PTHREAD_LIBS}"
+
+CFLAGS+= ${PTHREAD_CFLAGS} -I${LOCALBASE}/include
+LDFLAGS+= -L${LOCALBASE}/lib
+
+post-install:
+ @${INSTALL_SCRIPT} ${FILESDIR}/monkey.sh ${PREFIX}/etc/rc.d/monkey.sh.sample
+
+.include <bsd.port.mk>
diff --git a/www/monkey/distinfo b/www/monkey/distinfo
new file mode 100644
index 000000000000..9fc3f5f71e74
--- /dev/null
+++ b/www/monkey/distinfo
@@ -0,0 +1 @@
+MD5 (monkey-0.8.0.tar.gz) = fa0afd215e9189db534b3c9537543c30
diff --git a/www/monkey/files/monkey.sh b/www/monkey/files/monkey.sh
new file mode 100644
index 000000000000..545e8f81cba2
--- /dev/null
+++ b/www/monkey/files/monkey.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
+ echo "$0: Cannot determine the PREFIX" >&2
+ exit 1
+fi
+
+case "$1" in
+ start)
+ if [ -x ${PREFIX}/sbin/monkey ]; then
+ ${PREFIX}/sbin/monkey -D
+ echo -n ' monkey'
+ fi
+ ;;
+ stop)
+ kill `cat /var/run/monkey.pid`
+ echo -n ' monkey'
+ ;;
+ *)
+ echo "Usage: `basename $0` {start|stop}" >&2
+ ;;
+esac
diff --git a/www/monkey/files/patch-configure b/www/monkey/files/patch-configure
new file mode 100644
index 000000000000..78af5f0460d8
--- /dev/null
+++ b/www/monkey/files/patch-configure
@@ -0,0 +1,77 @@
+--- configure.orig Sat Oct 18 22:21:54 2003
++++ configure Mon Oct 20 19:42:20 2003
+@@ -221,15 +221,7 @@
+ # Monkey HTTP Daemon: Makefile
+ # ============================
+ default:
+- @(cd src; make all)
+- @echo
+- @echo " Running Monkey :"
+- @echo " ----------------"
+- @echo
+- @echo " # $bindir/monkey"
+- @echo
+- @echo " For more help use '-h' option."
+- @echo
++ @(cd src; ${MAKE} all)
+ clean:
+ @(cd src; make clean)
+ distclean:
+@@ -250,14 +242,14 @@
+ LOGDIR=${logdir}
+
+ default:
+- @(cd src; make all)
++ @(cd src; ${MAKE} all)
+ clean:
+ @(cd src; make clean)
+ distclean:
+ @(cd src; make distclean)
+
+ install:
+- make -C src all
++ ${MAKE} -C src all
+ install -d \$(BINDIR)
+ install -d \$(CGIBIN)
+ install -d \$(SYSCONFDIR)
+@@ -269,20 +261,16 @@
+ install -s -m 755 bin/monkey \$(BINDIR)
+ install -m 755 bin/banana \$(BINDIR)
+ install -m 755 ./cgi-bin/* \$(CGIBIN)
+- install -m 600 ./conf/*.* \$(SYSCONFDIR)
++ @(for f in mime.types modules.conf monkey.conf monkey.deny ; \
++ do install -m 600 ./conf/\$\${f} \$(SYSCONFDIR)/\$\${f}-dist ;\
++ if [ ! -e \$(SYSCONFDIR)/\$\${f} ]; then \
++ install -m 600 ./conf/\$\${f} \$(SYSCONFDIR); \
++ fi;\
++ done)
+ install -m 644 ./htdocs/*.* \$(DATADIR)
+ install -m 644 ./htdocs/imgs/*.* \${DATADIR}/imgs
+ install -m 644 ./htdocs/php/*.* \${DATADIR}/php
+ install -m 644 ./htdocs/docs/*.* \${DATADIR}/docs
+- @echo
+- @echo " Running Monkey :"
+- @echo " ----------------"
+- @echo
+- @echo " # $bindir/monkey"
+- @echo
+- @echo " For more help use '-h' option"
+- @echo
+-
+ EOF
+ }
+
+@@ -304,11 +292,11 @@
+ cat > src/Makefile<<EOF
+ CC = $CC
+ DEFS = $mod_defs
+-CFLAGS = \$(DEFS) -g -O2 -Wall
++CFLAGS = \$(DEFS) ${EXTRA_CFLAGS}
+ INCDIR = ./include
+ LDFLAGS =
+ DESTDIR = ../bin/monkey
+-LIBS = -lpthread $mod_libs $MORE_LIBS
++LIBS = $mod_libs $MORE_LIBS ${PTHREAD_LIBS}
+ OBJ = monkey.o method.o mimetype.o request.o \\
+ vhost.o config.o logfile.o signals.o \\
+ dir_html.o deny.o cgi.o user.o utils.o \\
diff --git a/www/monkey/files/patch-lang::en::mconf b/www/monkey/files/patch-lang::en::mconf
new file mode 100644
index 000000000000..cf051e1c7c12
--- /dev/null
+++ b/www/monkey/files/patch-lang::en::mconf
@@ -0,0 +1,54 @@
+--- lang/en/mconf.orig Sat Oct 18 22:21:54 2003
++++ lang/en/mconf Mon Oct 20 19:55:52 2003
+@@ -24,7 +24,7 @@
+ # be able to be established as a connection door if the user posesses
+ # privledges of Root.
+
+-Port 2001
++Port 80
+
+ # ServerName :
+ # ------------
+@@ -52,19 +52,19 @@
+ # --------
+ # File where the server guards the process number when starting.
+
+-PidFile $logdir/monkey.pid
++PidFile /var/run/monkey.pid
+
+ # AccessLog:
+ # ----------
+ # Registration file of correct request.
+
+-AccessLog $logdir/access.log
++AccessLog $logdir/monkey-access.log
+
+ # ErrorLog:
+ # ---------
+ # Registration file of incorrect request.
+
+-ErrorLog $logdir/error.log
++ErrorLog $logdir/monkey-error.log
+
+ # UserDir:
+ # --------
+@@ -120,7 +120,7 @@
+ # started by a user that doesn't have root priviledges, this variable will
+ # be omitted.
+
+-User nobody
++User www
+
+ # AddScript
+ # ------------
+@@ -137,8 +137,8 @@
+ # "php", should be processed through by "/home/my_home/php/bin/php"
+ #
+
+-#AddScript application/x-httpd-php /home/my_home/php/bin/php php
+-#AddScript application/x-httpd-php /home/my_home/php/bin/php php3
++#AddScript application/x-httpd-php ${prefix}/bin/php php
++#AddScript application/x-httpd-php ${prefix}/bin/php php3
+
+ # VIRTUAL HOST :
+ # --------------
diff --git a/www/monkey/files/patch-users.c b/www/monkey/files/patch-users.c
new file mode 100644
index 000000000000..ef6f5a04fa61
--- /dev/null
+++ b/www/monkey/files/patch-users.c
@@ -0,0 +1,19 @@
+--- src/user.c.orig Sat Oct 18 22:21:54 2003
++++ src/user.c Mon Oct 20 17:26:55 2003
+@@ -23,6 +23,7 @@
+ #include <pwd.h>
+ #include <sys/types.h>
+ #include <unistd.h>
++#include <sys/time.h>
+ #include <sys/resource.h>
+
+ #include "monkey.h"
+@@ -79,7 +80,7 @@
+ /* Just if i'm superuser */
+ rl.rlim_max= (256 * config->maxclients);
+ rl.rlim_cur = rl.rlim_max;
+- setrlimit( RLIMIT_OFILE, &rl );
++ setrlimit( RLIMIT_NOFILE, &rl );
+
+ /* Chequear si existe el usuario USER ... */
+ if ((usr = getpwnam( config->user )) == NULL) {
diff --git a/www/monkey/pkg-descr b/www/monkey/pkg-descr
new file mode 100644
index 000000000000..09102a76627d
--- /dev/null
+++ b/www/monkey/pkg-descr
@@ -0,0 +1,7 @@
+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/
diff --git a/www/monkey/pkg-plist b/www/monkey/pkg-plist
new file mode 100644
index 000000000000..08b3ad611bf9
--- /dev/null
+++ b/www/monkey/pkg-plist
@@ -0,0 +1,31 @@
+@unexec if cmp -s %D/etc/monkey/mime.types %D/etc/monkey/mime.types-dist; then rm -f %D/etc/monkey/mime.types; fi
+etc/monkey/mime.types-dist
+@exec [ -f %B/mime.types ] || cp %B/%f %B/mime.types
+@unexec if cmp -s %D/etc/monkey/modules.conf %D/etc/monkey/modules.conf-dist; then rm -f %D/etc/monkey/modules.conf; fi
+etc/monkey/modules.conf-dist
+@exec [ -f %B/modules.conf ] || cp %B/%f %B/modules.conf
+@unexec if cmp -s %D/etc/monkey/monkey.conf %D/etc/monkey/monkey.conf-dist; then rm -f %D/etc/monkey/monkey.conf; fi
+etc/monkey/monkey.conf-dist
+@exec [ -f %B/monkey.conf ] || cp %B/%f %B/monkey.conf
+@unexec if cmp -s %D/etc/monkey/monkey.deny %D/etc/monkey/monkey.deny-dist; then rm -f %D/etc/monkey/monkey.deny; fi
+etc/monkey/monkey.deny-dist
+@exec [ -f %B/monkey.deny ] || cp %B/%f %B/monkey.deny
+etc/rc.d/monkey.sh.sample
+sbin/monkey
+sbin/banana
+www/cgi-bin/test.pl
+www/data/imgs/logonooficial.jpg
+www/data/imgs/titulo.jpg
+www/data/php/index.php
+www/data/docs/monkey+php.en.html
+www/data/docs/monkey+php.es.html
+www/data/docs/monkey+php.ru.html
+www/data/docs/monkey+php.sv.html
+www/data/index.html
+@dirrm etc/monkey
+@dirrm www/cgi-bin
+@dirrm www/data/docs
+@dirrm www/data/imgs
+@dirrm www/data/php
+@dirrm www/data
+@dirrm www/