esta muy bueno aunque esta en ingles pero si no sabes
ingles ahi te va esta para quelo traduzcas:
http://babelfish.altavista.com/
2.3. GNU Database System
2.3.1. What is gdbm
GNU dbm is a set of database routines that use extensible hashing. It works similar to
the standard UNIX dbm routines.
−−www.gnu.org/software/gdbm
The GNU dbm is a very important application used by almost every distribution. So it is installed by default
on all distributions I tested.
In all probability the needed header files which are mandatory to build Apache with mod_rewrite and PHP are
not installed by default. Please consult your distributions CD/DVD and install the devel package (The version
can vary):
rpm −i gdbm−devel−1.8.0−546
This procedure is verified for SuSE and Redhat. Please confirm for other RPM based systems like Mandrake.
Debian will follow as soon as possible.
Users of Debian bases systems can install gdbm as follow:
apt−get install libgdbmg1−dev
2.3.2. Building and installing by yourself
In the unlikely case that your distribution does not contain gdbm here the instructions how to build it.
./configure
make
make install
ldconfig
2.4. MySQL
2.4.1. What is MySQL
MySQL is a very fast, powerful and very nice to handle Database.
Especially for webapplications where most access is read and few write, 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 PostgreSQL is better suited for your project see Section 6.2.4 for installation hints
You need the C−API from MySQL for compiling PHP if you wish MySQL−Support in PHP. It is also needed
if you want to use mod_authmysql, See Section 4.3 for more information
Apache Compile HOWTO
2.3. GNU Database System 7
2.4.2. Download
Origin−Site: http://www.mysql.com/downloads/
2.4.3. Building and installing
cd /usr/local
tar −xvzf mysql−3.23.55.tar.gz
cd mysql−3.23.55
./configure −−prefix=/usr/local/mysql −−enable−assembler −−with−innodb −−without−debug
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 e.g. »mysql«.
chown −R mysql /usr/local/mysql/var
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.
cp /usr/local/mysql/share/mysql/mysql.server /etc/init.d/
ln −s /etc/init.d/mysql.server /etc/init.d/rc3.d/S20mysql
ln −s /etc/init.d/mysql.server /etc/init.d/rc3.d/K20mysql
2.4.4. Securing MySQL
This part is only optional, and describes how to bind the MySQL daemon to the localhost IP
I suggest to just bind MySQL to the loopback−interface 127.0.0.1. This makes sure nobody can connect to
your MySQL−Daemon via the network. But of course it only makes sense if MySQL runs on the same box
like the webserver.
edit /etc/init.d/mysql.server and edit line 107 as following:
Original line:
$bindir/safe_mysqld −−datadir=$datadir −−pid−file=$pid_file&
Changed line:
$bindir/safe_mysqld −−datadir=$datadir −−pid−file=$pid_file −−bind−address=127.0.0.1&
Here you can define to which interface MySQL should be bound
Apache Compile HOWTO
2.4. MySQL 8
Alternatively you can completely disable the networking functionality of MySQL.
$bindir/safe_mysqld −−datadir=$datadir −−pid−file=$pid_file −−skip−networking &
2.5. Building mm
2.5.1. What is mm
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.
−−www.engelschall.com
It is a common library that enables Unix programmers to simplify shm (Shared memory) accesses. It is used
by many products, e.g. PHP and mod_ssl
2.5.2. Download
Origin Site: ftp://ftp.ossp.org/pkg/lib/mm/mm−1.2.2.tar.gz
2.5.3. Building and installing
cd /usr/local
tar −xvzf mm−1.2.2.tar.gz
cd mm−1.2.2
./configure
make
make test
make install
ldconfig
3. Getting, build and install Apache with its basic modules
3.1. Get and untar the Apache Source
3.1.1. What is Apache
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.
−−www.apache.org
Apache Compile HOWTO
2.5. Building mm 9
It is simply the best Webserver−Software, it is very flexible to configure to match your needs, and it is
E−X−T−R−E−M−E stable. I personally never experienced a crash in a productive (=non−experimental stuff)
environment
3.1.2. Download the source
Origin−Site http://www.apache.org/dist/httpd/
cd /usr/local/
tar −xvzf apache_1.3.27.tar.gz
3.1.3. Patch for large−scale sites
If your webserver should answer very much requests at the same time, and your machine is strong enough to
serve such an amount of requests, you can change the limit of maximum running processes
Download the patch from: http://www.delouw.ch/linux/apache−patch_HARD_SERVER_LIMIT.txt
−−− httpd.h Thu Mar 21 18:07:34 2002
+++ httpd.h−new Sun Apr 7 13:34:11 2002
@@ −320,7 +320,7 @@
#elif defined(NETWARE)
#define HARD_SERVER_LIMIT 2048
#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
Avoid running out of tasks
With wrong settings this could end as a »self−denial−of−service−attack« Be sure you have enough
processes left for root)
Apply the patch using:
cd /usr/local/apache_1.3.27/src/include
patch −p0 < apache−patch_HARD_SERVER_LIMIT.txt
3.2. mod_ssl
3.2.1. What is mod_ssl
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.
−−www.modssl.org
Apache Compile HOWTO
3.1. Get and untar the Apache Source 10
This module is needed to enable Apache for SSL−Requests (https). It applies a patch to the Apache
source−code and extends its API (Application Programming Interface). The result is called EAPI (Extended
Application Programming Interface).
Use of compilerflags while compiling modules
Make sure any module for your Apache server is compiled with the compiler−flag −DEAPI, or your
Webserver might crash or can not be started.
Almost all modules I know adds the −DEAPI flag by themself except mod_jserv and mod_jk
3.2.2. Download the source
Origin−Site:http://www.modssl.org
3.2.3. Applying the patch to the Apache source
cd /usr/local/
tar −xvzf mod_ssl−2.8.12−1.3.27.tar.gz
cd mod_ssl−2.8.12−1.3.27/
./configure −−with−apache=../apache_1.3.27
3.3. mod_perl
3.3.1. What is mod_perl
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.
−−perl.apache.org
mod_perl is a kind of substitute for cgi−bin's. cgi's typically forks a new process for each request, and
produces overhead. With mod_perl the perl−interpreter is loaded persistent in the Apache server and does not
need to fork processes for each request.
3.3.2. Download the source
Origin−Site: http://www.apache.org/dist/perl
3.3.3. Building and installing
cd /usr/local
tar −xvzf mod_perl−1.27.tar.gz
cd mod_perl−1.27
perl Makefile.PL EVERYTHING=1 APACHE_SRC=../apache_1.3.27/src USE_APACI=1 PREP_HTTPD=1 DO_HTTPD=1
Apache Compile HOWTO
3.2. mod_ssl 11
make
make install
Mod_perl can not be compiled as DSO
Do not compile mod_perl as DSO (Dynamic Shared Object)! According to various sources, Apache will
crash (I never tried).
3.4. Configure and build Apache
Now the two static modules mod_ssl and mod_perl are configured and the Apache Source has been patched,
and we can proceed with building Apache.
3.4.1. Building and installing
EAPI_MM="/usr/local/mm−1.2.2" 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
3.4.2. 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
Common name
OpenSSL asks for different things. A common error is to enter a wrong "common name". This should be
the FQHN (Fully Qualified HostName) of your Server, i.e www.foo.org
4. Additional modules
Apache Compile HOWTO
3.4. Configure and build Apache 12
4.1. mod_dav
4.1.1. What is mod_dav
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.
−−www.webdav.org
From the authors point of view:
DAV means: »Distributed authoring and Versioning«. It allows you to manage your Website similar to a
filesystem. It is meant to replace ftp−uploads to your webserver.
DAV is supported by all major web development tools (newer versions) and is going to be a widely accepted
standard for webpublishing.
4.1.2. Download the source
Origin−Site: http://www.webdav.org/mod_dav/
4.1.3. Building and installing
cd /usr/local
tar −xvzf mod_dav−1.0.3−1.3.6.tar.gz
cd mod_dav−1.0.3−1.3.6
./configure −−with−apxs=/usr/local/apache/bin/apxs
make
make install
Confusing filename
The filename mod_dav−1.0.3−1.3.6 suggests that it will only run with Apache 1.3.6 but it actually
will run with all Apaches >= 1.3.6
4.2. auth_ldap
4.2.1. What is auth_ldap
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 Frontpage
clients manage their web permissions while still using LDAP for authentication.
−−www.rudedog.org
From the authors point of view:
If you like to consolidate your login−facilities to a common user/passwd base, LDAP (Lightweight Directory
Access Protocol) is the right way. LDAP is an open standard and widely supported.
Login−facilities for LDAP:
Apache Compile HOWTO
4.1. mod_dav 13
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) LDAP is
role based. That means, i.e. you can define a role »manager« assign a user as member and that user can login
wherever a manager is allowed to login.
4.2.2. Download the source
Origin−Site: http://www.rudedog.org/auth_ldap/
4.2.3. Building and installing
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
4.3. mod_auth_mysql
4.3.1. What is mod_auth_mysql
It is a http−Basic Authentication Module. It allows to maintain your user comfortable in a MySQL−Database
4.3.2. Download the source
Origin−Site: ftp://ftp.kciLink.com/pub/mod_auth_mysql.c.gz
4.3.3. Building and installing
gunzip mod_auth_mysql.c.gz
/usr/local/apache/bin/apxs −c −I/usr/local/mysql/include −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 are added:
AddModule mod_auth_mysql.c
Take care that the path of MySQL libraries and includes are correct.
Library path
Be sure that /usr/local/mysql/lib/mysql is in /etc/ld.so.conf before compiling
Apache Compile HOWTO
4.2. auth_ldap 14
4.3.4. Sample configuration
Example 1. /usr/local/apache/conf/httpd.conf
AuthType Basic
AuthUserfile /dev/null
AuthName Testing
AuthGroupFile /dev/null
AuthMySQLHost localhost
AuthMySQLCryptedPasswords Off
AuthMySQLUser root
AuthMySQLDB users
AuthMySQLUserTable user_info
require valid−user
4.3.4.1. Script for creating the MySQL−Database
just type:
mysql < authmysql.sql
The File authmysql.sql contents:
Example 2. authmysql.sql
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);
4.4. mod_dynvhost
4.4.1. What is mod_dynvhost
It is a module that allows to define new Virtual Host "on−the−fly". Just create a new Directory in your
vhost−path, thats it. It is not need to restart your Webserver
It is a good solution for Mass−Virtual−hosting for ISP's
4.4.2. Download the source
Origin−Site: http://funkcity.com/0101/projects/dynvhost/mod_dynvhost.tar.gz
Apache Compile HOWTO
4.3. mod_auth_mysql 15
4.4.3. Building and installing
cd /usr/local
tar −xvzf mod_dynvhost.tar.gz
cd dynvhost/
/usr/local/apache/bin/apxs −i −a −c mod_dynvhost.c
Check httpd.conf
Notice: Take a look at httpd.conf if mod_dynvhost.so is loaded at startup:
LoadModule dynvhost_module libexec/mod_dynvhost.so
4.4.4. Sample configuration
Example 3. /usr/local/apache/conf/httpd.conf
HomeDir /
Now create a Directory for each virtualhost in /usr/local/apache/htdocs/vhosts/
i.e.
/usr/local/apache/htdocs/vhosts/foo.bar.org
You don't need to restart your Webserver