From 20a6814f3b7290d94c2a050d6a98a10c3b57db4e Mon Sep 17 00:00:00 2001 From: delouw <> Date: Mon, 29 Oct 2001 23:22:21 +0000 Subject: [PATCH] First public release of the Howto --- LDP/howto/docbook/Apache-Compile-HOWTO.sgml | 1228 +++++++++++++++++++ 1 file changed, 1228 insertions(+) create mode 100644 LDP/howto/docbook/Apache-Compile-HOWTO.sgml diff --git a/LDP/howto/docbook/Apache-Compile-HOWTO.sgml b/LDP/howto/docbook/Apache-Compile-HOWTO.sgml new file mode 100644 index 00000000..eac635fb --- /dev/null +++ b/LDP/howto/docbook/Apache-Compile-HOWTO.sgml @@ -0,0 +1,1228 @@ + + +
+ +Apache Compile HOWTO (Linux edition) + + +2000 +2001 +Luc de Louw + + + + +The Apache Compile HOWTO is copyright (C) 2001 by Luc de Louw, +and is released under the terms of the GNU Free Documentation +License, which is hereby incorporated by reference. + + + + +Luc + de Louw + + +luc@delouw.ch + + + + + + +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 + + + + + +Introduction + + +Contributors and Contacts +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 luc@delouw.ch + + + + +Why this document was written +All Linux-distributions I tested, had a bad defaultsetup of Apache. Additionally all major +distributions dont have actual versions of Apache. + +Finally no commercial Unix comes with Apache preinstalled (Why not?) +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. +After a lot of people requested the document as an “official” HOWTO, I decided to do so. + + + +What this document is supposed to be +Compiling all the stuff described below needs to know a lot of configure-options that +nobody can memorize. Its supposed to be a “copy-paste-ready” text to compile +apache and friends +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. + + + +What this document doesn't do for you +Its just a Document, not a script that makes the work for you. You have to do all steps by yourself. + + + +Platforms +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: + +Linux (All architectures) +IBM AIX 4.3 and 5.1L +Sun Solaris 6/7/8 +Hewlett-Packard HPUX 11 +{Free|Net|Open}-BSD + + +Other Un*x-platforms: Feel free to create a guest-account for me on your Un*x platform. +Windows-Users: I'm sorry, I'm too young for an heart-attack ;-) + + + +Revision History + + + + + 1.9.6 + 2001-10-27 + Updates of software mentioned in the HOWTO, and fixed some bugs + + + + 1.9.5 + 2001-08-27 + Yet another rewrite in Docbook 3.1 + + + + 1.9.4 + 2001-08-26 + Updated the Software-Versions metioned in the document, corrected some typos + + + + 1.9.3 + 2001-06-23 + Current Version 2.0.0-pre3 in Linux DocBook format + + + + 1.0.0 + 2000-08-05 + First publication of the html-based document + + + + + + + + +New versions of this document + +The most recent version of this document you will at +http://www.delouw.ch/linux/apache.phtml + +New revisions of this document will be announced at +http://freshmeat.net/apacompile + + + + +About the author +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 “impossible” tasks will end up on his +desk (yes, its funny and he love it!) + + + + + + +Prerequisites + + +General + +flex +bison +autoconf +libtool + +To be continiued + + + +Distribution specific + +SuSE Linux + +SuSE Linux 7.1 (maybe applicable to other distributions) +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 + +To correct this misbehaviour create a symlink: + +cd /usr/include/db1 +ln -s ../ndbm.h ndbm.h + + +In SuSE 7.2 and later this issue is fixed + + + + +OpenSSL + +What is OpenSSL +Quoting www.openssl.org +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. +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. +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 + +OpenSSL provides the libraries and include-files needed be the products mentioned above and also provides +a Application to build Server and client-Certificates. + + +Download the source +Origin-Site +http://www.openssl.org + + + +Building and installing + +cd /usr/local +tar -xvzf openssl-0.9.6b.tar.gz + +cd openssl-0.9.6b + +./config + +make +make test +make install + + + + + + +MySQL + +What is MySQL + +Mysql is a very fast, powerful and very nice to handle Database. + +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. + +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 for more information + + +Download + +Origin-Site: http://www.mysql.com/downloads/ + + + +Building and installing + + +cd /usr/local +tar -xvzf mysql-3.23.43.tar.gz +cd mysql-3.23.43 + +./configure +--prefix=/usr/local/mysql \ +--enable-assembler \ +--with-innodb + +make +make install + +/usr/local/mysql/bin/mysql_install_db +echo /usr/local/mysql/lib/mysql >> /etc/ld.so.conf +ldconfig + + + + +For security-improvement add a mysql-user on your system i.e. "mysql", then + + + +chown -R mysql /usr/local/mysql/var + + + +and change the line user=root to user=mysql in the file /usr/local/mysql/bin/safe_mysqld + + + +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. + + + + +Building mm + +What is mm +Quoting www.engelschall.com +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. +From the authors point of view: +Its a common lib that enables Unix-Programers to simplify shm accesses. Its used by a lot products i.e. PHP and mod_ssl +Since the author is not a programmer, he is unable to explain the exact usage of that stuff + + +Download +Origin Site: http://www.engelschall.com/sw/mm/mm-1.1.3.tar.gz + + + +Building and installing + +cd /usr/local + +tar -xvzf mm-1.1.3.tar.gz + +cd mm-1.1.3 + +./configure +make +make test +make install + + + + + + + + + + +Getting, build and install Apache with its basic modules + +Get and untar the Apache Source + +What is Apache + +Quoting www.apache.org +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. +From the authors point of view: +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 +Anybody experianced a crash please mail me, your crash-report will be published right here... + + +Download the source +Origin-Site +http://www.apache.org/dist/httpd/ + +cd /usr/local/ + +tar -xvzf apache_1.3.22.tar.gz + + + + + +Patch for largescale sites +Download the patch from: +http://www.delouw.ch/linux/apache-patch_HARD_SERVER_LIMIT.txt + + + +--- 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 + + + +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 “self-Denial-of-service-attack”!! +Be sure you have enought processes left for root) + +Kernel-hack patch will follow as soon as possible + + +Apply the patch using: + +cd /usr/local/apache_1.3.22/src/include + +patch -p0 < apache-patch_HARD_SERVER_LIMIT.txt + + + + + +mod_ssl + +What is mod_ssl +Quoting www.modssl.org +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. +From the authors point of view: +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 +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 +Allmost all modules I know do that by themself execpt mod_jserv and mod_jk + + +Download the source +Origin-Site:http://www.modssl.org + + +Applying the patch to the apache source +cd /usr/local/ + +tar -xvzf mod_ssl-2.8.5-1.3.22.tar.gz +cd mod_ssl-2.8.5-1.3.22/ + +./configure \ +--with-apache=/usr/local/apache_1.3.22 \ +--with-ssl=/usr/local/ssl \ +--enable-shared=ssl \ +--with-mm=/usr/local/mm-1.1.3 + + + + + + +mod_perl + +What is mod_perl +Quoting perl.apache.org +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. +From the authors point of view: +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 + + +Download the source +Origin-Site: http://www.apache.org/dist/perl + + +Building and installing +cd /usr/local + +tar -xvzf mod_perl-1.26.tar.gz + +cd mod_perl-1.26 + +perl Makefile.PL \ +EVERYTHING=1 \ +APACHE_SRC=../apache_1.3.22/src \ +USE_APACI=1 \ +PREP_HTTPD=1 \ +DO_HTTPD=1 + +make +make install + + + +Notice: Do not compile mod_perl as dso! According to info's I have, apache will crash (I never tried) + + + + +Configure and build Apache +Now the two static modules mod_ssl and mod_perl are configured and the Apache Source has been patched + +Building and installing + + +EAPI_MM="/usr/local/mm-1.1.3" SSL_BASE="/usr/local/ssl" \ +./configure \ +--enable-module=unique_id \ +--enable-module=rewrite \ +--enable-module=speling \ +--enable-module=expires \ +--enable-module=info \ +--enable-module=log_agent \ +--enable-module=log_referer \ +--enable-module=usertrack \ +--enable-module=proxy \ +--enable-module=userdir \ +--enable-module=so \ +--enable-shared=ssl \ +--enable-module=ssl \ +--activate-module=src/modules/perl/libperl.a \ +--enable-module=perl + +make +make install + + + + +Create self-signed SSL-certificate + + +cd /usr/local/ssl/bin + +./openssl req -new > 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 + + + +Notice: OpenSSL asks you different things, an error often done is enter a wrong "common name". +This is the fully qualified hostname of your Server i.e www.foo.org + + + + +mod_dav + +What is mod_dav + +Quoting www.webdav.org +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. +mod_dav is maintained by gstein@lyra.org +From the authors point of view: +DAV means: "Distributed authoring and Versioning" It allows you to manage your Website similar +to a filesystem. Its meant to replace ftp-uploads to your Webserver. +DAV is supported by all major Web-developpment-Tools (newer Version) and is going to be a widly accepted +standart for Web-publishing + + +Download the source +Origin-Site: http://www.webdav.org/mod_dav/ + + +Building and installing + + +cd /usr/local + +tar -xvzf mod_dav-1.0.2-1.3.6.tar.gz +cd mod_dav-1.0.2-1.3.6 + +./configure --with-apxs=/usr/local/apache/bin/apxs + +make +make install + + +Notice: the filename mod_dav-1.0.2-1.3.6 suggests that it will only run with apache 1.3.6 but it +means it will run with all apaches >= 1.3.6 + + + + +auth_ldap + +What is auth_ldap +Quoting www.rudedog.org +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˜1 Frontpage clients manage +their web permissions while still using LDAP for authentication. +From the authors point of view: +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. +Login-facilities for LDAP: +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 "manager" assign a user as member and that user can login wherever a manager is allowed to login + + +Download the source +Origin-Site: http://www.rudedog.org/auth_ldap/ + + +Building and installing +Check the Makefile and be sure, that the path to apxs is correct: APXS=/usr/local/apache/bin/apxs + + +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 \ +--with-sdk=openldap + +make +make install + + + + + + + +mod_auth_mysql +What is mod_auth_mysql +Its an http-Basic Authentication Module. It allows you to maintain your user comfortable in a MySQL-Database + +Download the source +Origin-Site: ftp://ftp.kciLink.com/pub/mod_auth_mysql.c.gz + + +Building and installing + + +/usr/local/apache/bin/apxs\ +-c -I/usr/local/mysql/include/mysql \ +-L/usr/local/mysql/lib/mysql \ +-lmysqlclient -lm mod_auth_mysql.c + +cp mod_auth_mysql.so /usr/local/apache/libexec/ + + + + +Add this line in your httpd.conf: + + + +LoadModule mysql_auth_module libexec/mod_auth_mysql.so + + + +And where the other modules were added: + +AddModule mod_auth_mysql.c + +Take care that the path of Mysql libs and includes are correct! +Notice: Be sure that /usr/local/mysql/lib/mysql is in /etc/ld.so.conf befor compiling +Use AuthMySQLCryptedPasswords Off or it does not work! (under investigation why not) + + +Sample configuration +/usr/local/apache/conf/httpd.conf + + +<location /manual/> + AuthType Basic + AuthUserfile /dev/null + AuthName Testing + AuthGroupFile /dev/null + AuthMySQLHost localhost + AuthMySQLCryptedPasswords Off + AuthMySQLUser root + AuthMySQLDB users + AuthMySQLUserTable user_info + <Limit GET POST> + require valid-user + </limit> +</location> + + + + +Script for creating the MySQL-Database + + +just type: + + + +mysql < authmysql.sql + + + +The File authmysql.sql contents: + + + 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); + + + + + +mod_dynvhost + +What is mod_dynvhost +Its a small module that allows you to define new Vritual Host "on-the-fly" just create a +new Directoy in your vhost-path, thats it. You dont need to restart your Webserver +Its maybe a good solution for Mass-Virtual-hosting for ISP's + + +Download the source +Origin-Site: +http://funkcity.com/0101/projects/dynvhost/mod_dynvhost.tar.gz + + + +Builing and installing + + +cd /usr/local + +tar -xvzf mod_dynvhost.tar.gz + +cd dynvhost/ + +/usr/local/apache/bin/apxs -i -a -c mod_dynvhost.c + + +Notice: Take a look in httpd.conf if mod_dynvhost.so is loaded at startup: + + + +LoadModule dynvhost_module libexec/mod_dynvhost.so + + + + +Sample configuration +/usr/local/apache/conf/httpd.conf + + + +<DynamicVirtualHost /usr/local/apache/htdocs/vhosts/> + HomeDir / +</DynamicVirtualHost> + + + +Now create a Directory for each virtualhost in /usr/local/apache/htdocs/vhosts/ +i.e. +/usr/local/apache/htdocs/vhosts/foo.bar.org +You dont need to restart your Webserver + + + + +mod_roaming + +What is mod_roaming +Quoting www.klomp.org/mod_roaming/ +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. +From the authors point of view: +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 + + +Download the source +Origin-Site: http://www.klomp.org/mod_roaming/ + + + +Building and installing + + + +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 + + + +Notice: Check httpd.conf if mod_roaming is loaded at startup: + + +LoadModule roaming_module libexec/mod_roaming.so + + +Should be installed automatically + + +Sample configuration + +/usr/local/apache/conf/httpd.conf + + + +RoamingAlias /roaming /usr/local/apache/roaming +<Directory /usr/local/apache/roaming> + AuthUserFile /usr/local/apache/conf/roaming-htpasswd + AuthType Basic + AuthName "Roaming Access" + <Limit GET PUT MOVE DELETE> + require valid-user + </Limit> +</Directory> + + + + + + + + + +mod_php and its prerequisites + + +What is mod_php +Quoting www.php.net +PHP is a server-side, cross-platform, HTML embedded scripting language. +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 +From the authors point of view: +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$-Systems on +the same Hardware. + +There are other extensions available like apc which speeds up processing about 50-400% +(depends on the php-code you wrote) + + +Prerequisites + +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. + +IMAP client + +What is IMAP client +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 + + + +Download the source +Origin-Site: + +Origin-Site: http://www.washington.edu/imap/ + + + +Building and installing + + + +cd /usr/local + +tar -xvfz imap.tar.Z + +cd imap + +make slx SSLTYPE=unix + + + + + +Notice: +imap.tar.Z is usually a symlink to the latest release, today its linked to imap-2001.BETA.SNAP-0104101757.tar.Z +If you dont need SSL-Support, remove the "SSLTYPE=unix" behind the make command + + +Postgres +What is Postgres +Postgres is a very Powerful and fast Database +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 + +Download the source +Origin-Site: http://www.postgresql.org (Select a mirror close to you) + +Building and installing + + + +cd /usr/local + +tar -xvzf postgresql-7.0.3.tar.gz + +cd postgresql-7.0.3 + +./configure \ +--with-perl \ +--with-odbc \ + +make +make install + +echo /usr/local/pgsql/lib >> /etc/ld.so.conf + +ldconfig + + +Notice: The most recent Version is Postgres 7.1 with obiviously does not work with php. +I'll try it with a later version of postgres and/or php and going to update the document if successful. + + + +pdflib + +What is pdflib +Quoting www.pdflib.com +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. +This is a commercial Procduct! read the licence carefully to see if you need a commercial licence or not! + + +Download the source +Origin-Site: +http://www.pdflib.com/pdflib/download/pdflib-4.0.1.tar.gz + + +Building and installing + + + +cd /usr/local/ +tar -xvzf pdflib-4.0.1.tar.gz + +cd pdflib-4.0.1 + +./configure --enable-shared-pdflib --enable-cxx + +make +make install + +ldconfig + + + + + +gettext + +What is gettext +gettext is a library for interneationalization, and needed by php + + +Download the source +Origin-Site: ftp://ftp.gnu.org/gnu/gettext + (select a mirror close to you) + + +Building and installing + + + +cd /usr/local + +tar -xvzf gettext-0.10.40.tar.gz + +cd gettext-0.10.40 + +./configure + +make +make check +make install + + + + + + +Builing and installing PHP4 + + + +cd /usr/local + +tar -xvzf php-4.0.6.tar.gz + +cd php-4.0.6 + +./configure \ +--with-apxs=/usr/local/apache/bin/apxs \ +--enable-versioning \ +--with-mysql=/usr/local/mysql \ +--with-pgsql=/usr/local/pgsql \ +--enable-track-vars \ +--with-imap=/usr/local/imap \ +--with-imap-ssl \ +--with-gd \ +--with-ldap \ +--enable-ftp \ +--enable-sysvsem \ +--enable-sysvshm \ +--enable-sockets \ +--with-pdflib=/usr/local \ +--with-gettext \ +--with-mm=/usr/local/mm-1.1.3 \ +--with-jpeg-dir=/usr/lib + +make +make install + + + +Copy the sample php.ini to /usr/local/lib/php.ini + + + +cp /usr/local/php-4.0.6/php.ini-dist /usr/local/lib/php.ini + + + +uncomment (remove the # at begin of line) the following lines in /usr/local/apache/conf/httpd.conf + + + +AddType application/x-httpd-php .php +AddType application/x-httpd-php-source .phps + + + +you may wish to add the following: + + + +AddType application/x-httpd-php .phtml +AddType application/x-httpd-php .php3 + + + +Restart apache by issuing the following command: + + + + +/usr/local/apache/bin/apachectl restart + + + + + + +PHP extensions +There are different extensions available for php, which could be added in your php.ini + +APC (Alternative PHP-cache) +What is APC +Quoting www.apc.communityconnect.com/ +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. +From the authors point of view: +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 that 50% +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. + + +Download the source +Origin-Site: http://apc.communityconnect.com/sources/apc-1.1.0pl1.tar.gz + + +Building and installing + + + +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="/usr/local/lib/php/extensions/php_apc.so"' >> /usr/local/lib/php.ini +echo “apc.mode = shm” >> apc.mode = shm + + + + +Restart your Apache-Webserver. Try it out, create a php-file with the following content: + + + +<?php +apcinfo(); +?> + + + + + + + +Zend-Optimizer (Do _NOT_ combine with APC-Cache!) +What is Zend-optimizer +Quoting www.zend.com +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. +From the authors point of view: there is a speed-decrease of about 5% ? Why using this +closed-source but freeware-product? +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 + + +Download the binary +Origin-Site: https://www.zend.com/store/free_download.php?pid=13 + +You have to register yourself at zend.com to get access to the download-page +Notice: Version Number indicates its for PHP 4.0.5, but its compatible also with PHP 4.0.6 + + + +Installing +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 + + + +cd /usr/local + +tar -xvzf ZendOptimizer-1.1.0-PHP_4.0.5-Linux_glibc21-i386.tar.gz + +cd ZendOptimizer-1.1.0-PHP_4.0.5-Linux_glibc21-i386 + +cp ZendOptimizer.so /usr/local/lib/php/extensions + +echo 'zend_optimizer.optimization_level=15' >> /usr/local/lib/php.ini +echo'zend_extension="/usr/local/lib/php/extensions/ZendOptimizer.so"'>> /usr/local/lib/php.ini + + + + + + + + +Server Side Java +mod_jserv +What is mod_jserv +Quoting java.apache.org +Apache JServ is a 100% 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 :-) + +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. +JDSK2.0 is out of Date too. Its needed for mod_jserv only. + + +Prerequisites +JSDK 2.0 (mod_jserv req.) +What is JSDK +Its the API from Sun Microsystems for developping Servlets + +Download +Origin-Site: +http://java.sun.com/products/servlet/archive.html + +Building and installing +Since JSDK is closedsource there is nothing to build. +Notice: The filename “jsdk20-solaris2-sparc.tar.Z” suggests to be a binary for sparc platform -> +ignore it, it will work on all platforms + + + +cd /usr/local/ + +uncompress jsdk20-solaris2-sparc.tar.Z +tar -xvf jsdk20-solaris2-sparc.tar + + + + +Download the source +Origin-Site: http://java.apache.org/jserv/dist/ + +Building and installing + + + +cd /usr/local + +tar -xvzf ApacheJServ-1.1.2.tar.gz +cd ApacheJServ-1.1.2 + +./configure \ +--prefix=/usr/local/jserv \ +--with-apxs=/usr/local/apache/bin/apxs \ +--with-JSDK=/usr/local/JSDK2.0 \ +--enable-EAPI \ + +make +make install + + +Its important to use flag --enable-EAPI if apache is compiled with mod_ssl! + + + + +