Sie sind auf Seite 1von 1

Installation d’un serveur web Apache / PHP / MySQL sous Linux (Ubuntu) 

Installation de la solution complète LAMP 
La solution la plus rapide celle‐ci : 
• Ouvrir une console 
• Taper : 
sudo apt-get install apache2 apache2-doc mysql-server php5 libapache2-mod-php5 php5-mysql php5-gd
• Après installation, redémarrer Ubuntu 
• Créer un répertoire web qui accueillera les applications (ex: /web) 
• Lui donner toutes les permissions : sudo chmod -R 777 /web 
 
La configuration d'Apache se trouve dans : /etc/apache2/apache2.conf et /etc/apache2/httpd.conf (ce 
dernier étant réservé à l'utilisateur). 
La configuration de PHP se trouve dans : /etc/php5/apache2/php.ini. 
La configuration de MySQL se trouve dans : /etc/mysql/my.cnf. 
Après toute modification des fichiers de configuration, redémarrer Apache : 
sudo /etc/init.d/apache2 reload
 
Toute  la  documentation  à  cette  adresse  :  http://doc.ubuntu‐fr.org/lamp  et  http://doc.ubuntu‐
fr.org/modules_php 

Configuration d’Apache 
Editer le fichier /etc/apache2/httpd.conf en super utilisateur et ajouter ceci : 
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .phtml
Alias /web "/web"
<Directory "/web">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
Après chaque modification, redémarrer Apache : sudo /etc/init.d/apache2 reload 

Pour vérifier que tout fonctionne bien, ouvrir un navigateur web et entrer l'adresse internet suivante : 
http://localhost  quand  le  serveur  et  le  client  sont  hébergés  par  la  même  machine,  sinon 
http://adresse_ip_serveur  dans  le  cas  d’un  simple  client.  Si  ça  fonctionne,  le  message  "It  works!" 
apparait dans le navigateur. 

Configuration de PHP 
Créer le répertoire /etc/php5/includes : sudo mkdir /etc/php5/includes 
Modifier les paramètres dans le fichier /etc/php5/apache2/php.ini en super utilisateur: 
memory_limit = 50M
post_max_size = 50M
upload_max_filesize = 50M
include_path = "/etc/php5/includes"
A  noter  que  ces  modifications  sont  à  adapter  selon  les  utilisations  et  que  d’autres  paramètres  sont  à 
disposition. Après chaque modification, redémarrer Apache : sudo /etc/init.d/apache2 reload 
 

Installation d’un serveur web Apache / PHP / MySQL sous Linux – Philippe PAMART © 2008  1 

Das könnte Ihnen auch gefallen