LDP/LDP/howto/docbook/Apache-Compile-HOWTO.sgml

1391 lines
42 KiB
Plaintext
Raw Normal View History

2001-10-29 23:22:21 +00:00
<!doctype article public "-//OASIS//DTD DocBook V3.1//EN">
<article>
<artheader>
<title>Apache Compile HOWTO (Linux edition)</title>
<copyright>
<year>2000</year>
<year>2001</year>
<year>2002</year>
2001-10-29 23:22:21 +00:00
<holder>Luc de Louw</holder>
</copyright>
<legalnotice>
<para>
The Apache Compile HOWTO is copyright (C) 2000,2002 by Luc de Louw,
2001-10-29 23:22:21 +00:00
and is released under the terms of the GNU Free Documentation
License, which is hereby incorporated by reference.
</para>
</legalnotice>
<author>
<firstname>Luc</firstname>
<surname> de Louw</surname>
<authorblurb>
<para>
<email>luc@delouw.ch</email>
</para>
</authorblurb>
</author>
<abstract>
<para>
This document describes howto compile the Apache Webserver with the most important
modules like mod_perl, mod_dav, mod_auth_ldap, mod_dynvhost, mod_roaming, mod_jserv, and mod_php</para>
</abstract>
</artheader>
<sect1 id="intro">
<title>Introduction</title>
<sect2>
<title>Contributors and Contacts</title>
<para>First I would thank all those people who send questions and suggestions that made a
further development of this document possible. It shows me, sharing knowledge is the right way.
I would encourage you to send me more suggestion, just write me an email <email>luc@delouw.ch</email>
</para>
</sect2>
<sect2>
<title>Why this document was written</title>
<para>All Linux-distributions I tested, had a bad defaultsetup of Apache. Additionally all major
distributions dont have actual versions of Apache.
</para>
<para>Finally no commercial Unix comes with Apache preinstalled (Why not?)</para>
<para>Since I'm installing a lot of customized webservers on different Un*xes, I wrote a
plaintext document and put it on my website to get access to it at work. Later a friend
posted the URL to a mailinglist, and the first questions arrived. So I decided to put more on the page.</para>
<para>After a lot of people requested the document as an &ldquo;official&rdquo; HOWTO, I decided to do so.</para>
</sect2>
<sect2>
<title>What this document is supposed to be</title>
<para>Compiling all the stuff described below needs to know a lot of configure-options that
nobody can memorize. Its supposed to be a &ldquo;copy-paste-ready&rdquo; text to compile
apache and friends</para>
<para>The second goal of this document is, people should lern how to build a full-featured
Apache-webserver bythemself to be independant from any Linux distributors.</para>
</sect2>
<sect2>
<title>What this document doesn't do for you</title>
<para>Its just a Document, not a script that makes the work for you. You have to do all steps by yourself.</para>
</sect2>
<sect2>
<title>Platforms</title>
<para>The original Document I wrote was for all major Un*x plattforms. Now the HOWTOs are
separated for each Plattforms. You will find the same document adapted for the respective Platform for:</para>
<itemizedlist>
<listitem><para>Linux (This Document)</para></listitem>
2001-10-29 23:22:21 +00:00
<listitem><para>IBM AIX 4.3 and 5.1L</para></listitem>
<listitem><para>Sun Solaris 6/7/8</para></listitem>
<listitem><para>Hewlett-Packard HPUX 11</para></listitem>
<listitem><para>&lcub;Free|Net|Open&rcub;-BSD</para></listitem>
</itemizedlist>
<para>Important Notice for users running Linux on IBM S/390 (zSeries): postgres and Jserv wont compile on that system.
All other programms and modules mentioned in the HOWTO are working perfectly</para>
2001-10-29 23:22:21 +00:00
<para>Other Un*x-platforms: Feel free to create a guest-account for me on your Un*x platform.</para>
<para>Windows-Users: I'm sorry, I'm too young for an heart-attack ;-)</para>
</sect2>
<sect2>
<title>Revision History</title>
<para>
<revhistory>
<revision>
<revnumber>1.9.8</revnumber>
<date>2002-02-08</date>
<revremark>Updates of software mentioned in the HOWTO, and fixed some bugs</revremark>
</revision>
<revision>
<revnumber>1.9.7</revnumber>
<date>2001-12-26</date>
<revremark>Updates of software mentioned in the HOWTO, tested the HOWTO
procedures on Linux running on IBM S/390 (zSeries)
Machines (See "platforms" for more info),
Added some basic support for Tomcat (Binaries only)</revremark>
</revision>
2001-10-29 23:22:21 +00:00
<revision>
<revnumber>1.9.6</revnumber>
<date>2001-10-27</date>
<revremark>Updates of software mentioned in the HOWTO, and fixed some bugs</revremark>
</revision>
<revision>
<revnumber>1.9.5</revnumber>
<date>2001-08-27</date>
<revremark>Yet another rewrite in Docbook 3.1</revremark>
</revision>
<revision>
<revnumber>1.9.4</revnumber>
<date>2001-08-26</date>
<revremark>Updated the Software-Versions metioned in the document, corrected some typos</revremark>
</revision>
<revision>
<revnumber>1.9.3</revnumber>
<date>2001-06-23</date>
<revremark>Current Version 2.0.0-pre3 in Linux DocBook format</revremark>
</revision>
<revision>
<revnumber>1.0.0</revnumber>
<date>2000-08-05</date>
<revremark>First publication of the html-based document</revremark>
</revision>
</revhistory>
</para>
</sect2>
<sect2>
<title>New versions of this document</title>
<para>
The most recent version of this document you will at <ulink url="http://www.delouw.ch/linux/apache.phtml">
http://www.delouw.ch/linux/apache.phtml</ulink></para>
<para>New revisions of this document will be announced at <ulink url="http://freshmeat.net/apacompile">
http://freshmeat.net/apacompile</ulink></para>
</sect2>
<sect2><title>About the author</title>
<para>Luc (in english Luke) is 29 years old, playing around with computers since 20years.
Currently he is working as Unix System Engineer for an IT-corporation located in Kloten (Zurich), Switzerland.
Main-focus is developping all flavours of innovative Systems running on Linux (and other Un*xes .
Further, for all major Un*x platforms all the &ldquo;impossible&rdquo; tasks will end up on his
desk (yes, its funny and he love it!)</para>
</sect2>
</sect1>
<sect1 id="prereqs">
<title>Prerequisites</title>
<sect2><title>General</title>
<itemizedlist>
<listitem><para>flex</para></listitem>
<listitem><para>bison</para></listitem>
<listitem><para>autoconf</para></listitem>
<listitem><para>libtool</para></listitem>
</itemizedlist>
<para>To be continiued</para>
</sect2>
<sect2><title>Distribution specific</title>
<sect3><title>SuSE Linux</title>
<sect4><title>SuSE Linux 7.1 (maybe applicable to other distributions)</title>
<para>SuSE 7.1 and maybe other distributions have problems to build apache 1.3.19
(1.3.20 and later are fixed) with mod_rewrite</para>
<para>To correct this misbehaviour create a symlink:</para>
<screen>cd /usr/include/db1
ln -s ../ndbm.h ndbm.h
</screen>
<para>In SuSE 7.2 and later this issue is fixed</para>
</sect4>
</sect3>
</sect2>
<sect2><title>OpenSSL</title>
<sect3><title>What is OpenSSL</title>
<para>Quoting www.openssl.org</para>
<para><emphasis>The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured,
and Open Source toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1)
protocols as well as a full-strength general purpose cryptography library. The project is managed by a
worldwide community of volunteers that use the Internet to communicate, plan, and develop the OpenSSL toolkit
and its related documentation.</emphasis></para>
<para><emphasis>OpenSSL is based on the excellent SSLeay library developed by Eric A. Young and Tim J. Hudson.
The OpenSSL toolkit is licensed under an Apache-style licence, which basically means that you are free
to get and use it for commercial and non-commercial purposes subject to some simple license conditions.</emphasis></para>
<para><emphasis>From authors poinns of view, its the basic to build a secure Unix-Server with Opensource Software, its needed
for all major products like mod_ssl, OpenSSH and lot of other stuff that provides encrypted Data-processing</emphasis></para>
<para>OpenSSL provides the libraries and include-files needed be the products mentioned above and also provides
a Application to build Server and client-Certificates.</para>
</sect3>
<sect3><title>Download the source</title>
<para>Origin-Site
<ulink url="http://www.openssl.org">http://www.openssl.org</ulink>
</para>
</sect3>
<sect3><title>Building and installing</title>
<screen>cd /usr/local
tar -xvzf openssl-0.9.6c.tar.gz
2001-10-29 23:22:21 +00:00
cd openssl-0.9.6c
2001-10-29 23:22:21 +00:00
./config
make
make test
make install
</screen>
</sect3>
</sect2>
<sect2><title>MySQL</title>
<sect3><title>What is MySQL</title>
<para>
Mysql is a very fast, powerful and very nice to handle Database.</para>
<para>Especially for Webapplication where most datas are read,
any little written, MySQL is the first choice. The newest
Version is also transaction-capable. If you plan a Webapplication,
that writes a lot of Data into the DB, maybe Postgres is
better for you.</para>
<para>Here you need the C-API from Mysql for compiling php if you
wish MySQL-Support in php. Its also needed if you want to use mod_authmysql, See <xref linkend="authmysql"> for more information</para>
</sect3>
<sect3><title>Download</title>
<para>
Origin-Site: <ulink url="http://www.mysql.com/downloads/">http://www.mysql.com/downloads/</ulink>
</para>
</sect3>
<sect3><title>Building and installing</title>
<screen>
cd /usr/local
tar -xvzf mysql-3.23.47.tar.gz
cd mysql-3.23.47
2001-10-29 23:22:21 +00:00
./configure \
--prefix=/usr/local/mysql \
--enable-assembler \
2001-10-29 23:22:21 +00:00
--with-innodb
make
make install
/usr/local/mysql/bin/mysql_install_db
echo /usr/local/mysql/lib/mysql >> /etc/ld.so.conf
ldconfig
</screen>
<para>
For security-improvement add a mysql-user on your system i.e. "mysql", then
</para>
<screen>
chown -R mysql /usr/local/mysql/var
</screen>
<para>
and change the line user=root to user=mysql in the file /usr/local/mysql/bin/safe_mysqld
</para>
<para>
you may wish to start mysql automatically at boottime, copy /usr/local/mysql/share/mysql/mysql.server to /etc/init.d/ (or wherever your rc-script are located) and create the corresponding symbolic link in the runlevel directories.
</para>
</sect3>
</sect2>
<sect2><title>Building mm</title>
<sect3><title>What is mm</title>
<para>Quoting www.engelschall.com</para>
<para>The MM library is a 2-layer abstraction library which simplifies the usage of shared memory between forked
(and this way strongly related) processes under Unix platforms. On the first layer it hides all platform dependent
implementation details (allocation and locking) when dealing with shared memory segments and on the second layer
it provides a high-level malloc(3)-style API for a convenient and well known way to work with data-structures
inside those shared memory segments. </para>
<para>From the authors point of view:</para>
<para>Its a common lib that enables Unix-Programers to simplify shm accesses. Its used by a lot products i.e. PHP and mod_ssl</para>
<para>Since the author is not a programmer, he is unable to explain the exact usage of that stuff</para>
</sect3>
<sect3><title>Download</title>
<para>Origin Site: <ulink url="http://www.engelschall.com/sw/mm/mm-1.1.3.tar.gz">http://www.engelschall.com/sw/mm/mm-1.1.3.tar.gz</ulink>
</para>
</sect3>
<sect3><title>Building and installing</title>
<screen>cd /usr/local
tar -xvzf mm-1.1.3.tar.gz
cd mm-1.1.3
./configure
make
make test
make install
ldconfig
2001-10-29 23:22:21 +00:00
</screen>
</sect3>
</sect2>
</sect1>
<sect1 id="apache">
<title>Getting, build and install Apache with its basic modules</title>
<sect2><title>Get and untar the Apache Source</title>
<sect3><title>What is Apache</title>
<para>Quoting www.apache.org</para>
<para>The Apache Project is a collaborative software development effort aimed at creating a robust, commercial-grade,
featureful, and freely-available source code implementation of an HTTP (Web) server. The project is jointly managed
by a group of volunteers located around the world, using the Internet and the Web to communicate, plan, and develop
the server and its related documentation. These volunteers are known as the Apache Group. In addition, hundreds
of users have contributed ideas, code, and documentation to the project. This file is intended to briefly describe
the history of the Apache Group and recognize the many contributors.</para>
<para>From the authors point of view:</para>
<para>Its simply the best Webserver-Software, its very flexible to configure to match your needs,
and its E-X-T-R-E-M-E stable! I personally never experianced a crash in a productive (=non-experimental stuff) enviroment</para>
<para>Anybody experianced a crash please mail me, your crash-report will be published right here...</para>
</sect3>
<sect3><title>Download the source</title>
<para>Origin-Site
<ulink url="http://www.apache.org/dist/httpd/">http://www.apache.org/dist/httpd/</ulink>
<screen>cd /usr/local/
tar -xvzf apache_1.3.23.tar.gz
2001-10-29 23:22:21 +00:00
</screen>
</para>
</sect3>
<sect3><title>Patch for largescale sites</title>
<para>Download the patch from: <ulink url="http://www.delouw.ch/linux/apache-patch_HARD_SERVER_LIMIT.txt">
http://www.delouw.ch/linux/apache-patch_HARD_SERVER_LIMIT.txt</ulink></para>
<screen>
--- httpd.h-old Wed Jan 31 00:58:19 2001
+++ httpd.h Wed Jan 31 01:09:25 2001
@@ -314,7 +314,7 @@
#ifdef WIN32
#define HARD_SERVER_LIMIT 1024
#else
-#define HARD_SERVER_LIMIT 256
+#define HARD_SERVER_LIMIT 512
#endif
#endif
</screen>
<para>This patch does increase the maximum concurrent accessing clients to 512. Feel free to increase it further,
if you hacked your kernel and edited your /etc/security/limits.conf (this is ONLY for experianced users!
With wrong conditions this could be a &ldquo;self-Denial-of-service-attack&rdquo;!!
Be sure you have enought processes left for root)</para>
<para>Kernel-hack patch will follow as soon as possible</para>
<para>Apply the patch using:</para>
<screen>
cd /usr/local/apache_1.3.23/src/include
2001-10-29 23:22:21 +00:00
patch -p0 &lt; apache-patch_HARD_SERVER_LIMIT.txt
</screen>
</sect3>
</sect2>
<sect2><title>mod_ssl</title>
<sect3><title>What is mod_ssl</title>
<para>Quoting www.modssl.org</para>
<para>This module provides strong cryptography for the Apache 1.3 webserver via the Secure Sockets Layer (SSL v2/v3) and
Transport Layer Security (TLS v1) protocols by the help of the Open Source SSL/TLS toolkit OpenSSL, which is
based on SSLeay from Eric A. Young and Tim J. Hudson.</para>
<para>From the authors point of view:</para>
<para>This module is needed to make enable Apache for SSL-Requests (https) It applies a patch to the Apache
source-code and extends its API</para>
<para>Make sure Any other module for your Apache-Server is compiled with the compiler-flag -DEAPI or your
Webserver maybee crashes or could not be started</para>
<para>Allmost all modules I know do that by themself execpt mod_jserv and mod_jk</para>
</sect3>
<sect3><title>Download the source</title>
<para>Origin-Site:<ulink url="http://www.modssl.org">http://www.modssl.org</ulink></para>
</sect3>
<sect3><title>Applying the patch to the apache source</title>
<screen>cd /usr/local/
tar -xvzf mod_ssl-2.8.6-1.3.23.tar.gz
cd mod_ssl-2.8.6-1.3.23/
2001-10-29 23:22:21 +00:00
./configure &bsol;
--with-apache=/usr/local/apache_1.3.23 &bsol;
2001-10-29 23:22:21 +00:00
--with-ssl=/usr/local/ssl &bsol;
--enable-shared=ssl &bsol;
--with-mm=/usr/local/mm-1.1.3
</screen>
</sect3>
</sect2>
<sect2><title>mod_perl</title>
<sect3><title>What is mod_perl</title>
<para>Quoting perl.apache.org</para>
<para>With mod_perl it is possible to write Apache modules entirely in Perl. In addition, the persistent
interpreter embedded in the server avoids the overhead of starting an external interpreter and the
penalty of Perl start-up time. </para>
<para>From the authors point of view:</para>
<para>mod_perl is some kind of substitute for cgi-bin's. cgi's typically forks for each request a new
process, and produces a lot of overhead, with mod_perl the perl-interpreter is loaded persistant in
the apache-server and does not need to fork any processes for each request</para>
</sect3>
<sect3><title>Download the source</title>
<para>Origin-Site: <ulink url="http://www.apache.org/dist/perl">http://www.apache.org/dist/perl</ulink></para>
</sect3>
<sect3><title>Building and installing</title>
<screen>cd /usr/local
tar -xvzf mod_perl-1.26.tar.gz
cd mod_perl-1.26
perl Makefile.PL &bsol;
EVERYTHING=1 &bsol;
APACHE_SRC=../apache_1.3.23/src &bsol;
2001-10-29 23:22:21 +00:00
USE_APACI=1 &bsol;
PREP_HTTPD=1 &bsol;
DO_HTTPD=1
make
make install
</screen>
<para>Notice: Do not compile mod_perl as dso! According to info's I have, apache will crash (I never tried)</para>
</sect3>
</sect2>
<sect2><title>Configure and build Apache</title>
<para>Now the two static modules mod_ssl and mod_perl are configured and the Apache Source has been patched</para>
<sect3><title>Building and installing</title>
<screen>
EAPI_MM=&quot;/usr/local/mm-1.1.3&quot; SSL_BASE=&quot;/usr/local/ssl&quot; &bsol;
./configure &bsol;
--enable-module=unique_id &bsol;
--enable-module=rewrite &bsol;
--enable-module=speling &bsol;
--enable-module=expires &bsol;
--enable-module=info &bsol;
--enable-module=log_agent &bsol;
--enable-module=log_referer &bsol;
--enable-module=usertrack &bsol;
--enable-module=proxy &bsol;
--enable-module=userdir &bsol;
--enable-module=so &bsol;
--enable-shared=ssl &bsol;
--enable-module=ssl &bsol;
--activate-module=src/modules/perl/libperl.a &bsol;
--enable-module=perl
make
make install
</screen>
</sect3>
<sect3><title>Create self-signed SSL-certificate</title>
<screen>
cd /usr/local/ssl/bin
./openssl req -new &gt; new.cert.csr
./openssl rsa -in privkey.pem -out new.cert.key
./openssl x509 -in new.cert.csr -out new.cert.cert -req -signkey new.cert.key -days 999
cp new.cert.key /usr/local/apache/conf/ssl.key/server.key
cp new.cert.cert /usr/local/apache/conf/ssl.crt/server.crt
</screen>
<para>
Notice: OpenSSL asks you different things, an error often done is enter a wrong &quot;common name&quot;.
This is the fully qualified hostname of your Server i.e www.foo.org</para>
</sect3>
</sect2>
<sect2><title>mod_dav</title>
<sect3><title>What is mod_dav</title>
<para>Quoting www.webdav.org</para>
<para>mod_dav is an Apache module to provide DAV capabilities (RFC 2518) for your Apache web server. It is an
Open Source module, provided under an Apache-style license.</para>
<para>mod_dav is maintained by gstein@lyra.org</para>
<para>From the authors point of view:</para>
<para>DAV means: &quot;Distributed authoring and Versioning&quot; It allows you to manage your Website similar
to a filesystem. Its meant to replace ftp-uploads to your Webserver.</para>
<para>DAV is supported by all major Web-developpment-Tools (newer Version) and is going to be a widly accepted
standart for Web-publishing</para>
</sect3>
<sect3><title>Download the source</title>
<para>Origin-Site: <ulink url="http://www.webdav.org/mod_dav/">http://www.webdav.org/mod_dav/</ulink></para>
</sect3>
<sect3><title>Building and installing</title>
<screen>
cd /usr/local
tar -xvzf mod_dav-1.0.3-1.3.6.tar.gz
cd mod_dav-1.0.3-1.3.6
2001-10-29 23:22:21 +00:00
./configure --with-apxs=/usr/local/apache/bin/apxs
make
make install
</screen>
<para>Notice: the filename mod_dav-1.0.3-1.3.6 suggests that it will only run with apache 1.3.6 but it
2001-10-29 23:22:21 +00:00
means it will run with all apaches &gt;= 1.3.6</para>
</sect3>
</sect2>
<sect2><title>auth_ldap</title>
<sect3><title>What is auth_ldap</title>
<para>Quoting www.rudedog.org</para>
<para>auth_ldap is an LDAP authentication module for Apache, the world's most popular web server.
auth_ldap has excellent performance, and supports Apache on both Unix and Windows NT. It
also has support for LDAP over SSL, and a mode that lets Micros&tilde;1 Frontpage clients manage
their web permissions while still using LDAP for authentication. </para>
<para>From the authors point of view:</para>
<para>If you like to consolidate your login-facilities to a common user/passwd base, LDAP is the right
way. LDAP is an open standart and widly supported.</para>
<para>Login-facilities for LDAP:</para>
<para>Unix-Logins for Linux, Solaris (others?) FTP-Logins (some ftp-daemons) http Basic Authentication Tarantella
Authentication and Role-Management Samba Authentication (2.2.x should support this, the author is currently leading a project
to try that pls standby) Others I forgot to mention :-) LDAP is role based, that means, you can define
a role &quot;manager&quot; assign a user as member and that user can login wherever a manager is allowed to login</para>
</sect3>
<sect3><title>Download the source</title>
<para>Origin-Site: <ulink url="http://www.rudedog.org/auth_ldap/">http://www.rudedog.org/auth_ldap/</ulink></para>
</sect3>
<sect3><title>Building and installing</title>
<screen>
cd /usr/local
tar -xvzf auth_ldap-1.6.0.tar.gz
cd auth_ldap-1.6.0
./configure --with-apxs=/usr/local/apache/bin/apxs &bsol;
--with-sdk=openldap
make
make install
</screen>
</sect3>
</sect2>
<sect2 id="authmysql"><title>mod_auth_mysql</title>
<sect3><title>What is mod_auth_mysql</title>
<para>Its an http-Basic Authentication Module. It allows you to maintain your user comfortable in a MySQL-Database</para>
</sect3>
<sect3><title>Download the source</title>
<para>Origin-Site: <ulink url="ftp://ftp.kciLink.com/pub/mod_auth_mysql.c.gz">ftp://ftp.kciLink.com/pub/mod_auth_mysql.c.gz</ulink></para>
</sect3>
<sect3><title>Building and installing</title>
<screen>
gunzip mod_auth_mysql.c.gz
/usr/local/apache/bin/apxs &bsol;
-c -I/usr/local/mysql/include &bsol;
2001-10-29 23:22:21 +00:00
-L/usr/local/mysql/lib/mysql &bsol;
-lmysqlclient -lm mod_auth_mysql.c
cp mod_auth_mysql.so /usr/local/apache/libexec/
</screen>
<para>
Add this line in your httpd.conf:
</para>
<screen>
LoadModule mysql_auth_module libexec/mod_auth_mysql.so
</screen>
<para>
And where the other modules were added:
</para>
<screen>AddModule mod_auth_mysql.c
</screen>
<para>Take care that the path of Mysql libs and includes are correct!</para>
<para>Notice: Be sure that /usr/local/mysql/lib/mysql is in /etc/ld.so.conf befor compiling</para>
<para>Use AuthMySQLCryptedPasswords Off or it does not work! (under investigation why not)</para>
</sect3>
<sect3><title>Sample configuration</title>
<sect4><title>/usr/local/apache/conf/httpd.conf</title>
<screen>
&lt;location /manual/&gt;
AuthType Basic
AuthUserfile /dev/null
AuthName Testing
AuthGroupFile /dev/null
AuthMySQLHost localhost
AuthMySQLCryptedPasswords Off
AuthMySQLUser root
AuthMySQLDB users
AuthMySQLUserTable user_info
&lt;Limit GET POST&gt;
require valid-user
&lt;/limit&gt;
&lt;/location&gt;
</screen>
</sect4>
<sect4><title>Script for creating the MySQL-Database</title>
<para>
just type:
</para>
<screen>
mysql < authmysql.sql
</screen>
<para>
The File authmysql.sql contents:</para>
<screen>
create database http_users;
connect http_users;
CREATE TABLE user_info (
user_name CHAR(30) NOT NULL,
user_passwd CHAR(20) NOT NULL,
user_group CHAR(10),
PRIMARY KEY (user_name);
</screen
</sect4>
</sect3>
</sect2>
<sect2><title>mod_dynvhost</title>
<sect3><title>What is mod_dynvhost</title>
<para>Its a small module that allows you to define new Vritual Host &quot;on-the-fly&quot; just create a
new Directoy in your vhost-path, thats it. You dont need to restart your Webserver</para>
<para>Its maybe a good solution for Mass-Virtual-hosting for ISP's</para>
</sect3>
<sect3><title>Download the source</title>
<para>Origin-Site: <ulink url="http://funkcity.com/0101/projects/dynvhost/mod_dynvhost.tar.gz">
http://funkcity.com/0101/projects/dynvhost/mod_dynvhost.tar.gz</ulink>
</para>
</sect3>
<sect3><title>Builing and installing</title>
<screen>
cd /usr/local
tar -xvzf mod_dynvhost.tar.gz
cd dynvhost/
/usr/local/apache/bin/apxs -i -a -c mod_dynvhost.c
</screen>
<para>Notice: Take a look in httpd.conf if mod_dynvhost.so is loaded at startup: </para>
<screen>
LoadModule dynvhost_module libexec/mod_dynvhost.so
</screen>
</sect3>
<sect3><title>Sample configuration</title>
<sect4><title>/usr/local/apache/conf/httpd.conf</title>
<screen>
&lt;DynamicVirtualHost /usr/local/apache/htdocs/vhosts/&gt;
HomeDir /
&lt;/DynamicVirtualHost&gt;
</screen>
<para>Now create a Directory for each virtualhost in /usr/local/apache/htdocs/vhosts/</para>
<para>i.e.</para>
<para>/usr/local/apache/htdocs/vhosts/foo.bar.org</para>
<para>You dont need to restart your Webserver</para>
</sect4>
</sect3>
</sect2>
<sect2><title>mod_roaming</title>
<sect3><title>What is mod_roaming</title>
<para>Quoting www.klomp.org/mod_roaming/</para>
<para>With mod_roaming you can use your Apache webserver as a Netscape Roaming Access server. This allows
you to store your Netscape Communicator 4.5 preferences, bookmarks, address books, cookies etc. on the
server so that you can use (and update) the same settings from any Netscape Communicator 4.5 that can
access the server.</para>
<para>From the authors point of view: </para>
<para>Its really cool stuff! Unfortunatly it does not work over proxy-connection.
You kan keep your Netscape 4.x bookmarks etc. synchronized on different machines</para>
</sect3>
<sect3><title>Download the source</title>
<para>Origin-Site: <ulink url="http://www.klomp.org/mod_roaming/">http://www.klomp.org/mod_roaming/</ulink>
</para>
</sect3>
<sect3><title>Building and installing</title>
<screen>
cd /usr/local
tar -xvzf mod_roaming-1.0.2.tar.gz
cd mod_roaming-1.0.2
/usr/local/apache/bin/apxs -i -a -c mod_roaming.c
</screen>
<para>Notice: Check httpd.conf if mod_roaming is loaded at startup: </para>
<screen>
LoadModule roaming_module libexec/mod_roaming.so
</screen>
<para>Should be installed automatically</para>
</sect3>
<sect3><title>Sample configuration</title>
<sect4><title>/usr/local/apache/conf/httpd.conf</title>
<screen>
RoamingAlias /roaming /usr/local/apache/roaming
&lt;Directory /usr/local/apache/roaming&gt;
AuthUserFile /usr/local/apache/conf/roaming-htpasswd
AuthType Basic
AuthName &quot;Roaming Access&quot;
&lt;Limit GET PUT MOVE DELETE&gt;
require valid-user
&lt;/Limit&gt;
&lt;/Directory&gt;
</screen>
</sect4>
</sect3>
</sect2>
</sect1>
<sect1 id="php">
<title>mod_php and its prerequisites</title>
<sect2><title>What is mod_php</title>
<para>Quoting www.php.net</para>
<para>PHP is a server-side, cross-platform, HTML embedded scripting language. </para>
<para>In the beginning it was just a simple guestbook-processor, and it was growing and growing Since Version 3
it is really powerful Webdevelopment-language</para>
<para>From the authors point of view:</para>
<para>Since Version 4 its capable and robust for enterprise Webapplications. It powerful, supports almost all
important Databases natively, and other throught ODBC. It a few times faster that ASP on M&dollar;-Systems on
the same Hardware. </para>
<para>There are other extensions available like apc which speeds up processing about 50-400&percnt;
(depends on the php-code you wrote)</para>
</sect2>
<sect2><title>Prerequisites</title>
<para>
Depending on your needs there are some software to install first. One already installed Software according this document is MySQL, because
its needed by mod_auth_mysql.</para>
<sect3><title>IMAP client</title>
<sect4><title>What is IMAP client</title>
<para>IMAP means "Internet Mail Application Protocol" and is a
substitute for the POP protocol. It allows you to keep all
Mails in different folders on the server, which (should)
be backed up - never lose important Email, because your
local Harddrive crashes</para>
</sect4>
</sect3>
<sect3><title>Download the source</title>
<para>Origin-Site:</para>
<para>Origin-Site: <ulink url="http://www.washington.edu/imap/">http://www.washington.edu/imap/</ulink>
</para>
</sect3>
<sect3><title>Building and installing</title>
<screen>
cd /usr/local
tar -xvfz imap.tar.Z
cd imap
make slx SSLTYPE=unix
</screen>
<para>Notice: </para>
<para>imap.tar.Z is usually a symlink to the latest release, today its linked to imap-2001a.tar.Z</para>
2001-10-29 23:22:21 +00:00
<para>If you dont need SSL-Support, remove the "SSLTYPE=unix" behind the make command</para>
</sect3>
<sect3><title>Postgres</title>
<sect4><title>What is Postgres</title>
<para>Postgres is a very Powerful and fast Database</para>
<para>Its like MySQL wonderful for Webapplications, but from my Point of view, not such comfortable to handle like MySQL. If your Webapplication writes a lot of Data, or you need proofed transaction-capabilities, Postgres is your friend</para>
</sect4>
<sect4><title>Download the source</title>
<para>Origin-Site: <ulink url="http://www.postgresql.org">http://www.postgresql.org</ulink> (Select a mirror close to you)</para>
</sect4>
<sect4><title>Building and installing</title>
<screen>
cd /usr/local
tar -xvzf postgresql-7.2.tar.gz
2001-10-29 23:22:21 +00:00
cd postgresql-7.2
2001-10-29 23:22:21 +00:00
./configure &bsol;
--with-perl &bsol;
--with-odbc &bsol;
make
make install
echo /usr/local/pgsql/lib &gt;&gt; /etc/ld.so.conf
ldconfig
</screen>
</sect4>
</sect3>
<sect3><title>pdflib</title>
<sect4><title>What is pdflib</title>
<para>Quoting www.pdflib.com</para>
<para>PDFlib: A library for generating PDF on the fly PDFlib is the premier software component if you want
to generate PDF on your server, convert text and graphics, or implement PDF output in your own products.</para>
<para>This is a commercial Procduct! read the licence carefully to see if you need a commercial licence or not!</para>
</sect4>
<sect4><title>Download the source</title>
<para>Origin-Site: <ulink url="http://www.pdflib.com/pdflib/download/pdflib-4.0.2.tar.gz">
http://www.pdflib.com/pdflib/download/pdflib-4.0.2.tar.gz</ulink></para>
2001-10-29 23:22:21 +00:00
</sect4>
<sect4><title>Building and installing</title>
<screen>
cd /usr/local/
tar -xvzf pdflib-4.0.2.tar.gz
2001-10-29 23:22:21 +00:00
cd pdflib-4.0.2
2001-10-29 23:22:21 +00:00
./configure --enable-shared-pdflib --enable-cxx
make
make install
ldconfig
</screen>
</sect4>
</sect3>
<sect3><title>gettext</title>
<sect4><title>What is gettext</title>
<para>gettext is a library for interneationalization, and needed by php</para>
</sect4>
<sect4><title>Download the source</title>
<para>Origin-Site: <ulink url="ftp://ftp.gnu.org/gnu/gettext">ftp://ftp.gnu.org/gnu/gettext</ulink>
(select a mirror close to you)</para>
</sect4>
<sect4><title>Building and installing</title>
<screen>
cd /usr/local
tar -xvzf gettext-0.10.40.tar.gz
cd gettext-0.10.40
./configure
make
make check
make install
ldconfig
</screen>
</sect4>
</sect3>
<sect3><title>zlib</title>
<sect4><title>What is zlib</title>
<para>zlib is a lossless data-compression library for use on virtually any computer hardware and operating system</para>
</sect4>
<sect4><title>Download the source</title>
<para>Origin-Site: <ulink url="//ftp.info-zip.org/pub/infozip/zlib/zlib.tar.gz">ftp://ftp.info-zip.org/pub/infozip/zlib/zlib.tar.gz</ulink>
(select a mirror close to you)</para>
</sect4>
<sect4><title>Building and installing</title>
<screen>
cd /usr/local
tar -xvzf zlib.tar.gz
cd zlib-1.1.3/
./configure
make
make check
make install
ldconfig
2001-10-29 23:22:21 +00:00
</screen>
</sect4>
</sect3>
2001-10-29 23:22:21 +00:00
</sect2>
<sect2><title>Builing and installing PHP4</title>
<screen>
cd /usr/local
tar -xvzf php-4.1.1.tar.gz
cd php-4.1.1
2001-10-29 23:22:21 +00:00
./configure &bsol;
--with-apxs=/usr/local/apache/bin/apxs &bsol;
--with-mysql=/usr/local/mysql &bsol;
--with-pgsql=/usr/local/pgsql &bsol;
--enable-track-vars &bsol;
--with-openssl=/usr/local/ssl &bsol;
--with-imap-ssl=/usr/local/imap-2001a &bsol;
--with-gd --with-ldap &bsol;
2001-10-29 23:22:21 +00:00
--enable-ftp &bsol;
--enable-sysvsem &bsol;
--enable-sysvshm &bsol;
--enable-sockets &bsol;
--with-pdflib=/usr/local &bsol;
--with-gettext &bsol;
--with-mm=/usr/local/mm-1.1.3 &bsol;
--with-jpeg-dir=/usr/lib &bsol;
--with-zlib-dir=/usr/local &bsol;
2001-10-29 23:22:21 +00:00
make
make install
</screen>
<para>After installing your httpd.conf is modified by axps. It should now looking as following:</para>
<screen>
&lt;IfDefine SSL&gt;
LoadModule ssl_module libexec/libssl.so
LoadModule php4_module libexec/libphp4.so
&lt;/IfDefine&gt;
</screen>
<para>If you compiled Apache with mod_ssl then the php-module will only be loaded when staring Apache with ssl (apachectl startssl). If you will start Apache without ssl support (but compiled like described in this document) you need to change this:
</para>
<screen>
&lt;IfDefine SSL&gt;
LoadModule ssl_module libexec/libssl.so
&lt;/IfDefine&gt;
LoadModule php4_module libexec/libphp4.so
</screen>
2001-10-29 23:22:21 +00:00
<para>Copy the sample php.ini to /usr/local/lib/php.ini</para>
<screen>
cp /usr/local/php-4.1.1/php.ini-dist /usr/local/lib/php.ini
2001-10-29 23:22:21 +00:00
</screen>
<para>uncomment (remove the &num; at begin of line) the following lines in /usr/local/apache/conf/httpd.conf</para>
<screen>
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
</screen>
<para>you may wish to add the following: </para>
<screen>
AddType application/x-httpd-php .phtml
AddType application/x-httpd-php .php3
</screen>
<para>Restart apache by issuing the following command: </para>
<screen>
/usr/local/apache/bin/apachectl restart
</screen>
</sect2>
</sect1>
<sect1 id="phpext"><title>PHP extensions</title>
<para>There are different extensions available for php, which could be added in your php.ini</para>
<sect2><title>APC (Alternative PHP-cache)</title>
<sect3><title>What is APC</title>
<para>Quoting www.apc.communityconnect.com/</para>
<para>APC is the Alternative PHP Cache. It was conceived of to provide a free, open, and robust framework for compiling
and caching php scripts. APC was conceived of to provide a way of boosting the performance of PHP on heavily loaded sites
by providing a way for scripts to be cached in a compiled state, so that the overhead of parsing and compiling can be
almost completely eliminated. There are commercial products which provide this functionality, but they are neither
open-source nor free. Our goal was to level the playing field by providing an implementation that allows greater
flexibility and is universally accessible. We also wanted the cache to provide visibility into it's own workings and
those of PHP, so time was invested in providing internal diagnostic tools which allow for cache diagnostics and
maintenance. Thus arrived APC. Since we were committed to developing a product which can easily grow with new version
of PHP, we implemented it as a zend extension, allowing it to either be compiled into PHP or added post facto as a
drop in module. As with PHP, it is available completely free for commercial and non-commercial use, under the same terms
as PHP itself. APC has been tested under PHP 4.0.3, 4.0.3pl1 and 4.0.4. It currently compiles under Linux and FreeBSD.
Patches for ports to other OSs/ PHP versions are welcome.</para>
<para>From the authors point of view:</para>
<para>The author made some performance-Tests with apc and it was really surprising. A PHP-Webpage with
mysql-queries in a loop (total 10 queries) its speedup more than 50&percnt; </para>
2001-10-29 23:22:21 +00:00
<para>Contra APC: If you have other users on the system coding php they maybe are not comfortable with APC, because the changes are
all ignored unless you reset the cache or restart Apache. The other way, that APC checks the php-script for a newer version
befor every run costs speed.</para>
</sect3>
<sect3><title>Download the source</title>
<para>Origin-Site: <ulink url="http://apc.communityconnect.com/sources/apc-1.1.0pl1.tar.gz">http://apc.communityconnect.com/sources/apc-1.1.0pl1.tar.gz</ulink></para>
</sect3>
<sect3><title>Building and installing</title>
<screen>
cd /usr/local
tar -xvzf apc-1.1.0pl1.tar.gz
cd apc-1.1.0pl1
./configure --enable-apc --with-php-config=/usr/local/bin/php-config
make
make install
cp modules/php_apc.so /usr/local/lib/php/extensions
echo 'zend_extension=&quot;/usr/local/lib/php/extensions/php_apc.so&quot;' &gt;&gt; /usr/local/lib/php.ini
echo &ldquo;apc.mode = shm&rdquo; &gt;&gt; apc.mode = shm
</screen>
<para>
Restart your Apache-Webserver. Try it out, create a php-file with the following content: </para>
<screen>
&lt;?php
apcinfo();
?&gt;
</screen>
</sect3>
</sect2>
<sect2><title>Zend-Optimizer (Do _NOT_ combine with APC-Cache!)</title>
<sect3><title>What is Zend-optimizer</title>
<para>Quoting www.zend.com</para>
<para>The Zend Optimizer goes over the intermediate code generated by the standard Zend run-time compiler
located in the Zend Engine, and then optimizes it for faster execution. </para>
<para>From the authors point of view: there is a speed-decrease of about 5&percnt; ? Why using this
closed-source but freeware-product?</para>
<para>You have to make your own test, to see, if you have some improvements with your own code. Be sure to NOT use Zend Optimizer together
with APC, or your whole setup will not work</para>
</sect3>
<sect3><title>Download the binary</title>
<para>Origin-Site: <ulink url="https://www.zend.com/store/free_download.php?pid=13">https://www.zend.com/store/free_download.php?pid=13</ulink></para>
<para>You have to register yourself at zend.com to get access to the download-page</para>
</sect3>
<sect3><title>Installing</title>
<para>There is noting to build, this product is closed-source and so only available as binary for different platforms. The filename
is vary according your platform, the sample is for Linux on IA32</para>
<screen>
cd /usr/local
tar -xvzf ZendOptimizer-1.2.0-PHP_4.1.0-Linux_glibc21-i386.tar.gz
2001-10-29 23:22:21 +00:00
cd ZendOptimizer-1.2.0-PHP_4.1.0-Linux_glibc21-i386.tar.gz
2001-10-29 23:22:21 +00:00
cp ZendOptimizer.so /usr/local/lib/php/extensions
echo 'zend_optimizer.optimization_level=15' &gt;&gt; /usr/local/lib/php.ini
echo'zend_extension=&quot;/usr/local/lib/php/extensions/ZendOptimizer.so&quot;'&gt;&gt; /usr/local/lib/php.ini
</screen>
</sect3>
</sect2>
</sect1>
<sect1 id="ssjava"><title>Server Side Java</title>
<sect2><title>mod_jserv</title>
<sect3><title>What is mod_jserv</title>
<para>Quoting java.apache.org</para>
<para>Apache JServ is a 100&percnt; pure Java servlet engine fully compliant with theJavaSoft Java Servlet APIs 2.0 specification. Since we believe in the great value complete portability between different servlet platforms, together with portability of Java binary code, we worked very close with JavaSoft and other JVM implementers to provide correct interpretations or Java specifications both for servlets and for the Java language itself. mod_jserv is very comfortable to maintain (unusally Java is the HELL, jserv is a little nicer :-)</para>
<para>Unfortunatyl mod_jserv is no longer actively developped,
only bugfixes if bugs where found. Tomcat is the successor of mod_jserv
As soon as the author gets enought time and experiance with Tomcat he will extend this HOWTO.</para>
<para>JDSK2.0 is out of Date too. Its needed for mod_jserv only. </para>
</sect3>
<sect3><title>Prerequisites</title>
<sect4><title>JSDK 2.0 (mod_jserv req.)</title>
<sect5><title>What is JSDK</title>
<para>Its the API from Sun Microsystems for developping Servlets</para>
</sect5>
<sect5><title>Download</title>
<para>Origin-Site: <ulink url="http://java.sun.com/products/servlet/archive.html">
http://java.sun.com/products/servlet/archive.html</ulink></para>
</sect5>
<sect5><title>Building and installing</title>
<para>Since JSDK is closedsource there is nothing to build.</para>
<para>Notice: The filename &ldquo;jsdk20-solaris2-sparc.tar.Z&rdquo; suggests to be a binary for sparc platform -&gt;
ignore it, it will work on all platforms</para>
<screen>
cd /usr/local/
uncompress jsdk20-solaris2-sparc.tar.Z
tar -xvf jsdk20-solaris2-sparc.tar
</screen>
</sect5>
</sect4>
</sect3
<sect3><title>Download the source</title>
<para>Origin-Site: <ulink url="http://java.apache.org/jserv/dist/">http://java.apache.org/jserv/dist/</ulink></para>
</sect3>
<sect3><title>Building and installing</title>
<screen>
cd /usr/local
tar -xvzf ApacheJServ-1.1.2.tar.gz
cd ApacheJServ-1.1.2
./configure &bsol;
--prefix=/usr/local/jserv &bsol;
--with-apxs=/usr/local/apache/bin/apxs &bsol;
--with-JSDK=/usr/local/JSDK2.0 &bsol;
--enable-EAPI &bsol;
make
make install
</screen>
<para>Its important to use flag --enable-EAPI if apache is compiled with mod_ssl!</para>
</sect3>
</sect2>
<sect2><title>jakarta-tomcat</title>
<sect3><title>What is Tomcat</title>
<para>Quoting jakarta.apache.org</para>
<para>Tomcat is the servlet container that is used in the official Reference Implementation for the Java Servlet and JavaServer Pages technologies. The Java Servlet and JavaServer Pages specifications are developed by Sun under the Java Community Process.</para>
<para>From the authors point of view: Tomcat is the successor of jserv which is no longer developped. Tomcat supports the latest jsp and servlet-API's defined by sun. Unfortunatly is very difficult to build from source, because its using its own building-system called "ant". There is also a very long list
of prerequesits if you want to build from source. See <ulink url="http://jakarta.apache.org/tomcat/tomcat-4.0-doc/BUILDING.txt">http://jakarta.apache.org/tomcat/tomcat-4.0-doc/BUILDING.txt</ulink> for more details - Good luck, and give some feedback to the author. In meantime the HOWTO is providing some
basic support for Tomcat installed from binaries.</para>
<para>The Author is searching for some volunteers who tries to build Tomcat from source and tells what steps are required</para>
</sect3>
<sect3><title>Prerequisites</title>
<sect4><title>Java2</title>
<sect5><title>What is Java2>
<para>Quoting java.sun.com</para>
<para>Too much for this HOWTO, please see <ulink url="http://java.sun.com/j2se/1.3/docs/relnotes/features.html">http://java.sun.com/j2se/1.3/docs/relnotes/features.html</ulink></para>
</sect5>
<sect4><title>Download the binaries</title>
<para>Go to <ulink url="http://java.sun.com/j2se/1.3/">http://java.sun.com/j2se/1.3/</ulink> ,choose your platform and follow the steps on the site.</para>
</sect4>
<sect4><title>Installing the binaries</title>
<para>
Now you have to execute the binary:
<screen>
chown +x j2sdk-1_3_1_02-linux-i386.bin
./2sdk-1_3_1_02-linux-i386.bin
</screen>
<para>After accepting the license you cat unpack the stuff und move to "/usr/lib"</para>
</sect4>
</sect3>
<sect3><title>Download the binaries</title>
<para>Origin-Site: <ulink url="http://jakarta.apache.org/builds/jakarta-tomcat-4.0/release/v4.0.1/bin/jakarta-tomcat-4.0.1.tar.gz">http://jakarta.apache.org/builds/jakarta-tomcat-4.0/release/v4.0.1/bin/jakarta-tomcat-4.0.1.tar.gz/</ulink></para>
<sect3><title>Installing the binaries</title>
<screen>
cd /usr/local
tar -xvzf jakarta-tomcat-4.0.1.tar.gz
cd jakarta-tomcat-4.0.1
cd bin
rm *.bat
echo export JAVA_HOME=/usr/lib/java/ >> /etc/profile
. /etc/profile
</screen>
<para>Now you should be able to startup tomcat:
<screen>
/usr/local/apache/jakarta-tomcat-4.0.1/bin/startup.sh
</screen>
<para>You should now be able to connect to: <ulink url="http://localhost:8080/index.html">http://localhost:8080/index.html</ulink></para>
<para>Now for the further steps like installing your servlets and jps-files you are responsible by youself...</para>
<para>Notice: Since the author is NOT a Java-Programmer he will be able to help you with Java-Problems!
The author is an experianced SysAdmin and could you give some hints: Be sure your CLASSPATH Variable is set right! This is most common error done! Have fun, and as metioned above, the author requests some feedback to be able to provide more informations to the community</para>
</sect3>
</sect2>
2001-10-29 23:22:21 +00:00
</sect1>
</article>