This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[PATCH] b19.1: Apache 1.3.1


 <<about-apache-1.3.1-cygwin32.txt>>  <<patch-apache-1.3.1-cygwin32.txt>> 
Here's a miminal patch for Apache 1.3.1 to build and run in the Cygnus
b19.1 environment.

It minimally works. CGI is untested. I haven't used it for any
serious web serving. I just browsed the local copy of the
Apache documentation.

I was very conservative in my assumptions in ap_config.h. I'll
look at these closer after I do some more testing.

Feedback appreciated.

-Charles

Charles Randall
crandall@matchlogic.com


Building Apache 1.3.1 with Cygwin32 b19.1
-----------------------------------------
(A 12 step plan...)

July 27th, 1998

Charles F. Randall
crandall@matchlogic.com

This patch kit allows Apache 1.3.1 to compile and run in the Cygwin b19.1
development environment. This requires that you have the CDK (Cygwin
Development Kit) installed. If you don't, get it and install it.

This has only been tested on Windows NT 4.0 Server with Service Pack 3
applied. It will most likely work fine on NT 4.0 Workstation/sp3. I don't
know if it will work on Window95 or Windows98. Please don't ask me about
Windows95 or Windows98. I don't have access to machines running either of
them.

--------------------------------------------------------------------------
WARNING: You should know how to build, configure, and use Apache on a UNIX
system before attempting this. I'm not going to answer questions like,
"What's patch? How do I use it?". If you're that type of user, download
IIS or PWS from Micro$oft and use it instead.

This is intended for developers only. If it sets your machine on fire,
I'm not responsible for it.
--------------------------------------------------------------------------

Assuming that your Cygwin32 development environment is configured properly,
follow these steps to build Apache 1.3.1:

1. Create /tmp if you haven't already.

2. Symlink /bin to your Cygwin32 'bin' directory. This will make your life
   easier. (so that #!/bin/sh, etc work as expected)

3. Get the Apache 1.3.1 distribution via anonymous ftp from
   ftp://ftp.apache.org/apache/dist/apache_1.3.1.tar.gz

4. Gunzip and un-tar in a temporary directory.

5. Change directory to apache_1.3.1/src

6. Copy patch file to apache_1.3.1/src

7. Patch source. E.g.,

     $ patch -u -p0 < patch-apache-1.3.1-cygwin32.txt

   The output of that command should look like this:
   
     patching file `helpers/GuessOS'
     patching file `Configure'
     patching file `Configuration'
     patching file `main/http_main.c'
     patching file `main/http_core.c'
     patching file `include/ap_config.h'
  
   If it doesn't, either you've done something wrong or your Cygwin32
   environment isn't installed or operating correctly. Do not continue.

8. Run Configure manually using bash (it core dumps with sh).
   Should take a minute or two (300 MHz P-II). E.g.,

     $ bash ./Configure

   The output of that command should look like this:
   
     Using config file: Configuration
     Creating Makefile
      + configured for Cygwin32 platform
      + setting C compiler to gcc
      + adding selected modules
      + checking for system header files
      + doing sanity check on compiler and options
     Creating Makefile in support
     Creating Makefile in main
     Creating Makefile in ap
     Creating Makefile in regex
     Creating Makefile in os/unix
     Creating Makefile in modules/standard
     
   If it doesn't, either you've done something wrong or your Cygwin32
   environment isn't installed or operating correctly. Do not continue.

9. Run 'make'. Should take another minute or two.

10. Verify that the executable minimally works by listing the compiled-in modules.

  $ ./httpd.exe -l
  
  Output should look like:
  
    Compiled-in modules:
    http_core.c
    mod_env.c
    mod_log_config.c
    mod_mime.c
    mod_negotiation.c
    mod_include.c
    mod_autoindex.c
    mod_dir.c
    mod_cgi.c
    mod_asis.c
    mod_imap.c
    mod_actions.c
    mod_userdir.c
    mod_alias.c
    mod_access.c
    mod_setenvif.c
  
11. Edit httpd.conf, srm.conf, and access.conf as usual. (See hints below).

12. Start the server.


Hints
-----

When editing httpd.conf, srm.conf, and access.conf, do the following:

o Don't use the "*-win" conf files. They're for the native Win32 release.

o Don't use UNC-style names for drive access (e.g., //d/some/dir). Instead,
  use 'mount' to mount them to a "normal" Unix-like path.

o In httpd.conf, use these User and Group directives:

    User  #500
    Group #100

o In httpd.conf, use your IP address for the ServerName if you don't have
  DNS configured properly (shame on you!).


Known Problems
--------------

o CGI is untested.

-Charles
crandall@matchlogic.com
--- helpers/backup/GuessOS	Sun Jul 26 20:43:29 1998
+++ helpers/GuessOS	Sun Jul 26 20:42:09 1998
@@ -230,7 +230,8 @@
     *:4.0:2:*)
 	echo "whatever-unisys-sysv4"; exit 0;
 	;;
-
+    CYGWIN32_*:*86)
+        echo "x86-gnu-cygwin32"; exit 0;
 esac
 
 #
--- backup/Configure	Sun Jul 26 20:47:31 1998
+++ Configure	Sun Jul 26 20:54:17 1998
@@ -698,6 +698,11 @@
         DEF_WANTHSREGEX=yes
         LIBS="$LIBS -lsocket -lnsl -lc -L/usr/ucblib -lucb"
         ;;
+    x86-gnu-cygwin32)
+        OS='Cygwin32'
+	CFLAGS="$CFLAGS -DCYGWIN32"
+	DEF_WANTHSREGEX=yes
+	;;
     *) # default: Catch systems we don't know about
         OS='Unknown and unsupported OS'
     	echo Sorry, but we cannot grok \"$PLAT\"
--- backup/Configuration	Mon Jul 27 20:59:05 1998
+++ Configuration	Sat Jul 25 23:02:07 1998
@@ -304,7 +304,7 @@
 ## Access control and authentication modules. 
 ##
 AddModule modules/standard/mod_access.o
-AddModule modules/standard/mod_auth.o
+#AddModule modules/standard/mod_auth.o
 
 ## The anon_auth module allows for anonymous-FTP-style username/ 
 ## password authentication.
--- main/backup/http_main.c	Sat Jul 25 22:09:51 1998
+++ main/http_main.c	Sun Jul 26 20:55:49 1998
@@ -113,9 +113,9 @@
 #include <sys/audit.h>
 #include <prot.h>
 #endif
-#ifdef WIN32
+#if defined(WIN32)
 #include "../os/win32/getopt.h"
-#elif !defined(BEOS)
+#elif !defined(BEOS) && !defined(CYGWIN32)
 #include <netinet/tcp.h>
 #endif
 
--- main/backup/http_core.c	Sun Jul 26 22:22:31 1998
+++ main/http_core.c	Sun Jul 26 22:21:49 1998
@@ -2588,7 +2588,7 @@
         return METHOD_NOT_ALLOWED;
     }
 	
-#if defined(__EMX__) || defined(WIN32)
+#if defined(__EMX__) || defined(WIN32) || defined(CYGWIN32)
     /* Need binary mode for OS/2 */
     f = ap_pfopen(r->pool, r->filename, "rb");
 #else
--- include/backup/ap_config.h	Sun Jul 26 21:50:25 1998
+++ include/ap_config.h	Sun Jul 26 21:59:23 1998
@@ -753,6 +753,19 @@
 
 /* All windows stuff is now in os/win32/os.h */
 
+#elif defined(CYGWIN32)
+/* Cygnus Cygwin32 - http://www.cygnus.com/misc/gnu-win32/ */
+# define NO_SHMGET
+# define NO_MMAP
+# define NO_KILLPG
+# define NO_SETSID
+# define NO_USE_SIGACTION
+# define NO_LINGCLOSE
+# define NO_SLACK
+# define NO_OTHER_CHILD
+# define NO_RELIABLE_PIPED_LOGS
+/* end CYGWIN32 */
+   
 #else
 /* Unknown system - Edit these to match */
 #ifdef BSD

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]