Apache full install

Go Back
Braindump Index
Braindump Home

Download:
Apache http://www.apache.org/dist/httpd
PHP http://www.php.net/downloads.php
open_ssl http://www.openssl.org/source/
mod_ssl http://www.modssl.org
mod_perl http://perl.apache.org/dist/
mod_gzip http://www.remotecommunications.com/apache/mod_gzip/

My build-apache.sh shell script:
Requires: pre-downloaded (.tar.gz) copies of Apache, PHP, mod_perl
Optional: mod_ssl, mod_iprot, mod_auth_mysql
Unzips sources, configures available modules (from the current directory) and builds Apache.

  1. Unzip all sources.

  2. Make sure OpenSSL is already installed
    ./config && make && make install

  3. cd apache-1.3.*
    ./configure --prefix=/usr/local/apache --disable-module=asis --disable-module=imap

  4. cd ../php-4.0*
    ./configure --with-apache=../apache_1.3.* --with-mysql --enable-track-vars --enable-trans-sid [ --with-gd=/usr/local/gd ] && make && make install

  5. cd ../mod_ssl*
    ./configure --with-apache=../apache_1.3*

  6. cd ../mod_perl*
    perl Makefile.PL DO_HTTPD=1 USE_APACI=1 EVERYTHING=1 \
    APACHE_PREFIX=/usr/local/apache \
    APACI_ARGS=--disable-module=imap,--disable-module=asis,--enable-module=ssl,--enable-module=rewrite,--activate-module=src/modules/php4/libphp4.a,--enable-module=so
    make && make test   Normally I never do 'make test', but I've had enough installs fail for various resons that I do it now for the Apache install.

    make install


[ On the BSDI 3 machine that wouldn't compile Apache (no rule to make target), I just took out the --enable-module=ssl from the line above and used PHP3 ]

Interesting Apache modules:

For others use http://modules.apache.org

mod_gzip A free module for compressing HTML before it travels to the browser. Reduces the size of an HTML page thereby increasing the transfer speed.
http://www.remotecommunications.com/apache/mod_gzip/
[ copy into apache-1.3.*/src/modules/mod_gzip --add-module=src/modules/mod_gzip/mod_gzip.c ]

<IfModule mod_gzip.c>
        mod_gzip_on Yes
        mod_gzip_dechunk yes
        mod_gzip_temp_dir /var/tmp
        mod_gzip_keep_workfiles No
        mod_gzip_item_include       file .htm
        mod_gzip_item_include       file .html
        mod_gzip_item_include       file .php
        mod_gzip_item_include       file .php3
        mod_gzip_item_include       mime text/.*
        LogFormat "%h %l %u %t \"%r\" %>s %b mod_gzip: %{mod_gzip_compression_ratio}npct." common_with_mod_gzip_info1
        LogFormat "%h %l %u %t \"%r\" %>s %b mod_gzip: %{mod_gzip_result}n In:%{mod_gzip_input_size}n Out:%{mod_gzip_output_size}n:%{mod_gzip_compression_ratio}npct." common_with_mod_gzip_info2
        CustomLog logs/mod_gzip.log  common_with_mod_gzip_info2
</IfModule>

mod_iprot A commercial module which watches for username and password abuse (shared usernames, brute force cracking, etc).
http://www.digital-concepts.net/cgi-iprotect.html
[ untar into apache-1.3.*/src/modules/iprot --add-module=src/modules/iprot/mod_iprot.c ]

mod_auth_mysql This module will allow a browser to authenticate (via .htaccess) against a MySQL database, rather than the usuall flat file.
http://bourbon.netvision.net.il/mod_auth_mysql/ (Web page seems to have disappeared)
[ ./configure --with-apache=../apache-1.3.* --with-mysql=/usr/local/mysql ]
[ --activate-module=src/modules/auth_mysql/libauth_mysql.a ]
Notes: If you're are compiling with a recent version of Apache (and why wouldn't you be!), you need to apply this patch:
Start of auth_mysql.patch:


--- mod_auth_mysql-2.20/apMakefile.tmpl Sat Oct  3 00:13:33 1998
+++ mod_auth_mysql-2.20-changed//apMakefile.tmpl        Thu Nov 16 16:35:43
2000
@@ -66,7 +66,7 @@

 # DO NOT REMOVE
 mod_auth_mysql.o: mod_auth_mysql.c $(INCDIR)/httpd.h $(INCDIR)/conf.h \
- $(INCDIR)/alloc.h $(INCDIR)/buff.h \
+ $(INCDIR)/ap_alloc.h $(INCDIR)/buff.h \
  $(INCDIR)/http_config.h \
  $(INCDIR)/http_core.h $(INCDIR)/http_main.h \
  $(INCDIR)/http_protocol.h $(INCDIR)/http_request.h \


cd .. outside your mod_auth_mysql source directory
patch -p0 < auth_mysql.patch

mod_watch This module will watch and collect the bytes in & out per virtual host and per file owner, similar to some information collected by routers, switches, and network interfaces. This module was designed for use with MRTG, which will make nice graphical representations of the data.
http://www.snert.com/Software/mod_watch/

mod_throttle This Apache module is intended to reduce the load on your server & bandwidth generated by popular virtual hosts, directories, locations, or users according to supported polices (see below) that decide when to delay or refuse requests. Also mod_throttle can track and throttle incoming connections by IP address or by authenticated remote user.
http://www.snert.com/Software/mod_throttle/
[ --add-module=../mod_throttle-3.*/mod_throttle.c,--disable-shared=throttle ]
Notes: Only seems to delay requests - but doesn't actually limit bandwidth. Doesn't work with large files, only html and small graphics.



Last modified: Wednesday, December 31 1969 @ 19:00 EST
Google
WWW braindump.MrZesty.net
© Ian Samuel, 2010
http://braindump.MrZesty.net