J M G

- -
Articles
Software
Automation
Games
-
  10 / Installation serveur sur debian- - -
logodebian Checklist/Memo pour mettre en oeuvre un serveur de devel et ou production LAMP à base de Debian 8 Jessie.

Préparation et configuration du serveur

Installation du serveur web et base de données
[moi@bg.com]apt-get install apache2
[moi@bg.com]apt-get install mariadb-server
Configuration de la base de données /etc/mysql/my.cnf
bind-address = adresseip, pour pouvoir contacter le serveur mariadb de l'extérieur
[moi@bg.com]apt-get install php5
[moi@bg.com]apt-get install php5-apcu
[moi@bg.com]apt-get install phpmyadmin
[moi@bg.com]apt-get install git
[moi@bg.com]apt-get install mc
[moi@bg.com]apt-get install curl
[moi@bg.com]apt-get install awstats

Configuration de phpmyadmin /etc/apache2/conf-available/phpmyadmin.conf
Alias /[Mettre_un_alias_peu_répandu] /usr/share/phpmyadmin

Redémarrage des services

[moi@bg.com]service apache2 restart
[moi@bg.com]service mysql restart

Configuration du prompt

Pour jongler entre les terminaux et les dépôts GIT je modifie le prompt pour y afficher l'adresse IP et la branche en cours si je suis dans un dépôt GIT.
Récupérer le script git-prompt.sh :
[moi@bg.com]curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-prompt.sh -o ~/.git-prompt.sh
Une fois récupéré on modifie la configuration du bash
Modification de ~/.bashrc
if [ "$color_prompt" = yes ]; then
  PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
else
  source /home/mearcanj/.git-prompt.sh
  THEIP=$(ip addr show dev eth0 | grep "inet " | cut -d" " -f6 | cut -d"/" -f1)
  PS1='${debian_chroot:+($debian_chroot)}\u@\e[1;33m$THEIP\e[0;37m:\w \e[1;30m$(__git_ps1)\e[0;97m $ '
fi
Ce qui donne :
[moi@192.168.0.48](master)[~/mon/répertoire/depotgit]$
Le fond bleu c'est le terminal mac os style océan;)

Installation de webmin

Pour administrer ma machine a distance via une interface web je me sert de webmin :
[moi@bg.com]wget http://prdownloads.sourceforge.net/webadmin/webmin_1.820_all.deb
[moi@bg.com]dpkg --install webmin_1.820_all.deb
[moi@bg.com]apt-get -f install (si ça bugg, pour résoudre les dépendances)

- - -