diff options
author | Bob Beck <beck@cvs.openbsd.org> | 1999-03-01 01:16:10 +0000 |
---|---|---|
committer | Bob Beck <beck@cvs.openbsd.org> | 1999-03-01 01:16:10 +0000 |
commit | 5e9b927491680aa1d931a0fce0e01c7a47f0ffa0 (patch) | |
tree | 3ca193f25706d343bac409d079f2087aba175007 /usr.sbin | |
parent | 85ea6023f3b47eacbd1c0ffc7e1575df2745ee24 (diff) |
import apache 1.3.26 + mod_ssl 2.8.10
Diffstat (limited to 'usr.sbin')
40 files changed, 1143 insertions, 0 deletions
diff --git a/usr.sbin/httpd/config.layout b/usr.sbin/httpd/config.layout new file mode 100644 index 00000000000..e387a27cfc0 --- /dev/null +++ b/usr.sbin/httpd/config.layout @@ -0,0 +1,62 @@ +## +## config.layout -- APACI Pre-defined Installation Path Layouts +## +## Hints: +## - layouts can be loaded with APACI's --with-layout=ID option +## - when no --with-layout option is given, the default layout is `Apache' +## - a trailing plus character (`+') on paths is replaced with a +## `/<target>' suffix where <target> is the the argument from +## option --target (defaults to `httpd'). +## + +# Classical Apache path layout. +<Layout Apache> + prefix: /usr/local/apache + exec_prefix: $prefix + bindir: $exec_prefix/bin + sbindir: $exec_prefix/bin + libexecdir: $exec_prefix/libexec + mandir: $prefix/man + sysconfdir: $prefix/conf + datadir: $prefix + includedir: $prefix/include + localstatedir: $prefix + runtimedir: $localstatedir/logs + logfiledir: $localstatedir/logs + proxycachedir: $localstatedir/proxy +</Layout> + +# GNU standards conforming path layout. +# See FSF's GNU project `make-stds' document for details. +<Layout GNU> + prefix: /usr/local + exec_prefix: $prefix + bindir: $exec_prefix/bin + sbindir: $exec_prefix/sbin + libexecdir: $exec_prefix/libexec + mandir: $prefix/man + sysconfdir: $prefix/etc+ + datadir: $prefix/share+ + includedir: $prefix/include+ + localstatedir: $prefix/var+ + runtimedir: $localstatedir/run + logfiledir: $localstatedir/log + proxycachedir: $localstatedir/proxy +</Layout> + +# Apache binary distribution path layout +<Layout BinaryDistribution> + prefix: /usr/local/apache + exec_prefix: + bindir: bin + sbindir: bin + libexecdir: libexec + mandir: man + sysconfdir: conf + datadir: + includedir: include + localstatedir: + runtimedir: logs + logfiledir: logs + proxycachedir: proxy +</Layout> diff --git a/usr.sbin/httpd/htdocs/manual/install-tpf.html b/usr.sbin/httpd/htdocs/manual/install-tpf.html new file mode 100644 index 00000000000..a55636e5bec --- /dev/null +++ b/usr.sbin/httpd/htdocs/manual/install-tpf.html @@ -0,0 +1,276 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<HTML> +<HEAD> +<TITLE>Installing Apache on TPF</TITLE> +</HEAD> + +<BODY> +<H1 ALIGN="center"> + <A NAME="top">Installing the Apache 1.3 HTTP Server on TPF</A> +</H1> +<HR> +<CENTER>[ <A HREF="#setup">Setup</A> + | <A HREF="#compilation">Compilation</A> + | <A HREF="#installation">Installation</A> + | <A HREF="#visualage">VisualAge</A> ] +</CENTER> +<HR> +<BR> + +<P> +This document outlines the steps needed to install Apache onto a TPF system. +</P> +<P> +You should first read +htdocs/manual/<A HREF="readme-tpf.html">readme-tpf.html</A> +for basic information on the port of Apache to TPF including required PUT level +and supported functions & modules. +</P> + +<H2 align=center><A NAME="setup">Setup</A></H2> +<P> +Due to the use of EBCDIC on MVS OS/390 Open Edition +(later referred to simply as +"Open Edition"), we've found that the most reliable +method for loading Apache onto your system is to unzip and tar the distribution +file on your PC, and then copy the extracted files to Open Edition +via an NFS client +capable of transferring the data in EBCDIC format. +</P> +<P> +Before moving the distribution to an +Open Edition environment, verify that the NFS drive will transfer the +filenames with upper/lower case preserved. +</P> +<P> +Since Open Edition is not the ultimate destination of the files, +the only required files and subdirectories that need to be moved to +Open Edition +are in /src. +</P> +<P> +<FONT COLOR=red><STRONG>WARNING</STRONG></FONT>: +If you are using a product such as WinZip on your PC, verify that +the <EM>"TAR File Smart CR/LF Conversion"</EM> option is NOT checked. +You can find this in WinZip under Options, Configuration. +Since you had to tar and unzip the file to read this document, +you need to re-tar and -unzip if the CR/LF option was checked. +This will save you lots of headaches later on. +</P> +<P> +<FONT COLOR=red><STRONG>WARNING</STRONG></FONT>: +Editing files on a PC before moving them to Open Edition may result +in the loss/addition of unprintable characters. Files of concern include shell +scripts and src/Configuration. The most common problems are with +tab characters +and CR/LF characters. Most editors will handle the CR/LF problem correctly +but none seem to handle tab characters. If you need to edit files, edit them +in a UNIX editor such as vi or emacs. +</P> + +<H2 align=center><A NAME="compilation">Compilation</A></H2> +<P> +Apache supports the notion of "optional modules". However, +the server has to know which modules are compiled into it. In order for +those modules to be effective, it is necessary to generate a short bit of +code ("modules.c") which simply has a list of them. If you are using the +make and Configure utility, "modules.c" will be created for you. +</P> +<P> +The provided scripts assume a c89 compiler and have only been tested on an +Open Edition environment. If you are using a platform other that +Open Edition you may need to modify src/os/tpf/TPFExport and src/Configure +to match your environment. +</P> +<P> +Note that UNIX/Open Edition commands in this section are shown in +<TT><STRONG>bold</STRONG></TT>, +are case sensitive, and must be made from the "src" directory. +</P> +<OL> +<LI>Overlay src/Configuration with src/Configuration.tmpl: + <TT><STRONG>cp Configuration.tmpl Configuration</STRONG></TT> + <BR><BR> +<LI>Edit src/Configuration. It contains the list and settings + of various "Rules" and an additional section at the bottom that determines + which modules to compile: + <BR><BR> + <OL type=a> + <LI>Adjust the Rules and <TT>EXTRA_CFLAGS|LIBS|LDFLAGS|INCLUDES</TT> + if you feel so inclined. + <BR><BR> + <LI>Comment out (by preceding the line with a "#") lines corresponding + to those modules you DO NOT wish to include. + At present the following modules MUST be commented out + as they are not yet supported on TPF: mod_actions, mod_auth, + mod_cgi, mod_env, mod_include, & mod_status. + <BR><BR> + <LI>Uncomment (by removing the initial "#", if present) lines + corresponding to those optional modules you wish + to include or add new lines corresponding to any custom modules + you have written. + The htdocs/manual/<A HREF="readme-tpf.html">readme-tpf.html</A> + document lists the modules that have been tested on TPF. + </OL> + <BR> +<LI>Set the TPF environment variables: + <TT><STRONG>. os/tpf/TPFExport</STRONG></TT> + <BR> + (The initial period and blank on the command are required to ensure + the environment variables exist beyond the scope of the shell script.) + This script will set the environment variables required to compile the + programs for TPF. Verify that the export variables are valid for your + installation, in particular, the system include file directories. The + system include files must reside on your Open Edition system in the + appropriate file structure similar to /usr/include and /usr/include/sys. + DO NOT modify the <TT>TPF=YES</TT> export variable. If this is + changed, the "Configure" script will not recognize TPF. + <BR><BR> +<LI>Run the "Configure" script: + <TT><STRONG>Configure</STRONG></TT> + <BR> + The output will look something like this... + <PRE> + Using config file: Configuration + Creating Makefile + + configured for TPF platform + + setting C compiler to c89 + + setting C pre-processor to c89 -E + + checking for system header files + + adding selected modules + Creating Makefile in support + Creating Makefile in main + Creating Makefile in ap + Creating Makefile in regex + Creating Makefile in os/tpf + Creating Makefile in modules/standard + Creating Makefile in modules/example + $ _ + </PRE> + This generates modules.c and new versions of the Makefiles. + <BR><BR> + If you want to maintain multiple configurations, you can + say, <EM>e.g.</EM>, + <BR> + <TT><STRONG>Configure -file Configuration.ai</STRONG></TT> + <BR> + <PRE> + Using config file: Configuration.ai + Creating Makefile + + configured for <whatever> platform + + setting C compiler to <whatever> + et cetera + </PRE> + + If you receive an error such as "<TT>Configure 146: FSUM7351 not found</TT>" + the most likely explanation is that one or more of the make related + files were edited on a non-UNIX platform, corrupting the end-of-line marks. + Verify that lines ending with "\" in the flagged file do not have trailing + spaces. Using the vi editor and the sample error above as an example... + <BR><BR><PRE> + pull up the flagged file: <STRONG>vi Configure</STRONG> + turn on punctuation: <STRONG>:set list</STRONG> + go to the line in question: <STRONG>146G</STRONG> + or find a line with a "\": <STRONG>/\\</STRONG></PRE> + The end of line should display as "<TT>\$</TT>". If it is displayed as + "<TT>\ $</TT>" (with a blank between \ and $) then you should revert to the + distributed version of the file and make the site-specific + changes again using a UNIX compatible editor such as vi or emacs. + Then try the Configure command again. + <BR><PRE> close the file: <STRONG>:q </STRONG>(or + +<STRONG>:quit!</STRONG>)</PRE> +<LI>Now compile the programs: <TT><STRONG>make</STRONG></TT><BR> + The modules placed in the Apache distribution are the ones that have been + tested and are used regularly by various members of the Apache development + group. Additional modules contributed by members or third parties with specific + needs or functions are available at + <A +HREF="http://www.apache.org/dist/contrib/modules/">http://www.apache.org/dist/contrib/modules/</A>. + There are instructions on that page for linking these modules into the core Apache + code. + <BR><BR> + If during compilation you get a warning about a missing 'regex.h', set + <TT>WANTHSREGEX=yes</TT> in the src/Configuration file and start back at the + <TT><STRONG>Configure</STRONG></TT> step. +</OL> + +<A NAME="installation"> </A> +<H2 align=center>Installation</H2> +<OL> +<LI>After compilation, you will have all the object files required to build an + "httpd" loadset. The next step is to link the object files and create a loadset to be + stored in a PDS. Sample JCL for linking and loadsets has been included in + src/os/tpf/samples as "linkdll.jcl" and "loadset.jcl". You can submit these jobs + from CMS or directly from Open Edition if you have the proper authority. After + the jobs have completed, you can <TT>ZOLDR LOAD</TT> them to your TPF system. + <BR><BR> + NOTE: The <TT>mod_<EM>xxx</EM>.o</TT> files in the linkdll.jcl file must correspond to the + <TT>mod_<EM>xxx</EM>.o</TT> lines in the src/Configuration file. + <BR><BR> +<LI> + Apache requires a configuration file to initialize itself during activation. + (Previously three configuration files were used.) + Copy the distribution version, /conf/httpd.conf-dist, to /conf/httpd.conf and then + edit the /conf/httpd.conf copy with your site specific information. This first release + of Apache for TPF only runs under the "inetd" model so you + <font color=red><STRONG>must</STRONG></FONT> change <TT>ServerType</TT> from <TT>standalone</TT> + to <TT>inetd</TT>. + <BR><BR> + General documentation for Apache is located at + <A HREF="http://www.apache.org/docs/">http://www.apache.org/docs/</A> + and in the HTML pages included with this distribution under the + /htdocs/manual directory. + <BR><BR> +<LI>On TPF activate ZCLAW and update INETD using ZINET entries, the common case: + <BR><BR> + <PRE> + ZINET ADD S-TFTP PGM-CTFT PORT-69 PROTOCOL-UDP MODEL-NOWAIT + ZINET ADD S-APACHE PGM-<EM>pppp</EM> PORT-80 PROTOCOL-TCP MODEL-NOWAIT</PRE> + Please refer to <EM>IBM Transaction Processing Facility Transmission Control + Protocol/Internet Protocol Version 4 Release 1</EM> for more information + on ZCLAW, INETD, and TFTP. + <BR><BR> +<LI>Prior to sending a request to your Apache server from a browser, + TFTP the configuration file, log, icons and web pages to your TPF system. + A typical directory structure for Apache is as follows: +<PRE> /usr/local/apache/conf + /usr/local/apache/logs + /usr/local/apache/icons + /usr/local/apache/htdocs</PRE> + The logs directory must exist in order to avoid an + <CODE>fopen</CODE> error while running Apache. TFTP an empty file into + the logs subdirectory to create it. All gif, jpg, and zip files should be + TFTP'd as binary; conf files and html pages should be TFTP'd as text. +</OL> +<A NAME="visualage"> </A> +<H2 align=center>Compiling with VisualAge TPF</H2> +<P> + It is not required that "make" be used to compile Apache for TPF: + Individual programs may be compiled using IBM's VisualAge TPF product. + This is particularly useful when compiling selected programs for the Debug Tool. + <BR><BR> + The following VisualAge compile settings are required: + <UL> + <LI><EM>"DEFINE - Define preprocessor macro name(s)"</EM> must include + <TT><STRONG>TPF, CHARSET_EBCDIC, _POSIX_SOURCE,</STRONG></TT> and + <TT><STRONG>USE_HSREGEX</STRONG></TT> + <BR><BR> + <LI><EM>"LSEARCH - Path for user include files"</EM> must include + <TT><STRONG>../src/include</STRONG></TT> and <TT><STRONG>../src/os/tpf</STRONG></TT> + <BR><BR> + <LI><EM>"DLL - Generate DLL code"</EM> must be checked + <BR><BR> + <LI><EM>"LONGNAME - Support long names"</EM> must be checked + </UL> +</P> +<HR> +<CENTER>[ <A HREF="#top">top</A> + | <A HREF="#setup">Setup</A> + | <A HREF="#compilation">Compilation</A> + | <A HREF="#installation">Installation</A> + | <A HREF="#visualage">VisualAge</A> ] +</CENTER> + +</BODY> +</HTML> diff --git a/usr.sbin/httpd/htdocs/manual/suexec_1_2.html b/usr.sbin/httpd/htdocs/manual/suexec_1_2.html new file mode 100644 index 00000000000..bcfc7252f2f --- /dev/null +++ b/usr.sbin/httpd/htdocs/manual/suexec_1_2.html @@ -0,0 +1,203 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<HTML> +<HEAD> +<TITLE>Apache suEXEC Support</TITLE> +</HEAD> +<!-- Background white, links blue (unvisited), navy (visited), red (active) --> +<BODY + BGCOLOR="#FFFFFF" + TEXT="#000000" + LINK="#0000FF" + VLINK="#000080" + ALINK="#FF0000" +> +<DIV ALIGN="CENTER"> + <IMG SRC="images/sub.gif" ALT="[APACHE DOCUMENTATION]"> + <H3> + Apache HTTP Server Version 1.3 + </H3> +</DIV> + + +<H3><A NAME="install">Configuring & Installing suEXEC</A></H3> +<P ALIGN="LEFT"> +This section describes the configuration and installation of +the suEXEC feature with the "<CODE>src/Configure</CODE>" script. +<BR> +(If you use Apache 1.3 you may want to use the Apache +AutoConf-style interface (APACI) which is described in the +<A HREF="suexec.html">main suEXEC document</A>). +</P> + +<P ALIGN="LEFT"> +<STRONG>EDITING THE SUEXEC HEADER FILE</STRONG><BR> +- From the top-level of the Apache source tree, type: +<STRONG><CODE>cd support [ENTER]</CODE></STRONG> +</P> + +<P ALIGN="LEFT"> +Edit the <CODE>suexec.h</CODE> file and change the following macros to +match your local Apache installation. +</P> + +<P ALIGN="LEFT"> +<EM>From support/suexec.h</EM> +<PRE> + /* + * HTTPD_USER -- Define as the username under which Apache normally + * runs. This is the only user allowed to execute + * this program. + */ + #define HTTPD_USER "www" + + /* + * UID_MIN -- Define this as the lowest UID allowed to be a target user + * for suEXEC. For most systems, 500 or 100 is common. + */ + #define UID_MIN 100 + + /* + * GID_MIN -- Define this as the lowest GID allowed to be a target group + * for suEXEC. For most systems, 100 is common. + */ + #define GID_MIN 100 + + /* + * USERDIR_SUFFIX -- Define to be the subdirectory under users' + * home directories where suEXEC access should + * be allowed. All executables under this directory + * will be executable by suEXEC as the user so + * they should be "safe" programs. If you are + * using a "simple" UserDir directive (ie. one + * without a "*" in it) this should be set to + * the same value. suEXEC will not work properly + * in cases where the UserDir directive points to + * a location that is not the same as the user's + * home directory as referenced in the passwd file. + * + * If you have VirtualHosts with a different + * UserDir for each, you will need to define them to + * all reside in one parent directory; then name that + * parent directory here. IF THIS IS NOT DEFINED + * PROPERLY, ~USERDIR CGI REQUESTS WILL NOT WORK! + * See the suEXEC documentation for more detailed + * information. + */ + #define USERDIR_SUFFIX "public_html" + + /* + * LOG_EXEC -- Define this as a filename if you want all suEXEC + * transactions and errors logged for auditing and + * debugging purposes. + */ + #define LOG_EXEC "/usr/local/apache/logs/cgi.log" /* Need me? */ + + /* + * DOC_ROOT -- Define as the DocumentRoot set for Apache. This + * will be the only hierarchy (aside from UserDirs) + * that can be used for suEXEC behavior. + */ + #define DOC_ROOT "/usr/local/apache/htdocs" + + /* + * SAFE_PATH -- Define a safe PATH environment to pass to CGI executables. + * + */ + #define SAFE_PATH "/usr/local/bin:/usr/bin:/bin" +</PRE> +</P> + +<P ALIGN="LEFT"> +<STRONG>COMPILING THE SUEXEC WRAPPER</STRONG><BR> +You now need to compile the suEXEC wrapper. At the shell command prompt, +after compiling Apache, +type: <STRONG><CODE>make suexec[ENTER]</CODE></STRONG>. +This should create the <STRONG><EM>suexec</EM></STRONG> wrapper executable. +</P> + +<P ALIGN="LEFT"> +<STRONG>COMPILING APACHE FOR USE WITH SUEXEC</STRONG><BR> +By default, Apache is compiled to look for the suEXEC wrapper in the following +location. +</P> + +<P ALIGN="LEFT"> +<EM>From src/include/httpd.h</EM> +<PRE> + /* The path to the suExec wrapper, can be overridden in Configuration */ + #ifndef SUEXEC_BIN + #define SUEXEC_BIN HTTPD_ROOT "/sbin/suexec" + #endif +</PRE> +</P> + +<P ALIGN="LEFT"> +If your installation requires location of the wrapper program in a different +directory, either add +<CODE>-DSUEXEC_BIN=\"<EM></your/path/to/suexec></EM>\"</CODE> +to your CFLAGS (or edit src/include/httpd.h) and recompile your Apache server. +See <A HREF="install.html">Compiling and Installing Apache</A> +(and the <SAMP>INSTALL</SAMP> file in the source distribution) +for more info on this process. +</P> + +<P ALIGN="LEFT"> +<STRONG>COPYING THE SUEXEC BINARY TO ITS PROPER LOCATION</STRONG><BR> +Copy the <STRONG><EM>suexec</EM></STRONG> executable created in the +exercise above to the defined location for <STRONG>SUEXEC_BIN</STRONG>. +</P> + +<P ALIGN="LEFT"> +<STRONG><CODE>cp suexec /usr/local/apache/sbin/suexec [ENTER]</CODE></STRONG> +</P> + +<P ALIGN="LEFT"> +In order for the wrapper to set the user ID, it must be installed as owner +<STRONG><EM>root</EM></STRONG> and must have the setuserid execution bit +set for file modes. If you are not running a <STRONG><EM>root</EM></STRONG> +user shell, do so now and execute the following commands. +</P> + +<P ALIGN="LEFT"> +<STRONG><CODE>chown root /usr/local/apache/sbin/suexec [ENTER]</CODE></STRONG> +<BR> +<STRONG><CODE>chmod 4711 /usr/local/apache/sbin/suexec [ENTER]</CODE></STRONG> +</P> + +<H3><A NAME="enable">Enabling & Disabling suEXEC</A></H3> +<P ALIGN="LEFT"> +After properly installing the <STRONG>suexec</STRONG> wrapper +executable, you must kill and restart the Apache server. A simple +<STRONG><CODE>kill -1 `cat httpd.pid`</CODE></STRONG> will not be enough. +Upon startup of the web-server, if Apache finds a properly configured +<STRONG>suexec</STRONG> wrapper, it will print the following message to +the console (Apache 1.2): +<PRE> + Configuring Apache for use with suexec wrapper. +</PRE> +If you use Apache 1.3 the following message is printed to the +error log: +<PRE> + [notice] suEXEC mechanism enabled (wrapper: <EM>/path/to/suexec</EM>) +</PRE> +</P> +<P ALIGN="LEFT"> +If you don't see this message at server startup, the server is most +likely not finding the wrapper program where it expects it, or the +executable is not installed <STRONG><EM>setuid root</EM></STRONG>. Check +your installation and try again. +</P> + +<P ALIGN="CENTER"> +<STRONG><A HREF="suexec.html">BACK TO MAIN PAGE</A></STRONG> +</P> + +<HR> + <H3 ALIGN="CENTER"> + Apache HTTP Server Version 1.3 + </H3> + +<A HREF="./"><IMG SRC="images/index.gif" ALT="Index"></A> + +</BODY> +</HTML> diff --git a/usr.sbin/httpd/icons/small/README.txt b/usr.sbin/httpd/icons/small/README.txt new file mode 100644 index 00000000000..deb96702b76 --- /dev/null +++ b/usr.sbin/httpd/icons/small/README.txt @@ -0,0 +1,6 @@ + +These icons are provided as an alternative to the standard Apache +icon graphics. All graphics in this directory, with the exception +of rainbow.gif, are 16x16 pixels in size, rather than the 20x22 +dimension icons which are the normal defaults for Apache and are +in the parent directory of this one. diff --git a/usr.sbin/httpd/icons/small/back.gif b/usr.sbin/httpd/icons/small/back.gif Binary files differnew file mode 100644 index 00000000000..e331454726b --- /dev/null +++ b/usr.sbin/httpd/icons/small/back.gif diff --git a/usr.sbin/httpd/icons/small/binary.gif b/usr.sbin/httpd/icons/small/binary.gif Binary files differnew file mode 100644 index 00000000000..995f79b9b10 --- /dev/null +++ b/usr.sbin/httpd/icons/small/binary.gif diff --git a/usr.sbin/httpd/icons/small/binhex.gif b/usr.sbin/httpd/icons/small/binhex.gif Binary files differnew file mode 100644 index 00000000000..3d54a5458e6 --- /dev/null +++ b/usr.sbin/httpd/icons/small/binhex.gif diff --git a/usr.sbin/httpd/icons/small/blank.gif b/usr.sbin/httpd/icons/small/blank.gif Binary files differnew file mode 100644 index 00000000000..606787a8399 --- /dev/null +++ b/usr.sbin/httpd/icons/small/blank.gif diff --git a/usr.sbin/httpd/icons/small/broken.gif b/usr.sbin/httpd/icons/small/broken.gif Binary files differnew file mode 100644 index 00000000000..1bcc57f25c5 --- /dev/null +++ b/usr.sbin/httpd/icons/small/broken.gif diff --git a/usr.sbin/httpd/icons/small/burst.gif b/usr.sbin/httpd/icons/small/burst.gif Binary files differnew file mode 100644 index 00000000000..d882ceba9cb --- /dev/null +++ b/usr.sbin/httpd/icons/small/burst.gif diff --git a/usr.sbin/httpd/icons/small/comp1.gif b/usr.sbin/httpd/icons/small/comp1.gif Binary files differnew file mode 100644 index 00000000000..712f36afdb2 --- /dev/null +++ b/usr.sbin/httpd/icons/small/comp1.gif diff --git a/usr.sbin/httpd/icons/small/comp2.gif b/usr.sbin/httpd/icons/small/comp2.gif Binary files differnew file mode 100644 index 00000000000..7759eb11f95 --- /dev/null +++ b/usr.sbin/httpd/icons/small/comp2.gif diff --git a/usr.sbin/httpd/icons/small/compressed.gif b/usr.sbin/httpd/icons/small/compressed.gif Binary files differnew file mode 100644 index 00000000000..d3b156072ac --- /dev/null +++ b/usr.sbin/httpd/icons/small/compressed.gif diff --git a/usr.sbin/httpd/icons/small/continued.gif b/usr.sbin/httpd/icons/small/continued.gif Binary files differnew file mode 100644 index 00000000000..e1c9f2cfa68 --- /dev/null +++ b/usr.sbin/httpd/icons/small/continued.gif diff --git a/usr.sbin/httpd/icons/small/dir.gif b/usr.sbin/httpd/icons/small/dir.gif Binary files differnew file mode 100644 index 00000000000..7b37b099177 --- /dev/null +++ b/usr.sbin/httpd/icons/small/dir.gif diff --git a/usr.sbin/httpd/icons/small/dir2.gif b/usr.sbin/httpd/icons/small/dir2.gif Binary files differnew file mode 100644 index 00000000000..425d6e4b77c --- /dev/null +++ b/usr.sbin/httpd/icons/small/dir2.gif diff --git a/usr.sbin/httpd/icons/small/forward.gif b/usr.sbin/httpd/icons/small/forward.gif Binary files differnew file mode 100644 index 00000000000..2997466eb4d --- /dev/null +++ b/usr.sbin/httpd/icons/small/forward.gif diff --git a/usr.sbin/httpd/icons/small/generic.gif b/usr.sbin/httpd/icons/small/generic.gif Binary files differnew file mode 100644 index 00000000000..f8da6ff92c3 --- /dev/null +++ b/usr.sbin/httpd/icons/small/generic.gif diff --git a/usr.sbin/httpd/icons/small/generic2.gif b/usr.sbin/httpd/icons/small/generic2.gif Binary files differnew file mode 100644 index 00000000000..992f13331bb --- /dev/null +++ b/usr.sbin/httpd/icons/small/generic2.gif diff --git a/usr.sbin/httpd/icons/small/generic3.gif b/usr.sbin/httpd/icons/small/generic3.gif Binary files differnew file mode 100644 index 00000000000..85aa275e25a --- /dev/null +++ b/usr.sbin/httpd/icons/small/generic3.gif diff --git a/usr.sbin/httpd/icons/small/image.gif b/usr.sbin/httpd/icons/small/image.gif Binary files differnew file mode 100644 index 00000000000..dc3d95ced76 --- /dev/null +++ b/usr.sbin/httpd/icons/small/image.gif diff --git a/usr.sbin/httpd/icons/small/image2.gif b/usr.sbin/httpd/icons/small/image2.gif Binary files differnew file mode 100644 index 00000000000..a5c40f15508 --- /dev/null +++ b/usr.sbin/httpd/icons/small/image2.gif diff --git a/usr.sbin/httpd/icons/small/index.gif b/usr.sbin/httpd/icons/small/index.gif Binary files differnew file mode 100644 index 00000000000..526df6b0645 --- /dev/null +++ b/usr.sbin/httpd/icons/small/index.gif diff --git a/usr.sbin/httpd/icons/small/key.gif b/usr.sbin/httpd/icons/small/key.gif Binary files differnew file mode 100644 index 00000000000..8dfd6c09de3 --- /dev/null +++ b/usr.sbin/httpd/icons/small/key.gif diff --git a/usr.sbin/httpd/icons/small/movie.gif b/usr.sbin/httpd/icons/small/movie.gif Binary files differnew file mode 100644 index 00000000000..7b4a42e7a0e --- /dev/null +++ b/usr.sbin/httpd/icons/small/movie.gif diff --git a/usr.sbin/httpd/icons/small/rainbow.gif b/usr.sbin/httpd/icons/small/rainbow.gif Binary files differnew file mode 100644 index 00000000000..8216b89bade --- /dev/null +++ b/usr.sbin/httpd/icons/small/rainbow.gif diff --git a/usr.sbin/httpd/icons/small/sound.gif b/usr.sbin/httpd/icons/small/sound.gif Binary files differnew file mode 100644 index 00000000000..a7a89ffd9ed --- /dev/null +++ b/usr.sbin/httpd/icons/small/sound.gif diff --git a/usr.sbin/httpd/icons/small/sound2.gif b/usr.sbin/httpd/icons/small/sound2.gif Binary files differnew file mode 100644 index 00000000000..07706e07b86 --- /dev/null +++ b/usr.sbin/httpd/icons/small/sound2.gif diff --git a/usr.sbin/httpd/icons/small/tar.gif b/usr.sbin/httpd/icons/small/tar.gif Binary files differnew file mode 100644 index 00000000000..59c3ffb9a5f --- /dev/null +++ b/usr.sbin/httpd/icons/small/tar.gif diff --git a/usr.sbin/httpd/icons/small/text.gif b/usr.sbin/httpd/icons/small/text.gif Binary files differnew file mode 100644 index 00000000000..66ceefbc8c4 --- /dev/null +++ b/usr.sbin/httpd/icons/small/text.gif diff --git a/usr.sbin/httpd/icons/small/transfer.gif b/usr.sbin/httpd/icons/small/transfer.gif Binary files differnew file mode 100644 index 00000000000..d460d3fffe6 --- /dev/null +++ b/usr.sbin/httpd/icons/small/transfer.gif diff --git a/usr.sbin/httpd/icons/small/unknown.gif b/usr.sbin/httpd/icons/small/unknown.gif Binary files differnew file mode 100644 index 00000000000..7bf0bbc10a6 --- /dev/null +++ b/usr.sbin/httpd/icons/small/unknown.gif diff --git a/usr.sbin/httpd/icons/small/uu.gif b/usr.sbin/httpd/icons/small/uu.gif Binary files differnew file mode 100644 index 00000000000..8c793f8a7f9 --- /dev/null +++ b/usr.sbin/httpd/icons/small/uu.gif diff --git a/usr.sbin/httpd/src/helpers/binbuild.sh b/usr.sbin/httpd/src/helpers/binbuild.sh new file mode 100644 index 00000000000..3279148fcbc --- /dev/null +++ b/usr.sbin/httpd/src/helpers/binbuild.sh @@ -0,0 +1,221 @@ +#!/bin/sh +# +# binbuild.sh - Builds an Apache binary distribution. +# Initially written by Lars Eilebrecht <lars@apache.org>. +# +# This script falls under the Apache License. +# See http://www.apache.org/docs/LICENSE + + +APDIR=$(basename $(pwd)) +VER=$(echo $APDIR |sed s/apache-//) +OS=$(src/helpers/GuessOS) +USER="$(src/helpers/buildinfo.sh -n %u@%h%d)" +TAR="$(src/helpers/findprg.sh tar)" +GTAR="$(src/helpers/findprg.sh gtar)" +GZIP="$(src/helpers/findprg.sh gzip)" +CONFIGPARAM="--with-layout=BinaryDistribution --enable-module=most --enable-shared=max" + +if [ ! -f ./ABOUT_APACHE ] +then + echo "ERROR: The current directory contains no valid Apache distribution." + echo "Please change the directory to the top level directory of a freshly" + echo "unpacked Apache 1.3 source distribution and re-execute the script" + echo "'./src/helpers/bindbuild.sh'." + exit 1; +fi + +if [ -d ./CVS ] +then + echo "ERROR: The current directory is a CVS checkout of Apache." + echo "Only a standard Apache 1.3 source distribution should be used to" + echo "create a binary distribution." + exit 1; +fi + +echo "Building Apache $VER binary distribution..." +echo "Platform is \"$OS\"..." + +( echo "Build log for Apache binary distribution" && \ + echo "----------------------------------------------------------------------" && \ + ./configure $CONFIGPARAM && \ + echo "----------------------------------------------------------------------" && \ + make clean && \ + rm -rf bindist install-bindist.sh *.bindist + echo "----------------------------------------------------------------------" && \ + make && \ + echo "----------------------------------------------------------------------" && \ + make install-quiet root="bindist/" && \ + echo "----------------------------------------------------------------------" && \ + make clean && \ + echo "----------------------------------------------------------------------" && \ + echo "[EOF]" \ +) > build.log 2>&1 + +if [ ! -f ./bindist/bin/httpd ] +then + echo "ERROR: Failed to build Apache. See \"build.log\" for details." + exit 1; +fi + +echo "Binary images successfully created..." +echo "Creating supplementary files..." + +( echo " " && \ + echo "Apache $VER binary distribution" && \ + echo "================================" && \ + echo " " && \ + echo "This binary distribution is usable on a \"$OS\"" && \ + echo "system and was built by \"$USER\"." && \ + echo "" && \ + echo "The distribution contains all standard Apache modules as shared" && \ + echo "objects. This allows you to enable or disable particular modules" && \ + echo "with the LoadModule/AddModule directives in the configuration file" && \ + echo "without the need to re-compile Apache." && \ + echo "" && \ + echo "See \"INSTALL.bindist\" on how to install the distribution." && \ + echo " " && \ + echo "NOTE: Please do not send support-related mails to the address mentioned" && \ + echo " above or to any member of the Apache Group! Support questions" && \ + echo " should be directed to the \"comp.infosystems.www.servers.unix\"" && \ + echo " or \"comp.infosystems.www.servers.ms-windows\" newsgroup" && \ + echo " (as appropriate for the platform you use), where some of the" && \ + echo " Apache team lurk, in the company of many other Apache gurus" && \ + echo " who should be able to help." && \ + echo " If you think you found a bug in Apache or have a suggestion please" && \ + echo " visit the bug report page at http://www.apache.org/bug_report.html" && \ + echo " " && \ + echo "----------------------------------------------------------------------" && \ + ./bindist/bin/httpd -V && \ + echo "----------------------------------------------------------------------" \ +) > README.bindist +cp README.bindist ../apache-$VER-$OS.README + +( echo " " && \ + echo "Apache $VER binary installation" && \ + echo "================================" && \ + echo " " && \ + echo "To install this binary distribution you have to execute the installation" && \ + echo "script \"install-bindist.sh\" in the top-level directory of the distribution." && \ + echo " " && \ + echo "The script takes the ServerRoot directory into which you want to install" && \ + echo "Apache as an option. If you ommit the option the default path" && \ + echo "\"/usr/local/apache\" is used." && \ + echo "Make sure you have write permissions in the target directory, e.g. switch" && \ + echo "to user \"root\" before you execute the script." && \ + echo " " && \ + echo "See \"README.bindist\" for further details about this distribution." && \ + echo " " && \ + echo "Please note that this distribution includes the complete Apache source code." && \ + echo "Therefore you may compile Apache yourself at any time if you have a compiler" && \ + echo "installation on your system." && \ + echo "See \"INSTALL\" for details on how to accomplish this." && \ + echo " " \ +) > INSTALL.bindist + +( echo "#!/bin/sh" && \ + echo "#" && \ + echo "# Usage: install-bindist.sh [ServerRoot]" && \ + echo "# This script installs the Apache binary distribution and" && \ + echo "# was automatically created by binbuild.sh." && \ + echo " " && \ + echo "if [ .\$1 = . ]" && \ + echo "then" && \ + echo " SR=/usr/local/apache" && \ + echo "else" && \ + echo " SR=\$1" && \ + echo "fi" && \ + echo "echo \"Installing binary distribution for platform $OS\"" && \ + echo "echo \"into directory \$SR ...\"" && \ + echo "./src/helpers/mkdir.sh \$SR" && \ + echo "cp -r bindist/proxy \$SR/proxy" && \ + echo "cp -r bindist/man \$SR/man" && \ + echo "cp -r bindist/logs \$SR/logs" && \ + echo "cp -r bindist/libexec \$SR/libexec" && \ + echo "cp -r bindist/include \$SR/include" && \ + echo "cp -r bindist/icons \$SR/icons" && \ + echo "cp -r bindist/cgi-bin \$SR/cgi-bin" && \ + echo "cp -r bindist/bin \$SR/bin" && \ + echo "if [ -d \$SR/conf ]" && \ + echo "then" && \ + echo " echo \"[Preserving existing configuration files.]\"" && \ + echo " cp -r bindist/conf/*.default \$SR/conf/" && \ + echo "else" && \ + echo " cp -r bindist/conf \$SR/conf" && \ + echo "fi" && \ + echo "if [ -d \$SR/htdocs ]" && \ + echo "then" && \ + echo " echo \"[Preserving existing htdocs directory.]\"" && \ + echo "else" && \ + echo " cp -r bindist/htdocs \$SR/htdocs" && \ + echo "fi" && \ + echo "sed -e s%/usr/local/apache%\$SR/% \$SR/conf/httpd.conf.default > \$SR/conf/httpd.conf" && \ + echo "sed -e s%PIDFILE=%PIDFILE=\$SR/% -e s%HTTPD=%HTTPD=\\\"\$SR/% -e \"s%/httpd$%/httpd -d \$SR\\\"%\" bindist/bin/apachectl > \$SR/bin/apachectl" && \ + echo " " && \ + echo "echo \"Ready.\"" && \ + echo "echo \" +--------------------------------------------------------+\"" && \ + echo "echo \" | You now have successfully installed the Apache $VER |\"" && \ + echo "echo \" | HTTP server. To verify that Apache actually works |\"" && \ + echo "echo \" | correctly you now should first check the (initially |\"" && \ + echo "echo \" | created or preserved) configuration files |\"" && \ + echo "echo \" | |\"" && \ + echo "echo \" | \$SR/conf/httpd.conf\"" && \ + echo "echo \" | |\"" && \ + echo "echo \" | and then you should be able to immediately fire up |\"" && \ + echo "echo \" | Apache the first time by running: |\"" && \ + echo "echo \" | |\"" && \ + echo "echo \" | \$SR/bin/apachectl start \"" &&\ + echo "echo \" | |\"" && \ + echo "echo \" | Thanks for using Apache. The Apache Group |\"" && \ + echo "echo \" | http://www.apache.org/ |\"" && \ + echo "echo \" +--------------------------------------------------------+\"" && \ + echo "echo \" \"" \ +) > install-bindist.sh +chmod 755 install-bindist.sh + +sed -e "s%\"/htdocs%\"/usr/local/apache/htdocs%" \ + -e "s%\"/icons%\"/usr/local/apache/icons%" \ + -e "s%\"/cgi-bin%\"/usr/local/apache/cgi-bin%" \ + -e "s%^ServerAdmin.*%ServerAdmin you@your.address%" \ + -e "s%#ServerName.*%#ServerName localhost%" \ + -e "s%Port 8080%Port 80%" \ + bindist/conf/httpd.conf.default > bindist/conf/httpd.conf +cp bindist/conf/httpd.conf bindist/conf/httpd.conf.default + +echo "Creating distribution archive and readme file..." + +if [ ".`grep -i error build.log > /dev/null`" != . ] +then + echo "ERROR: Failed to build Apache. See \"build.log\" for details." + exit 1; +else + if [ ".$GTAR" != . ] + then + $GTAR -zcf ../apache-$VER-$OS.tar.gz -C .. --owner=root --group=root apache-$VER + else + if [ ".$TAR" != . ] + then + $TAR -cf ../apache-$VER-$OS.tar -C .. apache-$VER + if [ ".$GZIP" != . ] + then + $GZIP ../apache-$VER-$OS.tar + fi + else + echo "ERROR: Could not find a 'tar' program!" + echo " Please execute the following commands manually:" + echo " tar -cf ../apache-$VER-$OS.tar ." + echo " gzip ../apache-$VER-$OS.tar" + fi + fi + + if [ -f ../apache-$VER-$OS.tar.gz ] && [ -f ../apache-$VER-$OS.README ] + then + echo "Ready." + echo "You can find the binary archive (apache-$VER-$OS.tar.gz)" + echo "and the readme file (apache-$VER-$OS.README) in the" + echo "parent directory." + exit 0; + else + exit 1; + fi +fi diff --git a/usr.sbin/httpd/src/os/tpf/Makefile.tmpl b/usr.sbin/httpd/src/os/tpf/Makefile.tmpl new file mode 100644 index 00000000000..ad54c1b84a4 --- /dev/null +++ b/usr.sbin/httpd/src/os/tpf/Makefile.tmpl @@ -0,0 +1,41 @@ +CFLAGS=$(OPTIM) $(CFLAGS1) $(EXTRA_CFLAGS) +LIBS=$(EXTRA_LIBS) $(LIBS1) +INCLUDES=$(INCLUDES1) $(INCLUDES0) $(EXTRA_INCLUDES) +LDFLAGS=$(LDFLAGS1) $(EXTRA_LDFLAGS) + +OBJS= os.o os-inline.o ebcdic.o + +LIB= libos.a + +all: $(LIB) + +$(LIB): $(OBJS) + rm -f $@ + ar cr $@ $(OBJS) + $(RANLIB) $@ + +.c.o: + $(CC) -c $(INCLUDES) $(CFLAGS) $(SPACER) $< + +clean: + rm -f $(OBJS) $(LIB) + +distclean: clean + -rm -f Makefile + +# We really don't expect end users to use this rule. It works only with +# gcc, and rebuilds Makefile.tmpl. You have to re-run Configure after +# using it. +depend: + cp Makefile.tmpl Makefile.tmpl.bak \ + && sed -ne '1,/^# DO NOT REMOVE/p' Makefile.tmpl > Makefile.new \ + && gcc -MM $(INCLUDES) $(CFLAGS) *.c >> Makefile.new \ + && sed -e '1,$$s: $(INCDIR)/: $$(INCDIR)/:g' Makefile.new \ + > Makefile.tmpl \ + && rm Makefile.new + +$(OBJS): Makefile +os.o: os.c os-inline.c +ebcdic.o: ebcdic.c +# DO NOT REMOVE +os.o: os.c diff --git a/usr.sbin/httpd/src/os/tpf/TPFExport b/usr.sbin/httpd/src/os/tpf/TPFExport new file mode 100644 index 00000000000..449ebf2f93a --- /dev/null +++ b/usr.sbin/httpd/src/os/tpf/TPFExport @@ -0,0 +1,7 @@ +#!/bin/sh +echo " Setting TPF/c89 environment variables" +export _C89_CCMODE=1 +# replace the following with the location of your TPF include files +export _C89_INCDIRS="/u/tpf41/currentmaint/include /u/tpf41/currentmaint/include/oco" +export TPF=YES +echo "Done" diff --git a/usr.sbin/httpd/src/os/tpf/ebcdic.h b/usr.sbin/httpd/src/os/tpf/ebcdic.h new file mode 100644 index 00000000000..e9c4120e1a3 --- /dev/null +++ b/usr.sbin/httpd/src/os/tpf/ebcdic.h @@ -0,0 +1,8 @@ +#include <sys/types.h> + +extern const unsigned char os_toascii[256]; +extern const unsigned char os_toebcdic[256]; +void ebcdic2ascii(void *dest, const void *srce, size_t count); +void ebcdic2ascii_strictly(unsigned char *dest, const unsigned char *srce, size_t count); +void ascii2ebcdic(void *dest, const void *srce, size_t count); + diff --git a/usr.sbin/httpd/src/os/tpf/os-inline.c b/usr.sbin/httpd/src/os/tpf/os-inline.c new file mode 100644 index 00000000000..e58917af369 --- /dev/null +++ b/usr.sbin/httpd/src/os/tpf/os-inline.c @@ -0,0 +1,31 @@ +/* + * This file contains functions which can be inlined if the compiler + * has an "inline" modifier. Because of this, this file is both a + * header file and a compilable module. + * + * Only inlineable functions should be defined in here. They must all + * include the INLINE modifier. + * + * If the compiler supports inline, this file will be #included as a + * header file from os.h to create all the inline function + * definitions. INLINE will be defined to whatever is required on + * function definitions to make them inline declarations. + * + * If the compiler does not support inline, this file will be compiled + * as a normal C file into libos.a (along with os.c). In this case + * INLINE will _not_ be set so we can use this to test if we are + * compiling this source file. + */ + +#ifndef INLINE +#define INLINE + +/* Anything required only when compiling */ +#include "ap_config.h" + +#endif + +INLINE int ap_os_is_path_absolute(const char *file) +{ + return (file && file[0] == '/' ? 1 : 0); +} diff --git a/usr.sbin/httpd/src/os/tpf/os.c b/usr.sbin/httpd/src/os/tpf/os.c new file mode 100644 index 00000000000..aea4d961f4e --- /dev/null +++ b/usr.sbin/httpd/src/os/tpf/os.c @@ -0,0 +1,177 @@ +/* ==================================================================== + * Copyright (c) 1998-1999 The Apache Group. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. All advertising materials mentioning features or use of this + * software must display the following acknowledgment: + * "This product includes software developed by the Apache Group + * for use in the Apache HTTP server project (http://www.apache.org/)." + * + * 4. The names "Apache Server" and "Apache Group" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For written permission, please contact + * apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache" + * nor may "Apache" appear in their names without prior written + * permission of the Apache Group. + * + * 6. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by the Apache Group + * for use in the Apache HTTP server project (http://www.apache.org/)." + * + * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY + * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE GROUP OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * ==================================================================== + * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Group and was originally based + * on public domain software written at the National Center for + * Supercomputing Applications, University of Illinois, Urbana-Champaign. + * For more information on the Apache Group and the Apache HTTP server + * project, please see <http://www.apache.org/>. + * + */ + +/* + * This file will include OS specific functions which are not inlineable. + * Any inlineable functions should be defined in os-inline.c instead. + */ + +#include "httpd.h" +#include "http_core.h" +#include "os.h" + +/* Check the Content-Type to decide if conversion is needed */ +int ap_checkconv(struct request_rec *r) +{ + int convert_to_ascii; + const char *type; + + /* To make serving of "raw ASCII text" files easy (they serve faster + * since they don't have to be converted from EBCDIC), a new + * "magic" type prefix was invented: text/x-ascii-{plain,html,...} + * If we detect one of these content types here, we simply correct + * the type to the real text/{plain,html,...} type. Otherwise, we + * set a flag that translation is required later on. + */ + + type = (r->content_type == NULL) ? ap_default_type(r) : r->content_type; + + /* If no content type is set then treat it as (ebcdic) text/plain */ + convert_to_ascii = (type == NULL); + + /* Conversion is applied to text/ files only, if ever. */ + if (type && (strncasecmp(type, "text/", 5) == 0 || + strncasecmp(type, "message/", 8) == 0)) { + if (strncasecmp(type, ASCIITEXT_MAGIC_TYPE_PREFIX, + sizeof(ASCIITEXT_MAGIC_TYPE_PREFIX)-1) == 0) + r->content_type = ap_pstrcat(r->pool, "text/", + type+sizeof(ASCIITEXT_MAGIC_TYPE_PREFIX)-1, + NULL); + else + /* translate EBCDIC to ASCII */ + convert_to_ascii = 1; + } + /* Enable conversion if it's a text document */ + ap_bsetflag(r->connection->client, B_EBCDIC2ASCII, convert_to_ascii); + + return convert_to_ascii; +} + +int tpf_select(int maxfds, fd_set *reads, fd_set *writes, fd_set *excepts, struct timeval *tv) +{ + int sockets[24]; + int no_reads = 0; + int no_writes = 0; + int no_excepts = 0; + int timeout = 0; + int counter = 0; + int i; + fd_set *temp; + + if(maxfds) { + if(reads) + temp = reads; + else if(writes) + temp = writes; + else if(excepts) + temp = excepts; + else + temp = NULL; + + for(i=0; i<maxfds; i++) { + if(FD_ISSET(i,temp)) { + sockets[counter] = i; + counter++; + } + } + + if(tv) + timeout = tv->tv_sec * 1000 + tv->tv_usec; + + if(reads) + no_reads = counter; + else if(writes) + no_writes = counter; + else if(excepts) + no_excepts = counter; + } + return select(sockets, no_reads, no_writes, no_excepts, timeout); +} + +/* pipe is not yet available on TPF */ +int pipe(int fildes[2]) +{ + errno = ENOSYS; + return(-1); +} + +/* fork and exec functions are not defined on + TPF due to the implementation of tpf_fork() */ + +pid_t fork(void) +{ + errno = ENOSYS; + return(-1); +} + +int execl(const char *path, const char *arg0, ...) +{ + errno = ENOSYS; + return(-1); +} + +int execle(const char *path, const char *arg0, ...) +{ + errno = ENOSYS; + return(-1); +} + +int execve(const char *path, char *const argv[], char *const envp[]) +{ + errno = ENOSYS; + return(-1); +} diff --git a/usr.sbin/httpd/src/os/tpf/os.h b/usr.sbin/httpd/src/os/tpf/os.h new file mode 100644 index 00000000000..9a94bcc96c2 --- /dev/null +++ b/usr.sbin/httpd/src/os/tpf/os.h @@ -0,0 +1,111 @@ +#ifndef APACHE_OS_H +#define APACHE_OS_H + +#define PLATFORM "TPF" + +#ifdef errno +#undef errno +#endif + +/* + * This file in included in all Apache source code. It contains definitions + * of facilities available on _this_ operating system (HAVE_* macros), + * and prototypes of OS specific functions defined in os.c or os-inline.c + */ + +#include "ap_config.h" + +#if !defined(INLINE) && defined(USE_GNU_INLINE) +/* Compiler supports inline, so include the inlineable functions as + * part of the header + */ +#define INLINE extern ap_inline + +INLINE int ap_os_is_path_absolute(const char *file); + +#include "os-inline.c" +#endif + +#ifndef INLINE +/* Compiler does not support inline, so prototype the inlineable functions + * as normal + */ +extern int ap_os_is_path_absolute(const char *file); +#endif + +/* Other ap_os_ routines not used by this platform */ + +#define ap_os_is_filename_valid(f) (1) + +/* Sorry if this is ugly, but the include order doesn't allow me + * to use request_rec here... */ +struct request_rec; +extern int ap_checkconv(struct request_rec *r); + +#ifdef FD_SETSIZE +#undef FD_SETSIZE +#endif + +#define FD_SETSIZE 2048 + +#ifdef __FD_MASK +#undef __FD_MASK +#endif + +typedef long __FD_MASK; + +#ifdef __NBBY +#undef __NBBY +#endif + +#define __NBBY 8 /* number of bits in a byte */ + +#ifdef __NFDBITS +#undef __NFDBITS +#endif + +#define __NFDBITS (sizeof(__FD_MASK) * __NBBY) + +#ifndef __howmany +#define __howmany(x, y) (((x)+((y)-1))/(y)) +#endif + +typedef struct fd_set { + __FD_MASK fds_bits [__howmany(FD_SETSIZE, __NFDBITS)]; +} fd_set; + +#define FD_SET(n, p)((p)->fds_bits[(n)/__NFDBITS] |= (1 <<((n) % __NFDBITS))) + +#define FD_CLR(n, p)((p)->fds_bits[(n)/__NFDBITS] &= ~(1 << ((n) % __NFDBITS))) + +#define FD_ISSET(n, p)((p)->fds_bits[(n)/__NFDBITS] & (1 <<((n) % __NFDBITS))) + +#define FD_ZERO(p) memset((char *)(p), 0, sizeof(*(p))) + + +#define SIGPIPE 13 +#define SIGQUIT 24 +#define SO_KEEPALIVE 0x0008 + +/* TPF doesn't have, or need, tzset (it is used in mod_expires.c) */ +#define tzset() + +#include <stdarg.h> +#undef va_list +#undef va_start +#undef va_arg +#undef va_end + +typedef char *va_list; + +#define __va_promote(type) (((sizeof(type) + sizeof(int) - 1) \ + / sizeof(int)) * sizeof(int)) + +#define va_start(ap, last) (ap = ((char *)&(last) + __va_promote(last))) + +#define va_arg(ap, type) ((type *)(ap += sizeof(type) < sizeof(int) ? \ + (abort(), 0) : sizeof(type)))[-1] + +#define va_end(ap) + +#endif /*! APACHE_OS_H*/ |