Installer un serveur Web HTTP (Apache)



Logiciels

ApacheApache 1.3.9 -- 19 août 1999

"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."

Apache was originally based on code and ideas found in the most popular HTTP server of the time. NCSA httpd 1.3 (early 1995). It has since evolved into a far superior system which can rival (and probably surpass) almost any other UN*X based HTTP server in terms of functionality, efficiency and speed.

mod_sslmod_ssl 2.4.5-1.3.9 -- 01 octobre 1999

"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.

The mod_ssl package was created in April 1998 by Ralf S. Engelschall and was originally derived from software developed by Ben Laurie for use in the Apache-SSL HTTP server project. The mod_ssl package is licensed under a BSD-style licence, which basically means that you are free to get and use it for commercial and non-commercial purposes."

OpenSSLopenssl 0.9.4 -- 09 août 1999

"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 with full-strength cryptography world-wide. 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.
SSLEayOpenSSL 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."

SSLeay 0.9.0b d'Eric A. Young et Tim J. Hudson.

mod_dav 0.9.11-1.3.6 -- 12 septembre 1999

"mod_dav is an Apache module to provide DAV capabilities for your Apache web server. It is an Open Source module, provided under an Apache-style license. This page serves as a distribution point, as documentation, and as a FAQ for mod_dav. Updates, clarifications, questions, etc, are gratefully accepted at gstein@lyra.org."

mod_dav enables Apache to understand DAV protocol (extensions to HTTP). DAV stands for "Distributed Authoring and Versioning", and is defined by RFC 2518. DAV is intended to replace proprietary authoring protocols such as those used by Frontpage or NetObjects' Fusion, but is also a complete set of protocols for manipulating a webserver's files and directories, and their properties.
Changes: Major fixes to XML namespace handling.

mod_perlmod_perl 1.21 02 juillet 1999

"The Apache/Perl integration project brings together the full power of the Perl programming language and the Apache HTTP server.
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."

Eventuellement... mais non traité

mod_frontpage 1.3.6-3.0.4.3 -- 29 mars 1999
mod_frontpage is a port of the FrontPage server extensions patch for the most recent versions of the Apache Webserver.
Changes: This is mainly an update for Apache 1.3.6.

Installation

Apache sera compilé avec ses modules indispensables.
Tous les autres modules seront dynamiquement chargeables.
  1. compilez et installez openssl Éditez le fichier Configure pour optimiser les paramètres de votre plate-forme.
    $ lynx ftp://ftp.openssl.org/sources/openssl-0.9.4.tar.gz
    $ tar xvzf openssl-0.9.4.tar.gz
    $ cd openssl-0.9.4
    $ ./config
    $ perl util/ssldir.pl /opt/openssl
    $ make
    $ make rehash
    $ make test
    $ make install
    $ cd ..
    $ rm -rf openssl-0.9.4
    
    Ne vous dispensez pas de lire le fichier INSTALL.
  2. Intégrez mod_ssl à Apache
    $ lynx ftp://ftp.engelschall.com/sw/mod_ssl/mod_ssl-2.4.5-1.3.9.tar.gz
    $ lynx ftp://ftp.apache.org/apache/dist/apache_1.3.9.tar.gz
    $ tar xvzf mod_ssl-2.4.5-1.3.9.tar.gz
    $ tar xvzf apache_1.3.9.tar.gz
    $ cd mod-ssl-2.4.5-1.3.9
    $ ./configure --with-apache=../apache_1.3.9
    $cd ..
    
  3. Compilez et installez Apache
    Editez le fichier src/Comfiguration.tmpl pour activer ou désactiver les modules souhaités.
    Dans mon cas j'ai activé : mod_env, mod_log_config, mod_mime_magic, mod_mime, mod_negociation, mod_include, mod_autoindex, mod_dir, mod_cgi, mod_asis, mod_imap, mod_actions, mod_alias, mod_access, mod_auth et mod_setenvif. Tous les autres modules seront des DSO via l'option --enable-shared=remain.
    $ cd apache_1.3.9
    $ CFLAGS='-O2 -s -march=pentiumpro' SSL_BASE=/opt/openssl \
    	./configure --prefix=/usr/local/apache \
    	--enable-shared=remain --disable-rule=SSL_COMPAT
    $ make
    $ make certificate
    $ make install
    $ cd ..
    $ rm -rf mod_ssl-2.4.5-1.3.9
    $ rm -rf apache_1.3.9
    
  4. Compilez et installez mod_dav.
    $ lynx ftp://.../mod_dav-0.9.11-1.3.6.tar.gz
    $ tar xvzf mod_dav-0.9.11-1.3.6.tar.gz
    $ cd mod_dav-0.9.11-1.3.6
    $ make -f Makefile.apxs install
    $ cp mod_dav.h /usr/local/include/
    $ cd ..
    $ rm -rf mod_dav-0.9.11-1.3.6
    
  5. Compilez et Installez mod_perl
    $ lynx ftp://perl.apache.org/.../mod_perl-1.19.tar.gz
    $ tar xvzf mod_perl-1.19.tar.gz
    $ cd mod_perl-1.19
    $ perl Makefile.PL USE_APXS=1 WITH_APXS=/usr/local/apache/bin/apxs \
    	EVERYTHING=1
    $ make
    $ make install
    $ cd ..
    $ rm -rf mod_perl-1.19
    
  6. Fire up your SSL-aware Apache and try it out (please replace "local-host-name" with the fully qualified domain name (FQDN) of your website which you entered at the "make certificate" step above)
    $ /usr/local/apache/sbin/httpd -DSSL
    $ netscape https://local-host-name/
    
$ cd /usr/local/apache
$ mkdir /home/admin.domainname
$ mv htdocs /home/admin.domainname/apache
$ ln -sf /home/admin.domainname htdocs
$ mv logs /var/log/httpd
$ ln -sf /var/log/httpd logs
$ cp bin/apachectl /etc/rc.d/init.d/apache

Configuration

Fichiers principaux

httpd.conf

Fichiers secondaires

mime.types
magic

Sécurité

Un serveur Web permet aux utilisateurs de télécharger des fichiers désignés et d'exécuter des scripts CGI (Common Gateway Interface). Voici 10 astuces pour sécuriser un serveur Web dans un environnement NT-UN*X:
  1. Configurez le serveur Web pour refuser l'accès des utilisateurs aux fichiers sensibles.
  2. Limitez le serveur Web à une sous arborescence de répertoires spécifiques.
  3. Refusez aux utilisateurs l'accès au fichier de sécurité des mots de passe du serveur Web.
  4. Donnez au logiciel du serveur Web des privilèges systèmes limités.
  5. Installer un pare-feu entre le serveur Web et le réseau interne lorsque le serveur Web est connecté à l'Internet.
  6. N'utilisez pas les fichiers d'équivalence UN*X (hosts.equiv) ou les relations d'approbation des domaines NT pour définir des relations d'approbation entre l'hôte interne et le serveur Web externe. Sinon si des pirates pénètrent dans un système du domaine, tous les autres domaines approuvés sont menacés.
  7. Assurez-vous que les scripts CGI n'effectuent que la tâche prévue. Rappelez vous que les utilisateurs externes d'Internet peuvent exécuter ces scripts avec desparamètres qu'ils choisissent à leur gré.
  8. Ne laissez pas les utilisateurs FTP télécharger des scripts CGI dans la zone du système de fichiers du serveur Web.
    Ne les laissez pas non plus télécharger leurs propres fichiers. Donnez à la permission du repertoire cgi-bin l'option lire-exécuter.
  9. Désactiver tous les services que vous n'utilisez pas sur le serveur Web.
  10. Utilisez S-HTTP ou SSL pour chiffrer les mots de passe et les données. N'utilisez pas HTTP car c'est un protocole non chiffré qui n'évite pas l'espionnage ou les renifleurs.

Administration

Script de démarrage

Éditez le fichier /etc/rc.d/init.d/apache et ajoutez:
# chkconfig: 345 85 15
# description: Apache is a World Wide Web server.  It is used to serve \
#	       HTML files and CGI.
# processname: httpd
# pidfile: /usr/local/apache/logs/httpd.pid
# config: /usr/local/apache/conf/httpd.conf
Initialisez le script de démarrage d'apache
$ chkconfig --add apache

Personnalisez les messages d'erreurs

Documentation


Christophe Merlet
redfox@redfoxcenter.org
©Tous droits réservés
03 octobre 1999