Attached is a patch for the 1.3.x htdocs/manual tree to include the
cygwin.html file which describes all aspects of "Using Apache for
Cygwin".

Could someone from the documentation project or an other person with CVS
write permissions check and add the patch to current 1.3 CVS tree. The
diff has been made again latest 1.3.20.

Thanks in advance.

Stipe

[EMAIL PROTECTED]
-------------------------------------------------------------------
Wapme Systems AG

M�nsterstr. 248
40470 D�sseldorf

Tel: +49-211-74845-0
Fax: +49-211-74845-299

E-Mail: [EMAIL PROTECTED]
Internet: http://www.wapme-systems.de
-------------------------------------------------------------------
wapme.net - wherever you are

Title: Using Apache with Cygwin
diff -urN apache_1.3.20/htdocs/manual/cygwin.html apache_1.3.20-cygwin/htdocs/manual/cygwin.html --- apache_1.3.20/htdocs/manual/cygwin.html Thu Jan 1 00:00:00 1970 +++ apache_1.3.20-cygwin/htdocs/manual/cygwin.html Tue Jun 26 12:46:08 2001 @@ -0,0 +1,398 @@ + + + + + + +
+ [APACHE DOCUMENTATION] +

+ Apache HTTP Server +

+
+ + +

Using Apache With Cygwin

+ +

This document explains how to install, configure and run Apache 1.3 under + the Cygwin platform for Microsoft + Windows. Cygwin is a POSIX.1 emulation layer for Microsoft Windows 32-bit + operating systems. + +

The Apache Group does not guarantee that this software will work as + documented, or even at all. If you find any bugs, please document them on + our bug reporting page. + +

Latest development news, pre-compiled distribution binaries and third-party + modules as DLLs may be found at + http://apache.dev.wapme.net/. + Contributions are highly welcome (please see + TODO list), please + submit your code or suggestions to the bug report page, or join the + [EMAIL PROTECTED] mailing list.

+ +

Warning: Apache on Cygwin should be considered as secure and + stable as Apache on NT. Apache still performs best, and is + most reliable on Unix platforms. First benchmarks have shown that + the same Apache setup on Cygwin performs about 30% slower then the + corresponding native Windows version. + +

Most of this document assumes that you have a working Cygwin installation + and want to compile Apache yourself from the orginal distribution + sources. + +


+ + + +
+ + +

History of Apache for Cygwin

+ +

Cygwin support for Apache has been developed since Apache 1.2.6 and + Cygwin b18. +

Due to licensing issues there has not been an official binary distribution + until Red Hat Inc. (former Cygnus Solutions Inc.) changed their Cygwin license + to ensure compiled executables do not fall under GPL license if the distributed + software is considered as open source. +

Cygwin is supported in the official source distributions from Apache 1.3.20 + and on. Pre-compiled binaries for the Cygwin platform (without the + cygwin1.dll) will be supplied at + http://www.apache.org/httpd for each + released version. + + +

Differences to Apache for Windows (native)

+

Both versions, Apache for Windows and Apache for Cygwin are designed to run + on the same operating systems, the Windows NT and Windows 2000 family. But + there are considerable differences for those. +

While Apache for Windows is a native Windows port, Apache for Cywin relies on + the Cygwin POSIX.1 emulation layer provided by the cygwin1.dll + dynamic library to fake a Unix compliant enviroment. Therefore we consider + Apache for Cygwin more closer to the Unix side then to the Windows side, even + while it runs on Windows. +

Most significant differences are the ammount of changes to the source code + needed to compile and run Apache on the Cygwin platform. While the native + Windows port needs huge changes and platform specific additions, the Cygwin + based port changes are very small and most of the present source code can + be used without major changes on the Cygwin platform. + +

When to use Apache for Cygwin and/or Apache for Windows?
+ Apache for Cygwin is considered to be very usefull if you want a seamless + transition from Unix sytems to Windows systems for your HTTP services. +

If you are using Windows NT or Windows 2000 for development and office + purposes, but your productive HTTP server environments are Unix based systems + you may use Apache for Cygwin to develop on Windows and simply copy the whole + Apache configurations (i.e. httpd.conf) and Perl + (mod_perl), PHP (mod_php) or Python + (mod_snake) applications to your productive Unix systems. + +

What about modules (mod_foo) for Apache for Cygwin?
+ Apache for Cygwin can be build with most of the available Apache modules with + no or very few effort in changes. Most popular modules have been compiled and + tested with Apache for Cygwin, including mod_dav, mod_ssl, mod_php, mod_perl, + mod_gzip, mod_jserv. +

While there are developers that support the Windows native port of Apache, very + fiew module developers do. That is why it is usually very hard to make a Unix + based Apache installation with different modules work the same way on the + Windows side using the native port. Apache for Cygwin makes it possible. + +

What are the differences for the configuration files?
+ While the Apache for Windows port uses Windows native path names to refer a + specific file or directory, like +

+  # httpd.conf (for Windows)
+  DocumentRoot "c:/apache/htdocs"
+
+ Apache for Cygwin can use unmodified + POSIX style path names like +
+  # httpd.conf (for Cygwin)
+  DocumentRoot "/usr/local/apache/htdocs"
+
+ +

What about performance?
+ Apache for Cygwin is and should be considered not as performative as Apache + for Windows on the same hardware architecture. +

This is trivial, because Cygwin emulates a Unix enviroment on a + "foreign" operating system, while Apache for Windows runs in it's own native + environment. First benchmark results have shown that Apache for Cygwin is + about 30% slower then his native Apache for Windows counterpart. + + + + +

Requirements

+ +

This Apache 1.3 port for Cygwin is designed to run on Windows NT 4.0 and + Windows 2000, NOT on Windows 95 and 98. Windows NT 4.0 + and Windows 2000 have both been successfully tested and approved. + In all cases TCP/IP networking must be installed.

+ +

Cygwin 1.x is required to compile and run this version. Cygwin 1.1.8 + and 1.3.2 have been tested and approved on both supported OS. + +

Note:If you want to compile shared DLL modules using + apxs you will need a + patched version of ld.exe with --auto-import + support which can be found + here.

+ + +

Downloading Apache for Cygwin

+ +

The Cygwin platform is supported out-of-the-box for Apache 1.3.20 and + on. This means there is no extra download required for the Cygwin + platform. The latest version of Apache can be found on the + Apache web server at + http://www.apache.org/httpd.This will list the current release, + any more recent alpha or beta-test releases, together with details + of mirror web and anonymous FTP sites.

+ + +

Configuring and installing Apache for Cygwin

+ +

Apache on Cygwin is configured and compiled the same way as on Unix + systems. Refer to the general configuration + and installation documents for details. + +

There are three ways in configuring and building Apache for Cygwin, + depending on how additional Apache modules should be used:

+ +
    + +
  • Static linked version +

    To build a static linked version of httpd including + additional modules you will have to give the following statements to + the shell: +

    +  $ cd apache_1.3.x
    +  $ ./configure [--enable-module=module|--add-module=/path/to/module]
    +  $ make
    +
    + This will produce the required extra libaries or object files for + module and link everything to src/httpd.exe.

    + +
  • Shared core DLL linked version (one for all version) +

    To build a DLL version of httpd including additional + modules you have to give the following statements to the shell: +

    +  $ cd apache_1.3.x
    +  $ ./configure --enable-rule=SHARED_CORE \
    +       [--enable-module=module|--add-module=/path/to/module]
    +  $ make
    +  $ make install
    +
    + + This will produce the required extra libraries or object files which hold all + static linked code. Then dllwrap and dlltool will + export all of those (including any added extra module code) to the shared + libhttpd.dll and create the libhttpd.a import + library which is required for linking httpd.exe.

    + +
  • Shared DLL modules linked version +

    This method is currently ONLY supported using + a patched version of ld.exe. Please see the + requirements section on where to get that version. + +

    To build a dynamic loadable DLL version of httpd which can + load DLL modules on the fly while runtime you have to proceed as follows:

    + +
      + +
    • First build Apache's shared core giving the following statements + to the shell: +

      +  $ cd apache_1.3.x
      +  $ ./configure --enable-rule=SHARED_CORE --enable-module=so \
      +       [--enable-module=module|--add-module=/path/to/module] \
      +       [--enable-shared=module]
      +  $ make
      +  $ make install
      +
      + Now the make process will break when trying to compile the + shared module defined using --enable-shared. You will have + to use a work-around, due to the fact that currently there is no + src/libhttpd.dll build that is required to link against the + shared module.

      + +
    • Place an empty file to satisfy make and + restart the make process again: +
      +  $ touch /path/to/module.so
      +  $ make
      +  $ make install
      +
      + This will build the core dynamic library libhttpd.dll as + described in the previous build alternative.

      + +
    • Now we have to link the shared module against that library: +
      +  $ cd /path/to/module
      +  $ gcc --shared -o module.dll module.lo /path/to/libhttpd.dll
      +
      + The build shared DLL module has to be placed to Apache's installation + bindirectory where libhttpd.dll goes too.

      + +
    • Add configuration directives to conf/httpd.conf to load +and activate shared DLL modules while runtime: +
      +  # httpd.conf
      +  [...]
      +  LoadModule foo_module	bin/mod_foo.dll
      +  AddModule mod_foo.c
      +  [...]
      +
      + +
    + + The above steps have to be repeated for each shared DLL module you want + to create.

    + +
  • Using apxs to create shared DLL modules +

    To make the extension process of your httpd using + shared DLL modules easier you may use the + apxs tool. + +

    Make sure you have configured $CFG_LDFLAGS_SHLIB within + apxs to include the --shared directive and + the path to the shared code DLL libhttpd.dll. + +

    Now you shoud be able to create a shared DLL module from a mod_foo.c + source code file with: +

    +  $ apxs -c mod_foo.c -o mod_foo.dll
    +
    + Place the created DLL file to Apache's bin directory, so + the dlopen() function within the compiled in mod_so.c + module can find and load it while runtime. + +
+ + +

Running Apache for Cygwin

+ +

Apache on Cygwin can be started and stoped in the same manner + as on Unix systems. You may also use the + apachectl tool for + starting and stoping Apache. + +

    + +
  • Starting Apache +

    If installed to the default Apache layout directory you can start + httpd as follows: +

    +  $ /usr/local/apache/bin/httpd
    +
    + An explicit background & indicator is not required. The + resulting parent process is detached from the current terminal. + Check the global error_log to see if Apache has started + cleanly without any major problems.

    + +
  • Stopping Apache +

    To stop Apache send at least a SIGTERM sginal to the + parent httpd process: +

    +  $ kill -TERM `cat /usr/local/apache/logs/httpd.pid`
    +
    + +
  • Gracefully re-starting Apache +

    In order to update configuration directives and hence reload the given + httpd.conf configuration file you may send a SIGHUP + to the parent httpd process: +

    +  $ kill -HUP `cat /usr/local/apache/logs/httpd.pid`
    +
    + + +
+ + +

Running Apache for Cygwin as a Service

+ +

Apache on Cygwin can be invoked as Windows NT or Windows 2000 service. + Cygwin has its own cygrunsrv.exe facility to define, remove, + start and stop services as follows: + +

    +
  • Installing Apache as a new Service +

    Use the following statement to install the httpd.exe as a new + service: +

    +  $ cygrunsrv -I service_name-p /usr/local/apache/bin/httpd.exe [-a arguments] \
    +      [-e VAR=VALUE] [-t auto|manual] [-u user] [-w passwd]
    +
    + Where -a is used to pass command line arguments to + httpd.exe, like -DFOO defines and -e + is used to pass environment variables to the starting environment. If necessary + you may use the -t options to set the starting type of the service. + If you want the new service to run under a different user you will have to supply + necessary arguments for the -u and -w options.

    + +
  • Starting Apache as a Service +

    After the new service is installed it can be started using the following + command: +

    +  $ cygrunsrv -S service_name
    +
    + Check your process table and global error_log file to ensure Apache + has started without any major problems.

    + +
  • Stoping Apache Service +

    A running Apache service may be stopped using the following comand: +

    +  $ cygrunsrv -E service_name
    +
    + This will stop all running httpd.exe processes and shutdown the HTTP + service for the machine.

    + +
  • Removing Apache Service +

    An installed Apache service may be removed from the internal service invokation + table of Windows NT or Windows 2000 using the following comand: +

    +  $ cygrunsrv -R service_name
    +
    + This will remove your previously defined and installed service from the machine.

    + +
+ +

Please refer to the corresponding man page of cygrunsrv and + the Cygwin mailing list for further details of how services are invoked.

+ + + +

Any additional contributions to this document and the Cygwin support + for Apache are highly welcome. Please send them to Stipe Tolj + <[EMAIL PROTECTED]>. + + + + +


+

+ Apache HTTP Server +

+ +Index + + + + diff -urN apache_1.3.20/htdocs/manual/index.html.en apache_1.3.20-cygwin/htdocs/manual/index.html.en --- apache_1.3.20/htdocs/manual/index.html.en Sat Feb 17 05:22:44 2001 +++ apache_1.3.20-cygwin/htdocs/manual/index.html.en Tue Jun 26 08:12:34 2001 @@ -109,7 +109,8 @@ Platform Specific Notes -Microsoft Windows +Microsoft Windows | +Cygwin Novell Netware 5 diff -urN apache_1.3.20/htdocs/manual/index.html.fr apache_1.3.20-cygwin/htdocs/manual/index.html.fr --- apache_1.3.20/htdocs/manual/index.html.fr Wed Feb 28 10:45:36 2001 +++ apache_1.3.20-cygwin/htdocs/manual/index.html.fr Tue Jun 26 08:04:26 2001 @@ -99,7 +99,8 @@ Notes li�es aux plates-formes -Microsoft Windows +Microsoft Windows | +Cygwin Novell Netware 5 diff -urN apache_1.3.20/htdocs/manual/index.html.html apache_1.3.20-cygwin/htdocs/manual/index.html.html --- apache_1.3.20/htdocs/manual/index.html.html Tue May 15 16:45:14 2001 +++ apache_1.3.20-cygwin/htdocs/manual/index.html.html Tue Jun 26 07:54:44 2001 @@ -109,7 +109,8 @@ Platform Specific Notes -Microsoft Windows +Microsoft Windows | +Cygwin Novell Netware 5 diff -urN apache_1.3.20/htdocs/manual/index.html.ja.jis apache_1.3.20-cygwin/htdocs/manual/index.html.ja.jis --- apache_1.3.20/htdocs/manual/index.html.ja.jis Tue Jan 23 23:18:28 2001 +++ apache_1.3.20-cygwin/htdocs/manual/index.html.ja.jis Tue Jun 26 08:04:20 2001 @@ -107,7 +107,8 @@ $B%W%i%C%H%U%)!<%`8GM-$N>pJs(B -Microsoft Windows +Microsoft Windows | +Cygwin Novell Netware 5 diff -urN apache_1.3.20/htdocs/manual/install.html.en apache_1.3.20-cygwin/htdocs/manual/install.html.en --- apache_1.3.20/htdocs/manual/install.html.en Wed Mar 28 21:25:42 2001 +++ apache_1.3.20-cygwin/htdocs/manual/install.html.en Tue Jun 26 08:04:50 2001 @@ -23,6 +23,7 @@ distribution. For compiling and installation on specific platforms, see

Reply via email to