Adding fhttpd version 0.4.2.

A C++-based FTP/HTTP server that supports modules.

PR:		15804
Submitted by:	Will Andrews <andrews@technologist.com>
This commit is contained in:
Steve Price 2000-01-29 07:15:20 +00:00
parent 1693b265c1
commit 02cbdaa95a
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=25231
13 changed files with 336 additions and 0 deletions

View file

@ -36,6 +36,7 @@
SUBDIR += erwn
SUBDIR += evg
SUBDIR += fcgi
SUBDIR += fhttpd
SUBDIR += flashplugin
SUBDIR += fxhtml
SUBDIR += g-gcl

58
www/fhttpd/Makefile Normal file
View file

@ -0,0 +1,58 @@
# New ports collection makefile for: fhttpd
# Version required: 0.4.2
# Date created: 21 Dec 1999
# Whom: Will Andrews <andrews@technologist.com>
#
# $FreeBSD$
#
DISTNAME= fhttpd-0.4.2
CATEGORIES= www
MASTER_SITES= ftp://ftp.fhttpd.org/
MAINTAINER= andrews@technologist.com
LOGFILE= share/fhttpd/fhttpd.log
PLIST_SUB+= LOGFILE=${LOGFILE}
post-extract:
@${CP} ${FILESDIR}/fhttpd.sh ${WRKSRC}
pre-patch:
(cd ${WRKSRC} && ${TAR} xf http-root.tar)
pre-install:
${RM} -rf ${WRKSRC}/http-root/pub/dummy_directory
${PERL} -pi -e "s:/usr/local:${PREFIX}:g" ${WRKSRC}/fhttpd.sh
${PERL} -pi -e "s:%%LOGFILE%%:${PREFIX}/${LOGFILE}:g" ${WRKSRC}/fhttpd.sh
${PERL} -pi -e "s:/usr/local:${PREFIX}:g" ${WRKSRC}/http-root/root-fhttpd.conf
${PERL} -pi -e "s:%%LOGFILE%%:${PREFIX}/${LOGFILE}:g" ${WRKSRC}/http-root/root-fhttpd.conf
do-install:
${MKDIR} ${PREFIX}/etc/rc.d
${INSTALL_SCRIPT} ${WRKSRC}/fhttpd.sh ${PREFIX}/etc/rc.d
.for PROG in fhttpd fhttpd-file fhttpd-log
${INSTALL_PROGRAM} ${WRKSRC}/${PROG} ${PREFIX}/sbin
.endfor
${INSTALL_DATA} ${WRKSRC}/http-root/root-fhttpd.conf ${PREFIX}/etc/fhttpd.conf
${MKDIR} ${PREFIX}/share/fhttpd/bin
${INSTALL_SCRIPT} ${WRKSRC}/http-root/bin/* ${PREFIX}/share/fhttpd/bin
${MKDIR} ${PREFIX}/share/fhttpd/cgi-bin
${INSTALL_SCRIPT} ${WRKSRC}/http-root/cgi-bin/f* ${PREFIX}/share/fhttpd/cgi-bin
${INSTALL_DATA} ${WRKSRC}/http-root/cgi-bin/.index.html ${PREFIX}/share/fhttpd/cgi-bin
${MKDIR} ${PREFIX}/share/fhttpd/incoming
.for DIR in icons private pub
${MKDIR} ${PREFIX}/share/fhttpd/${DIR}
${INSTALL_DATA} ${WRKSRC}/http-root/${DIR}/* ${PREFIX}/share/fhttpd/${DIR}/
.endfor
.for DIR in private pub
${INSTALL_DATA} ${WRKSRC}/http-root/${DIR}/.[fhi]* ${PREFIX}/share/fhttpd/${DIR}/
.endfor
.for FILE in index.html noaccess.html
${INSTALL_DATA} ${WRKSRC}/http-root/${FILE} ${PREFIX}/share/fhttpd/
.endfor
post-install:
${TOUCH} ${PREFIX}/${LOGFILE}
.include <bsd.port.mk>

1
www/fhttpd/distinfo Normal file
View file

@ -0,0 +1 @@
MD5 (fhttpd-0.4.2.tar.gz) = 8e9d614b1211c79b81011d227e652da9

View file

@ -0,0 +1,2 @@
#!/bin/sh
[ -x /usr/local/sbin/fhttpd ] && /usr/local/sbin/fhttpd -c /usr/local/etc/fhttpd.conf -l /usr/local/share/fhttpd/fhttpd.log >/dev/null 2>&1 && echo -n " fhttpd"

18
www/fhttpd/files/patch-aa Normal file
View file

@ -0,0 +1,18 @@
--- pseudopoll.c Mon Feb 9 10:48:42 1998
+++ pseudopoll.c.new Fri Dec 24 00:12:58 1999
@@ -3,7 +3,6 @@
*/
#ifdef PSEUDOPOLL
-#include "pseudopoll.h"
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
@@ -11,6 +10,7 @@
#include <values.h>
#include <sys/types.h>
#include <sys/time.h>
+#include <sys/poll.h>
#ifdef NEED_SELECT_H
#include <sys/select.h>

80
www/fhttpd/files/patch-ab Normal file
View file

@ -0,0 +1,80 @@
--- http-root/root-fhttpd.conf Mon Apr 19 13:31:49 1999
+++ http-root/root-fhttpd.conf.new Fri Dec 24 19:29:00 1999
@@ -5,7 +5,7 @@
# HTTP root directory
#
-HTTPRoot /home/ftp
+HTTPRoot /usr/local/share/fhttpd
# honor Keep-Alive option
#
@@ -44,19 +44,19 @@
# access control
#
AccessRealm system /etc/passwd
-AccessRealm http_users /etc/passwd.http_users
-AccessRights /home/ftp/private* restrict
-AccessRights /home/ftp/private* http_users default
+#AccessRealm http_users /etc/passwd.http_users
+AccessRights /usr/local/share/fhttpd/private* restrict
+#AccessRights /usr/local/share/fhttpd/private* http_users default
# finger redirected to script
#
-PipeOutExec */fingerlocal /home/ftp/bin/finger-nohtml
-AbsPipeOutExec /home/ftp/fingerlocal.html\
- /home/ftp/cgi-bin/finger @localhost
+PipeOutExec */fingerlocal /usr/local/share/fhttpd/bin/finger-nohtml
+#AbsPipeOutExec /home/ftp/fingerlocal.html\
+# /home/ftp/cgi-bin/finger @localhost
# directories with executables
#
-ExecMask /home/ftp/cgi-bin/*
+ExecMask /usr/local/share/fhttpd/cgi-bin/*
# default header and footer
#
@@ -92,8 +92,8 @@
# CD-ROM
#
-AbsDirType /home/ftp/cdrom <DT><IMG_SRC="/icons/cdromicon.gif"\
-_ALIGN=TOP_ALT=""><B>_ _</B>
+#AbsDirType /home/ftp/cdrom <DT><IMG_SRC="/icons/cdromicon.gif"\
+#_ALIGN=TOP_ALT=""><B>_ _</B>
# "folder" icon for directory
#
@@ -287,11 +287,11 @@
# preloaded files
#
-PreLoad - /home/ftp/file_index.html
-PreLoad /icons/folder.gif /home/ftp/icons/folder.gif
-PreLoad /icons/html.gif /home/ftp/icons/html.gif
-PreLoad /icons/text.gif /home/ftp/icons/text.gif
-PreLoad /icons/image.gif /home/ftp/icons/image.gif
+#PreLoad - /home/ftp/file_index.html
+PreLoad /icons/folder.gif /usr/local/share/fhttpd/icons/folder.gif
+PreLoad /icons/html.gif /usr/local/share/fhttpd/icons/html.gif
+PreLoad /icons/text.gif /usr/local/share/fhttpd/icons/text.gif
+PreLoad /icons/image.gif /usr/local/share/fhttpd/icons/image.gif
# applications
#
@@ -305,11 +305,11 @@
# default application
#
Application fhttpd-file - ftp 3000,30 1 * \
-/usr/local/sbin/fhttpd-file -s -u 022 -c /etc/fhttpd.conf
+/usr/local/sbin/fhttpd-file -s -u 022 -c /usr/local/etc/fhttpd.conf
# log aplication
#
LogApplication log - ftp 1 1 - \
-/usr/local/sbin/fhttpd-log -u 022 -c /etc/fhttpd.conf -l /tmp/fhttpd-log.log
+/usr/local/sbin/fhttpd-log -u 022 -c /usr/local/etc/fhttpd.conf -l %%LOGFILE%%
# EOF

36
www/fhttpd/files/patch-ac Normal file
View file

@ -0,0 +1,36 @@
--- Makefile Mon Apr 19 13:38:56 1999
+++ Makefile.new Fri Dec 24 00:14:18 1999
@@ -99,21 +99,21 @@
## for Linux (glibc2/libc 6):
#
-COPTS = -Wall -O3 -felide-constructors -DLS_OPTIONS_IGNORE\
- -DNEED_CRYPT_H -DCMSG_DATA_IS_A_MACRO \
- -DMMAPPAGESIZE=65536 -DSIGARGS="int sig" -DSIGACTARGS="int sig"\
- -D__s32=int\
- -DGLOBAL_TIMEZONE -DGLIBC -DERRNO_DEFINED # -DFLOCK
-LFLAGS= -lcrypt
+#COPTS = -Wall -O3 -felide-constructors -DLS_OPTIONS_IGNORE\
+# -DNEED_CRYPT_H -DCMSG_DATA_IS_A_MACRO \
+# -DMMAPPAGESIZE=65536 -DSIGARGS="int sig" -DSIGACTARGS="int sig"\
+# -D__s32=int\
+# -DGLOBAL_TIMEZONE -DGLIBC -DERRNO_DEFINED # -DFLOCK
+#LFLAGS= -lcrypt
## for FreeBSD 2.2:
#
-#COPTS = -O2 -fno-strength-reduce -DLS_OPTIONS_IGNORE\
-# -D__s32=int -DMMAPPAGESIZE=65536\
-# -DPSEUDOPOLL -DCMSG_DATA_IS_A_MACRO\
-# -DSIGARGS="int sig" -DSIGACTARGS="int sig"\
-# -DTM_GMTOFF_PRESENT -DERRNO_DEFINED # -DFLOCK
-#LFLAGS = -lcrypt
+COPTS = -O2 -fno-strength-reduce -DLS_OPTIONS_IGNORE\
+ -D__s32=int -DMMAPPAGESIZE=65536\
+ -DPSEUDOPOLL -DCMSG_DATA_IS_A_MACRO\
+ -DSIGARGS="int sig" -DSIGACTARGS="int sig"\
+ -DTM_GMTOFF_PRESENT -DERRNO_DEFINED # -DFLOCK
+LFLAGS = -lcrypt
# End of OS-dependent definitions

11
www/fhttpd/files/patch-ad Normal file
View file

@ -0,0 +1,11 @@
--- log.cc.orig Sat Jan 29 00:53:07 2000
+++ log.cc Sat Jan 29 00:54:02 2000
@@ -688,7 +688,7 @@
if(client){
sprintf(tmpstr,"%d",currentconnection->socket->port);
SendLogMessage(client,NULL,NULL,NULL,0,"CLIENT_EXISTS_LOCAL_PORT",tmpstr);
- if(!getsockname(currentconnection->gethandle(),(sockaddr*)&currsock,&currsockaddrlen)){
+ if(!getsockname(currentconnection->gethandle(),(sockaddr*)&currsock,(socklen_t*)&currsockaddrlen)){
SendLogMessage(client,NULL,NULL,NULL,0,"CLIENT_EXISTS_LOCAL_IP",inet_ntoa(currsock.sin_addr));
}
SendLogMessage(client,NULL,NULL,NULL,0,"CLIENT_EXISTS_IP",inet_ntoa(((sockaddr_in*)currentconnection->getaddress())->sin_addr));

20
www/fhttpd/files/patch-ae Normal file
View file

@ -0,0 +1,20 @@
--- sockobj.cc.orig Sat Jan 29 00:54:37 2000
+++ sockobj.cc Sat Jan 29 00:55:34 2000
@@ -645,7 +645,7 @@
global_nconnections++;
if(xsocket->status==0){
hisaddresslength=128;
- h=accept(xsocket->gethandle(),(struct sockaddr*)s,&hisaddresslength);
+ h=accept(xsocket->gethandle(),(struct sockaddr*)s,(socklen_t*)&hisaddresslength);
if(h<0) return;
hisaddress=(struct sockaddr*)malloc(hisaddresslength);
if(hisaddress) memcpy(hisaddress,s,hisaddresslength); else{
@@ -1861,7 +1861,7 @@
if(fdarray[sockets[i]->handleindexforwheel].revents&POLLIN){
fdarray[sockets[i]->handleindexforwheel].revents&=~POLLIN;
hisaddresslength=128;
- h=accept(sockets[i]->gethandle(),(struct sockaddr*)s,&hisaddresslength);
+ h=accept(sockets[i]->gethandle(),(struct sockaddr*)s,(socklen_t*)&hisaddresslength);
if(h>=0){
#ifdef DEBUG
log("Wheel::onepass: accepting connection");

47
www/fhttpd/files/patch-af Normal file
View file

@ -0,0 +1,47 @@
--- fhttpd.cc.orig Sat Jan 29 00:56:40 2000
+++ fhttpd.cc Sat Jan 29 00:58:31 2000
@@ -130,7 +130,7 @@
basedir[255]=0;
strncpy(username,globalhttppw->pw_name,128);
username[128]=0;
-if(!getsockname(connection->gethandle(),(sockaddr*)&currsock,&currsockaddrlen)){
+if(!getsockname(connection->gethandle(),(sockaddr*)&currsock,(socklen_t*)&currsockaddrlen)){
AddressRoot *curraddrroot=(AddressRoot*)addressroots.start;
while(curraddrroot){
if((*((__s32*)&currsock.sin_addr))==curraddrroot->address){
@@ -250,7 +250,7 @@
if(c->socket){
sprintf(tmpstr,"%d",c->socket->port);
LogMessage(this,NULL,NULL,NULL,0,"LOCAL_PORT",tmpstr);
- if(!getsockname(c->gethandle(),(sockaddr*)&currsock,&currsockaddrlen)){
+ if(!getsockname(c->gethandle(),(sockaddr*)&currsock,(socklen_t*)&currsockaddrlen)){
LogMessage(this,NULL,NULL,NULL,0,"LOCAL_IP",inet_ntoa(currsock.sin_addr));
}
LogMessage(this,NULL,NULL,NULL,0,"IP",inet_ntoa(((sockaddr_in*)c->getaddress())->sin_addr));
@@ -349,7 +349,7 @@
if(servertype==ftp_server_port){
strncpy(tmphostname,hostname,256);
tmphostname[255]=0;
- if(!getsockname(client->gethandle(),(sockaddr*)&currsock,&currsockaddrlen)){
+ if(!getsockname(client->gethandle(),(sockaddr*)&currsock,(socklen_t*)&currsockaddrlen)){
AddressRoot *curraddrroot=(AddressRoot*)addressroots.start;
while(curraddrroot){
if((*((__s32*)&currsock.sin_addr))==curraddrroot->address){
@@ -2554,7 +2554,7 @@
if(blength>253) param[1][253]=0;
}else ((ControlFTPServerApp*)client->app)->trailingslash=1;
j=0;
- if(getsockname(client->gethandle(),(sockaddr*)&currsock,&currsockaddrlen)){
+ if(getsockname(client->gethandle(),(sockaddr*)&currsock,(socklen_t*)&currsockaddrlen)){
(*((__s32*)&currsock.sin_addr))=-1;
}
@@ -3139,7 +3139,7 @@
struct sockaddr_in currsock;
sockaddr_size_type currsockaddrlen=sizeof(currsock);
- if(!getsockname(client->gethandle(),(sockaddr*)&currsock,&currsockaddrlen)){
+ if(!getsockname(client->gethandle(),(sockaddr*)&currsock,(socklen_t*)&currsockaddrlen)){
AddressRoot *curraddrroot=(AddressRoot*)addressroots.start;
while(curraddrroot){
if((*((__s32*)&currsock.sin_addr))==curraddrroot->address){

1
www/fhttpd/pkg-comment Normal file
View file

@ -0,0 +1 @@
C++-based FTP/HTTP server that supports modules

15
www/fhttpd/pkg-descr Normal file
View file

@ -0,0 +1,15 @@
FHTTPD is a relatively new HTTP/FTP daemon that supports modules,
in particular, for PHP3. It's a feasible alternative to Apache,
but only for certain situations (for reasons given below). For
example, if one wishes only to run one daemon for both the FTP
and HTTP services, they can do that with FHTTPD.
Unfortunately, at this time, FHTTPD does not seem to offer the
capability of running as non-root after binding to privileged
ports. Not to mention that the code itself is not very
self-documenting... it is of a poor programming style.
WWW: http://www.illtel.com/pub/fhttpd/
Author: Alex Belits <abelits@phobos.illtel.denver.co.us>
--Will <andrews@technologist.com>

46
www/fhttpd/pkg-plist Normal file
View file

@ -0,0 +1,46 @@
etc/fhttpd.conf
%%LOGFILE%%
sbin/fhttpd
sbin/fhttpd-file
sbin/fhttpd-log
share/fhttpd/bin/finger-nohtml
share/fhttpd/cgi-bin/.index.html
share/fhttpd/cgi-bin/finger
share/fhttpd/cgi-bin/fortune
share/fhttpd/icons/at_work.gif
share/fhttpd/icons/audio.gif
share/fhttpd/icons/audio.xbm
share/fhttpd/icons/binary.gif
share/fhttpd/icons/binary.xbm
share/fhttpd/icons/c_text.gif
share/fhttpd/icons/c_text.xbm
share/fhttpd/icons/cdromicon.gif
share/fhttpd/icons/exec.gif
share/fhttpd/icons/folder.gif
share/fhttpd/icons/folder.xbm
share/fhttpd/icons/ftp.gif
share/fhttpd/icons/html.gif
share/fhttpd/icons/html.xbm
share/fhttpd/icons/image.gif
share/fhttpd/icons/image.xbm
share/fhttpd/icons/movie.gif
share/fhttpd/icons/text.gif
share/fhttpd/icons/text.xbm
share/fhttpd/index.html
share/fhttpd/noaccess.html
share/fhttpd/private/.footer.html
share/fhttpd/private/.header.html
share/fhttpd/private/.index.html
share/fhttpd/private/dummy_file
share/fhttpd/private/dummy_file.html
share/fhttpd/pub/.footer.html
share/fhttpd/pub/.header.html
share/fhttpd/pub/.index.html
share/fhttpd/pub/dummy_file.html
@dirrm share/fhttpd/bin
@dirrm share/fhttpd/cgi-bin
@dirrm share/fhttpd/icons
@dirrm share/fhttpd/incoming
@dirrm share/fhttpd/private
@dirrm share/fhttpd/pub
@dirrm share/fhttpd