Vous êtes sur la page 1sur 22

APACHE Installation & Configuration

Prsent par: Mehdi Belkiyal Sara Elboutaybi

PLAN

Installation dApache:
Install Apache web server sur Linux Install PHP

Configuration dApache:
Httpd.conf Dmarrage Pageweb

INTRODUCTION

INSTALLATION:

INSTALLATION:
Apache partir dune source:

$ rpm -tb httpd-2.0.47.tar.gz


Fichier RPM gners: httpd-2.0.47-1.rpm
httpd-devel-2.0.47-1.rpm httpd-ssl-2.0.47-1.rpm

Dans /usr/src/packages/RPMS/i386

INSTALLATION:

Installer :

$ rpm -ivh apache-1.3.28-1.i386.rpm


Connatre le contenu du rpertoire:

$ rpm -qlp apache-1.3.28-1.i386.rpm


Mise jour:

$ rpm -Uvh apache-1.3.28-1.i386.rpm

INSTALLATION:
INSTALLATION dautres modules dapache:

BuildPrereq: apr-devel, apr-util-devel, openldap-devel, db4-devel, expatdevel, findutils, perl, pkgconfig

Utiliser httpd.spec pour liminer les dpendences.

$ tar zxvf httpd-2.0.47.tar.gz httpd-2.0.47/httpd.spec $ mv httpd-2.0.47/httpd.spec . ...edit httpd.spec... $ cp httpd-2.0.47.tar.gz /usr/src/packages/SOURCES $ rpm -b httpd.spec

INSTALLATION:
yum install httpd

INSTALLATION:

yum install php*

Configuration
IP Address et port ServerName

Administrators E-Mail Address

Server Root
Document Root Default Error Log

User and Group


www.my-domain.com

Configuration

cd /etc/httpd/conf cp httpd.conf httpd.conf.old nano httpd.conf

Configuration
ServerName www.alpha-complex.com Listen 192.168.1.1:80
@IP Port Sinon:

Listen 80
Port

Commande:

groupadd -g 999 httpd useradd -u 999 -g httpd -s /bin/false -c 'Web Server

Configuration: User httpd Group httpd

Configuration
ServerAdmin administrator@someotherdomain.net

ServerRoot /usr/local/apache

DocumentRoot htdocs DocumentRoot /usr/local/apache/htdocs

Configuration
Httpd.conf

Configuration
dmarre automatiquement: chkconfig --level 235 httpd on chkconfig --list httpd

Dmarrer Apache:
$ /usr/local/apache/bin/httpd
Sinon:

$ /usr/local/apache/bin/httpd -f /home/www/alphacomplex/conf/httpd-test.conf

Si on veut dmarrer avec SSL:

$ /usr/local/apache/bin/apachectl startssl

Dmarrer Apache:
Pour vrifier:

$ ps -aux | grep httpd

Pour surveiller le dmarrage et les erreurs probables:

$ tail -f /usr/local/apache/logs/error_log & $ /usr/local/apache/bin/apachectl start

Dmarrer Apache:
Arrter, redmarrer

ID du Processus parent

kill -TERM `cat /usr/local/apache2/logs/httpd.pid`

apachectl -k stop apachectl -k graceful


Chemin pour httpd.pid

Hbergement: /www (root for all hosted domains) /www/your-domain (domain directory) /www/your-domain/html (directory for your web sitefiles) /www/your-domain/html/cgi-bin (CGI directory for executing Perl scripts) /www/your-domain/databases (databases for this web site stored on a per site basis) /www/your-domain/logs (web site access and error logs are stored here) cd /www mkdir your-domain cd your-domain mkdir html mkdir html/cgi-bin mkdir databases mkdir logs

mkdir /www chown root.root /www

Hbergement: useradd -d /www/your-domain/ domain_user ou useradd -d /www/your-domain/ -s /sbin/nologin domain_user

passwd domain_user [enter password] [confirm password]

cd /www chown -R domain_user:domain_user your-domain

Vhosts:

Vhosts:

cd /etc/httpd/conf mkdir vhosts cd vhosts

'Include conf/vhosts/*.conf'

Vous aimerez peut-être aussi