Tout d'abord vous devez avoir en votre possession deux serveurs ,dans mon cas ce sera deux serveurs VPS; ici ISPconfig va être configuré en mode multiserver pour accueillir plusieurs serveurs comme par exemple un serveur gère le site web et l'autre serveur gère la base de données.
Serveur 1 (ou master server): vps….lws-hosting.com adresse IP : 192.168.1.105
Serveur 2 (ou server esclave) : vps….lws-hosting.com adresse IP : 192.168.1.106
Pour toutes les étapes suivantes vous devrez ouvrir deux consoles , une par serveur.
Les différentes étapes qui vont suivre sont à réaliser sur les deux serveurs, dans le cas où une configuration appartient à seul serveur alors je l’indiquerai en rouge; tout d'abord éditer le fichier hosts :
nano /etc/hosts
remplissez le comme ceci (avec vos adresses IP de vos serveurs):
127.0.0.1 localhost 192.168.1.105 nom_du_serveur1 192.168.1.106 nom_du_serveur2 # The following lines are desirable for IPv6 capable hosts ::1 localhost ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters ff02::3 ip6-allhosts
Ensuite nous allons définir le nom d'hôte du serveur
echo nom_du_serveur1 > /etc/hostname /etc/init.d/hostname.sh start
et sur le deuxième serveur pareil mais avec le nom du serveur 2.
Ensuite éditer le fichier sources.list :
nano /etc/apt/sources.list
et ajouter les 2 lignes suivantes à ce fichier.
deb http://volatile.debian.org/debian-volatile lenny/volatile main contrib non-free deb http://www.backports.org/debian/ lenny-backports main contrib non-free
Voilà maintenant nous allons installer tous les paquets nécessaires pour faire fonctionner ISPconfig; en faite il faudra bien installer deux ISPconfig mais le dexuième serveur sera le miroir du premier) , donc installer le paquet debian-backports-keyring
apt-get install debian-backports-keyring apt-get update
ensuite ;
apt-get upgrade
Nous allons synchroniser les horloges :
apt-get -y install ntp ntpdate
Toutes ces installations sont bien sûr à installer sur les deux serveurs.
Maintenant nous allons installer les paquets nécessaires pour ISPconfig ; tout d'abord installer les services mails et de base de données :
apt-get -y install postfix postfix-mysql postfix-doc mysql-client mysql-server openssl getmail4 rkhunter binutils dovecot-imapd dovecot-pop3d sudo
Entrez le nouveau mot de passe mysql à la demande de l'installateur et de répondre aux questions suivantes comme décrit ci-dessous:
Créer des répertoires pour l'administration basée sur le Web? ← non
de type général de configuration? ← site internet
nom de Mail? ← nom_du_serveur
certificat SSL nécessaire ← OK
Editez le fichier /etc/mysql/my.cnf ( et commentez la ligne bind-address)
nano /etc/mysql/my.cnf
et remplissez le comme suivi :
[...] # Instead of skip-networking the default is now to listen only on # localhost which is more compatible and is not less secure. #bind-address = 127.0.0.1 [...]
ensuite redémarrez mysql :
/etc/init.d/mysql restart
Maintenant installer amavisd-new, SpamAssassin, et ClamAV:
apt-get -y install amavisd-new spamassassin clamav clamav-daemon zoo unzip bzip2 arj nomarch lzop cabextract apt-listchanges libnet-ldap-perl libauthen-sasl-perl clamav-docs daemon libio-string-perl libio-socket-ssl-perl libnet-ident-perl zip libnet-dns-perl
Puis installer Apache2, PHP5, phpMyAdmin, FCGI, suExec, Pear, and mcrypt comme suivi:
apt-get -y install apache2 apache2.2-common apache2-doc apache2-mpm-prefork apache2-mpm-itk apache2-utils libexpat1 ssl-cert libapache2-mod-php5 php5 php5- common php5-gd php5-mysql php5-imap phpmyadmin php5-cli php5-cgi libapache2-mod- fcgid apache2-suexec php-pear php-auth php5-mcrypt mcrypt php5-imagick imagemagick libapache2-mod-suphp libopenssl-ruby libapache2-mod-ruby sudo
Cette question va apparaître:
configurez automatiquement le serveur web : ←- apache2
Puis lancer cette commande pour modifier un des modules d'apache:
a2enmod suexec rewrite ssl actions include ruby dav_fs dav auth_digest
PureFTPd and quota can be installed with the following command:
apt-get -y install pure-ftpd-common pure-ftpd-mysql quota quotatool
Editez le fichier /etc/fstab.
nano /etc/fstab
remplissez comme ceci :
# /etc/fstab: static file system information. # # <file system> <mount point> <type> <options> <dump> <pass> proc /proc proc defaults 0 0 /dev/sda1 / ext3 errors=remount-ro,usrquota,grpquota 0 1 /dev/sda5 none swap sw 0 0 /dev/hda /media/cdrom0 udf,iso9660 user,noauto 0 0 /dev/fd0 /media/floppy0 auto rw,user,noauto 0 0
Exécutez les commandes suivantes:
touch /quota.user /quota.group chmod 600 /quota.* mount -o remount /
quotacheck -avugm quotaon -avug
Installer BIND DNS Server:
apt-get -y install bind9 dnsutils
Installer vlogger , webalizer et awstats:
apt-get -y install vlogger webalizer awstats
Installer Jailkit : Jailkit est à utiliser si l'utilisateur dispose d'un accès chroot ssh :
apt-get -y install build-essential autoconf automake1.9 libtool flex bison
cd /tmp wget http://olivier.sessink.nl/jailkit/jailkit-2.11.tar.gz tar xvfz jailkit-2.11.tar.gz cd jailkit-2.11 ./configure make make install cd .. rm -rf jailkit-2.11*
Installer fail2ban (il est en option mais il est conseillé de l'installe rpour ISPconfig:
apt-get install fail2ban
Installer GlusterFS et Fuse:
apt-get -y --force-yes -t lenny-backports install fuse-utils apt-get -y --force-yes install glusterfs-server glusterfs-client
Supprimez le fichier de configuration GlusterFS :
rm -f /etc/glusterfs/*.vol
Créer des répertoires pour GlusterFS:
mkdir /data/ mkdir /data/export-mysql mkdir /data/export-mysql-ns mkdir /data/export-vmail mkdir /data/export-vmail-ns mkdir /data/export-www mkdir /data/export-www-ns
Ouvrez le fichier de configuration de GlusterFS:
nano /etc/glusterfs/glusterfsd.vol
et remplissez comme suivi mais remplacez ces adresses IP par les vôtres et mettez un mot de passe à la place de 7wQav7ExkFg6eW:
# Configuration for the mysql server volume volume posix-mysql type storage/posix option directory /data/export-mysql option background-unlink yes end-volume volume locks-mysql type features/locks option mandatory-locks on subvolumes posix-mysql end-volume volume brick-mysql type performance/io-threads option thread-count 8 subvolumes locks-mysql end-volume # Configuration for the vmail server volume volume posix-vmail type storage/posix option directory /data/export-vmail end-volume volume locks-vmail type features/locks subvolumes posix-vmail end-volume volume brick-vmail type performance/io-threads option thread-count 8 subvolumes locks-vmail end-volume # Configuration for the www server volume volume posix-www type storage/posix option directory /data/export-www end-volume volume locks-www type features/locks subvolumes posix-www end-volume volume brick-www type performance/io-threads option thread-count 8 subvolumes locks-www end-volume # export all volumes volume server type protocol/server option transport-type tcp subvolumes brick-mysql brick-vmail brick-www # authentication options for the mysql volume option auth.addr.brick-mysql.allow 192.168.1.105,192.168.1.106 option auth.login.brick-mysql.allow user-mysql option auth.login.user-mysql.password 7wQav7ExkFg6eW # Authentification options for the vmail volume option auth.addr.brick-vmail.allow 192.168.1.105,192.168.1.106 option auth.login.brick-vmail.allow user-vmail option auth.login.user-vmail.password 7wQav7ExkFg6eW # authentification options for www option auth.addr.brick-www.allow 192.168.1.105,192.168.1.106 option auth.login.brick-www.allow user-www option auth.login.user-www.password 7wQav7ExkFg6eW end-volume
Démarrez GlusterFS :
/etc/init.d/glusterfs-server start
Maintenant créer trois clients pour configurer le système GlusterFS :
nano /etc/glusterfs/glusterfs-mysql.vol
volume remote1-mysql type protocol/client option transport-type tcp option remote-host 192.168.1.105 option remote-subvolume brick-mysql option username user-mysql option password 7wQav7ExkFg6eW end-volume volume remote2-mysql type protocol/client option transport-type tcp option remote-host 192.168.1.106 option remote-subvolume brick-mysql option username user-mysql option password 7wQav7ExkFg6eW end-volume volume replicate-mysql type cluster/replicate subvolumes remote1-mysql remote2-mysql end-volume volume cache-mysql type performance/io-cache option cache-size 25MB subvolumes replicate-mysql end-volume
nano /etc/glusterfs/glusterfs-vmail.vol
volume remote1-vmail type protocol/client option transport-type tcp option remote-host 192.168.1.105 option remote-subvolume brick-vmail option username user-vmail option password 7wQav7ExkFg6eW end-volume volume remote2-vmail type protocol/client option transport-type tcp option remote-host 192.168.1.106 option remote-subvolume brick-vmail option username user-vmail option password 7wQav7ExkFg6eW end-volume volume replicate-vmail type cluster/replicate subvolumes remote1-vmail remote2-vmail end-volume volume writebehind-vmail type performance/write-behind option window-size 1MB subvolumes replicate-vmail end-volume volume cache-vmail type performance/io-cache option cache-size 256MB subvolumes writebehind-vmail end-volume
nano /etc/glusterfs/glusterfs-www.vol
volume remote1-www type protocol/client option transport-type tcp option remote-host 192.168.0.105 option remote-subvolume brick-www option username user-www option password 7wQav7ExkFg6eW end-volume volume remote2-www type protocol/client option transport-type tcp option remote-host 192.168.0.106 option remote-subvolume brick-www option username user-www option password 7wQav7ExkFg6eW end-volume volume replicate-www type cluster/replicate subvolumes remote1-www remote2-www end-volume volume writebehind-www type performance/write-behind option window-size 1MB subvolumes replicate-www end-volume volume cache-www type performance/io-cache option cache-size 256MB subvolumes writebehind-www end-volume
Voilà après les avoir créé et toujours dans les deux serveurs , stoppez ces services :
/etc/init.d/mysql stop /etc/init.d/apache2 stop /etc/init.d/postfix stop /etc/init.d/dovecot stop
Puis déplacer ces fichiers :
mv /var/lib/mysql /var/lib/mysql_bak mv /var/www /var/www_bak
Créez ces fichiers :
mkdir /var/lib/mysql mkdir /var/www mkdir /var/vmail
Editez ce fichier :
nano /etc/fstab
Ajouter y les lignes suivantes :
/etc/glusterfs/glusterfs-mysql.vol /var/lib/mysql glusterfs defaults 0 0 /etc/glusterfs/glusterfs-vmail.vol /var/vmail glusterfs defaults 0 0 /etc/glusterfs/glusterfs-www.vol /var/www glusterfs defaults 0 0
Puis exécutez :
mount -a
Modifier les droits pour l'utilisateur mysql:
chown mysql:mysql /var/lib/mysql
Copier les fichiers mysql-bak et www-bak.
cp -prf /var/lib/mysql_bak/* /var/lib/mysql/ cp -prf /var/www_bak/* /var/www/
Cette partie concerne uniquement le serveur maître c'est à dire le serveur que vous avez souhaité de mettre en 1.
nano /etc/mysql/my.cnf
ajoutez cette ligne dans la partie [mysqld]
innodb_file_per_table
Pour le serveur 2 , copier le contenu du fichier /etc/mysql/debian.cnf dans celui du master server avant de redémarrer MySQL!
Maintenant redémarrez les services:
/etc/init.d/mysql start /etc/init.d/apache2 start /etc/init.d/postfix start /etc/init.d/dovecot start
Et déplacez ces fichiers avant de pouvoir passer aux installations des deux ISPconfig.
mv /etc/rc2.d/S20glusterfs-server /etc/rc2.d/S19glusterfs-server mv /etc/rc3.d/S20glusterfs-server /etc/rc3.d/S16glusterfs-server mv /etc/rc4.d/S20glusterfs-server /etc/rc4.d/S16glusterfs-server mv /etc/rc5.d/S20glusterfs-server /etc/rc5.d/S16glusterfs-server
Tout d'abord nous allons installer deux utilisateurs MySQL par rapport aux deuxièmes serveurs avec son adresse Ip et le nom du serveur; pour cela aller dans la console mysql de votre serveur :
mysql -u root -p
saisissez votre mot de passe puis entrez les commandes suivantes :
CREATE USER 'root'@'192.168.1.106' IDENTIFIED BY 'myrootpassword'; GRANT ALL PRIVILEGES ON * . * TO 'root'@'192.168.0.106' IDENTIFIED BY 'myrootpassword' WITH GRANT OPTION MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;
CREATE USER 'root'@'server2.example.tld' IDENTIFIED BY 'myrootpassword'; GRANT ALL PRIVILEGES ON * . * TO 'root'@'server2.example.tld' IDENTIFIED BY 'myrootpassword' WITH GRANT OPTION MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;
Remplacez 192.168.1.106 par l'IP du second serveur, et remplacez server2.example.tld par le nom du second serveur et myrootpassword par le mot de passe que vous voulez.
Maintenant dans la console de votre serveur 1.
cd /tmp wget http://www.ispconfig.org/downloads/ISPConfig-3-stable.tar.gz tar xfz ISPConfig-3-stable.tar.gz cd ispconfig3_install/install/
Lancer l'installation:
php -q install.php
Select language (en,de) [en]: ←- en
Installation mode (standard,expert) [standard]: ←- standard
Full qualified hostname (FQDN) of the server, eg server1.domain.tld [server1.example.tld]: ←- nom_de_votre_serveur_1
MySQL server hostname [localhost]: ←- localhost
MySQL root username [root]: ←- root
MySQL root password []: ←- Entrez votre mot de passe mysql root ici
MySQL database to create [dbispconfig]: ←- dbispconfig1
MySQL charset [utf8]: ←- utf8
Country Name (2 letter code) [AU]: ←- DE
State or Province Name (full name) [Some-State]: ←- Niedersachsen
Locality Name (eg, city) []: ←- Lueneburg
Organization Name (eg, company) [Internet Widgits Pty Ltd]: ← ENTER
Organizational Unit Name (eg, section) []: ← ENTER
Common Name (eg, YOUR name) []: ← ENTER
Email Address []: ← ENTER
ISPConfig Port [8080]: ←- 8080
Supprimez le fichier d'installation :
rm -rf /tmp/ispconfig3_install/install rm -f /tmp/ISPConfig-3-stable.tar.gz
Cette étape va donc concerner la configuration du serveur 2.
cd /tmp wget http://www.ispconfig.org/downloads/ISPConfig-3-stable.tar.gz tar xfz ISPConfig-3-stable.tar.gz cd ispconfig3_install/install/
Lancer l'installation:
php -q install.php
Select language (en,de) [en]: ←- en
Installation mode (standard,expert) [standard]: ←- expert ← étape la plus importante
Full qualified hostname (FQDN) of the server, eg server2.domain.tld [server2.example.tld]: ←- nom_du_serveur_2
MySQL server hostname [localhost]: ←- localhost
MySQL root username [root]: ←- root
MySQL root password []: ←- le mot de passe root Mysql
MySQL database to create [dbispconfig]: ←- dbispconfig2
MySQL charset [utf8]: ←- utf8
Shall this server join an existing ISPConfig multiserver setup (y,n) [n]: ←- y
MySQL master server hostname []: ←- nom_du_serveur_1
MySQL master server root username [root]: ←- root
MySQL master server root password []: ←- entrez le mot de passe root de votre serveur 1
MySQL master server database name [dbispconfig]: ←- dbispconfig1
Configure Mail (y,n) [y]: ←- y
Country Name (2 letter code) [AU]: ←- DE
State or Province Name (full name) [Some-State]: ←- Niedersachsen
Locality Name (eg, city) []: ←- Lueneburg
Organization Name (eg, company) [Internet Widgits Pty Ltd]: ← ENTER
Organizational Unit Name (eg, section) []: ← ENTER
Common Name (eg, YOUR name) []: ← ENTER
Email Address []: ← ENTER
Configure Jailkit (y,n) [y]: ←- y
Configure FTP Server (y,n) [y]: ←- y
Configure DNS Server (y,n) [y]: ←-y
Configure Apache Server (y,n) [y]: ←- y
Configure Firewall Server (y,n) [y]: ←-y
Install ISPConfig Web-Interface (y,n) [y]: ←-n
Exécutez:
rm -f /var/www/ispconfig
Puis supprimez lle fichier d'installation:
rm -rf /tmp/ispconfig3_install/install rm -f /tmp/ISPConfig-3-stable.tar.gz
Aller dans l'URL de votre navigateur et tapez : http://192.168.1.105:8080; qui est l'adresse IP de votre serveur 1.
Vous voilà sur ISPconfig et vous pouvez constater en cliquant sur monitor vous verrez vos deux serveurs sur un ISPconfig :
Maintenant il reste une seule chose à réaliser vous devez vous rendre dans systèmes → services serveurs et cliquez sur le deuxième serveur puis sélectionnez à la ligne "is mirror of server" le nom du master serveur puis enregistrer et vos deux serveurs sont maintenant administrer par un seul panel administrateur.