Professional Documents
Culture Documents
Configuratio LAMP Debian
Configuratio LAMP Debian
<IfModule mod_dir.c>
DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm
</IfModule>
||
<IfModule mod_dir.c>
DirectoryIndex index.php index.html index.cgi index.pl index.xhtml index.htm
</IfModule>
<?php
phpinfo();
?>
try {
$db = new PDO("mysql:host=localhost;dbname=$database", $user, $password);
}
Etape 6: Configuration https
-------
#redemarrer appache2: systectl restart appache2
#activer le module ssl: a2enmod ssl
#redemarrer appache2: systectl restart appache2
#activer le site wb par defaut: a2ensite default-ssl
#redemarrer appache2: systectl restart appache2
#Créez un certificat SSL auto-signé: mkdir /etc/apache2/ssl
#openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout
/etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt
#definir les autorisations pour proteger votre cle: chmod 600 /etc/apache2/ssl/*
#configurer Appache pour utilise SSL: vim /etc/apache2/sites-enabled/default-
ssl.conf
ServerAdmin webmaster@localhost
ServerName example.com:443(nom de votre domaine)
SSLCertificateFile /etc/apache2/ssl/apache.crt
SSLCertificateKeyFile /etc/apache2/ssl/apache.key
<IfModule mod_ssl.c>
<VirtualHost _default_:443>
ServerAdmin webmaster@localhost
ServerName example.com:443
DocumentRoot /var/www/html
. . .
SSLEngine on
. . .
SSLCertificateFile /etc/apache2/ssl/apache.crt
SSLCertificateKeyFile /etc/apache2/ssl/apache.key