Giter VIP home page Giter VIP logo

servers's Introduction

Gestion des serveurs

Avant

Avant de lancer le script, il y'a quelques étapes :

  • apt-get install git
  • corriger le problème de locale d'Ubuntu 13.04 si vous voyez des warning suite à la commande précédente

modifier /etc/default/locale avec le contenu :

#  File generated by update-locale
LANGUAGE=en_US:en
LANG=en_US.UTF-8
LC_CTYPE=en_US.UTF-8
LC_ALL=en_US.UTF-8

Puis se relogguer.

Une fois fait, on peut exécuter le script.

Après l'exécution du script, créer les utilisateurs avec adduser, groupadd admin (admin est un groupe automatiquement autorisé à faire sudo), usermod -a -G admin someuser, sudo usermod -a -G deployers someuser puis ajouter dans /etc/sudoers:

# Allow jenkins to deploy
jenkins ALL = NOPASSWD: /usr/local/bin/deploy

Créer l'utilisateur jenkins (adduser jenkins) et permettre son login via clé SSH en ajoutant la clé publique à /home/jenkins/.ssh/authorized_keys. Puis lui ajouter le groupe deployers pour qu'il ait le droit de déployer: sudo usermod -a -G deployers jenkins.

Puis désactiver le login SSH root et changer le port SSH pour 4269 (/etc/ssh/sshd_config).

Pour configurer l'heure : sudo dpkg-reconfigure tzdata puis ajouter dans la crontab root (sudo crontab -e) :

@hourly /etc/network/if-up.d/ntpdate ntp.ubuntu.com

Il se peut que phpMyAdmin s'affiche mal, dans ce cas :

dpkg-reconfigure phpmyadmin

Pour l'envoi de mail :

sudo apt-get install exim4

Configuration dans /etc/exim4/update-exim4.conf.conf :

dc_eximconfig_configtype='internet'

Puis redémarrer Exim 4: sudo /etc/init.d/exim4 restart.

Pour éviter d'avoir dans New Relic les stats de phpMyAdmin, il faut modifier le fichier /etc/apache2/conf.d/phpmyadmin.conf et ajouter dans <IfModule mod_php5.c> :

# Disable New Relic monitor
php_flag newrelic.enabled off

Puis redémarrer Apache qui va redémarrer le démon :

sudo apachectl restart

Installer de la swap : https://www.digitalocean.com/community/articles/how-to-add-swap-on-ubuntu-12-04

Script de configuration du serveur

  • Ubuntu 13.04
  • Apache
  • MySQL
  • PHP 5.5 + OpCache + APCu
  • phpMyAdmin
  • Supervisor : gestion des processus démons (workers, …)
  • RabbitMQ : serveur de file de messages, utilisé pour les workers
  • remote_syslog : envoie les logs à PaperTrail, notre outil de lecture des logs
  • New Relic : statistiques sur les serveurs et applications
$ ./install.sh <SERVER_NAME> <MYSQL_ROOT_PASSWORD> <PASSWORD>
  • SERVER_NAME : par ex. dev.myc-sense.com
  • MYSQL_ROOT_PASSWORD : mot de passe root mysql
  • PASSWORD : mot de passe myc-sense mysql et RabbitMQ

Attention : le script demandera à un moment de s'identifier pour GitHub (pour cloner myclabs/deploy). Utiliser ses propres identifiants : ils ne sont pas sauvegardés.

Déployer sur un serveur

Installer en tant que root!

$ ssh root@monserver
$ git clone https://github.com/myclabs/servers.git
$ cd servers/
$ ./install.sh ...

Tester la configuration en local dans vagrant

Pour démarrer la machine virtuelle et lancer l'installation :

$ vagrant up
$ vagrant ssh
$ cd /vagrant
$ sudo ./install.sh ...

Script d'installation d'Inventory

$ ./create_project.sh <NAME> <ENV> <SHORT_ENV> <PASSWORD> <BASE_URL>
  • NAME : par ex. inventory1 ou bollore
  • ENV : environnement complet : developpement, production
  • SHORT_ENV : environnement cours (pour le nom du serveur) : dev, prod
  • PASSWORD : mot de passe myc-sense mysql et RabbitMQ
  • BASE_URL : url de l'application (sans / à la fin), par exemple http://test.myc-sense.com/inventory1

servers's People

Contributors

mnapoli avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.