Aller au contenu principal

Installer WHMCS

Installation WHMCS sur RedHeberg

WHMCS est la solution de facturation et gestion client de référence pour les hébergeurs. Ce guide détaille l'installation complète sur votre infrastructure RedHeberg, que ce soit sur un VPS Xeon KVM ou un serveur dédié.

Prérequis système

Configuration recommandée

Pour une installation WHMCS optimale, nous recommandons :

RessourceMinimumRecommandé
CPU2 vCPU4 vCPU
RAM4 GB8 GB
Stockage30 GB80 GB
Bande passanteIllimitéeIllimitée
Configuration idéale RedHeberg

Un VPS Xeon KVM M (4vCPU/8GB/80GB) à 7,95€/mois est parfait pour débuter avec WHMCS.

Prérequis logiciels

WHMCS nécessite les composants suivants :

  • PHP 8.1 à 8.3 (recommandé : PHP 8.2)
  • MariaDB 10.6+ ou MySQL 8.0+
  • ionCube Loader pour PHP
  • Apache/Nginx avec mod_rewrite

Étape 1 : Préparation du serveur

Installation des dépendances

Connectez-vous à votre VPS RedHeberg :

# Connexion SSH
ssh root@YOUR_SERVER_IP

# Mise à jour du système
apt update && apt upgrade -y

# Installation LAMP stack
apt install -y apache2 mariadb-server php8.2 php8.2-mysql php8.2-curl php8.2-gd php8.2-mbstring php8.2-xml php8.2-zip php8.2-intl php8.2-bcmath

# Activation des modules Apache
a2enmod rewrite ssl headers
systemctl restart apache2

Configuration de MariaDB

# Sécurisation de MariaDB
mysql_secure_installation

# Connexion à MariaDB
mysql -u root -p

# Création de la base WHMCS
CREATE DATABASE whmcs_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'whmcs_user'@'localhost' IDENTIFIED BY 'motdepasse_securise';
GRANT ALL PRIVILEGES ON whmcs_db.* TO 'whmcs_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Étape 2 : Installation d'ionCube Loader

ionCube Loader est obligatoire pour WHMCS :

# Téléchargement ionCube Loader
cd /tmp
wget https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
tar xzf ioncube_loaders_lin_x86-64.tar.gz

# Installation
cp ioncube/ioncube_loader_lin_8.2.so /usr/lib/php/20220829/
echo "zend_extension = /usr/lib/php/20220829/ioncube_loader_lin_8.2.so" > /etc/php/8.2/apache2/conf.d/00-ioncube.ini
echo "zend_extension = /usr/lib/php/20220829/ioncube_loader_lin_8.2.so" > /etc/php/8.2/cli/conf.d/00-ioncube.ini

# Redémarrage Apache
systemctl restart apache2

# Vérification
php -m | grep -i ioncube

Étape 3 : Installation de WHMCS

Téléchargement et déploiement

# Création du répertoire web
mkdir -p /var/www/html/whmcs
cd /var/www/html/whmcs

# Téléchargement WHMCS (version d'évaluation)
wget https://releases.whmcs.com/v2/releases/download/latest -O whmcs-latest.zip
unzip whmcs-latest.zip
rm whmcs-latest.zip

# Attribution des permissions
chown -R www-data:www-data /var/www/html/whmcs
chmod -R 755 /var/www/html/whmcs

Configuration Apache

Créez un virtual host pour WHMCS :

cat > /etc/apache2/sites-available/whmcs.conf << EOF
<VirtualHost *:80>
ServerName votre-domaine.com
DocumentRoot /var/www/html/whmcs

<Directory /var/www/html/whmcs>
AllowOverride All
Require all granted
</Directory>

ErrorLog \${APACHE_LOG_DIR}/whmcs_error.log
CustomLog \${APACHE_LOG_DIR}/whmcs_access.log combined
</VirtualHost>
EOF

# Activation du site
a2ensite whmcs.conf
a2dissite 000-default.conf
systemctl reload apache2

Étape 4 : Configuration initiale WHMCS

Lancement de l'installateur web

  1. Accédez à http://YOUR_SERVER_IP/install/install.php
  2. Acceptez la licence WHMCS
  3. Vérification des prérequis système

Configuration base de données

Renseignez les paramètres suivants :

  • Serveur : localhost
  • Nom de la base : whmcs_db
  • Utilisateur : whmcs_user
  • Mot de passe : motdepasse_securise

Configuration administrateur

Créez votre compte administrateur principal :

  • Email administrateur
  • Mot de passe fort
  • URL de votre installation WHMCS
Sécurité post-installation

Supprimez immédiatement le dossier install après l'installation :

rm -rf /var/www/html/whmcs/install

Étape 5 : Configuration modules de paiement

Module PayPal

Dans l'administration WHMCS :

  1. Setup → Payments → Payment Gateways
  2. Sélectionnez PayPal Business
  3. Configurez :
    • Email PayPal
    • Mode Live/Sandbox
    • IPN URL : https://votre-domaine.com/modules/gateways/callback/paypal.php

Module Stripe

  1. Activez le module Stripe
  2. Configuration :
    • Clé publique Stripe
    • Clé secrète Stripe
    • Webhook endpoint : https://votre-domaine.com/modules/gateways/callback/stripe.php

Étape 6 : Intégration avec RedHeberg

Configuration des produits VPS

Créez vos offres VPS RedHeberg dans WHMCS :

  1. Setup → Products/Services → Products/Services
  2. Create New Group : "VPS RedHeberg"
  3. Create New Product pour chaque gamme :
ProduitPrix/moisModule
VPS Xeon KVM XS3,95€Manual
VPS Game Ryzen START5,95€Manual
VPS Windows START7,95€Manual

Automatisation des commandes

Pour automatiser les déploiements, configurez :

  1. Setup → Automation Settings
  2. Activez les tâches cron WHMCS :
# Ajout du cron WHMCS
crontab -e

# Ajoutez cette ligne
*/5 * * * * php -q /var/www/html/whmcs/crons/cron.php

Sécurisation avancée

Protection des fichiers sensibles