Cahier 2016 groupe n°1 : Différence entre versions

De Wiki de Projets IMA
(Séance5)
(Séance6)
Ligne 190 : Ligne 190 :
 
  Email Address []:cedricduval94@gmail.com
 
  Email Address []:cedricduval94@gmail.com
  
On ajoute le serveur.csr dans gandi
+
On ajoute le contenu du fichier serveur.csr dans gandi

Version du 28 novembre 2016 à 13:50

Séance 1

Pour la première séance nous avons installé ifenslave 2.6 sur le serveur et ajout d'un alias pour que le module bond soit activé avec les bonnes options :

alias bond0 bonding
options bonding mode=1 miimon=100 downdelay=200 updelay=200

Nous avons aussi configuré le fichier /etc/network/interfaces en y incluant la configuration des différentes interfaces : eth100, eth101 ainsi que la configuration du bridge: br0 et du bonding: bond0.

#Bonding IMA5sc
#auto eth100
#iface eth0 inet manual
#	bond-master bond0
#	bond-primary eth100 eth101
#	bond-mode 5

#auto eth101
#iface eth1 inet manual	
#	bond-master bond0
#	bond-primary eth100 eth101
#	bond-mode 5

#auto bond0
#iface bond0 inet dhcp
#	pre-up modprobe bonding
#	pre-up ifconfig bond0 up
#	pre-up /sbin/ifenslave  bond0 eth100 eth101
#	down sbin/ifenslave -d bond0 eth100 eth101
#	bonds-slaves none
#
#auto br0
#iface br0 inet dhcp
#	bridge-ports bond0

Séance 2

Installation de la machine virtuelle sur le serveur cordouan:

root@cordouan:/usr/local/xen/domains# xen-create-image --hostname=Frotteman --ip=193.48.57.161 --netmask=255.255.255.240 --gateway=193.48.57.171  --dir=/usr/local/xen --mirror=http://debian.polytech-lille.fr/debian/ --dist=jessie --password=glopglop
WARNING
-------

 You appear to have a missing vif-script, or network-script, in the
 Xen configuration file /etc/xen/xend-config.sxp.

 Please fix this and restart Xend, or your guests will not be able
to use any networking!


General Information
--------------------
Hostname       :  Frotteman
Distribution   :  jessie
Mirror         :  http://debian.polytech-lille.fr/debian/
Partitions     :  swap            128M  (swap)
                  /               4G    (ext3)
Image type     :  sparse
Memory size    :  128M
Kernel path    :  /boot/vmlinuz-3.14-2-amd64
Initrd path    :  /boot/initrd.img-3.14-2-amd64

Networking Information
----------------------
IP Address 1   : 193.48.57.161 [MAC: 00:16:3E:F4:F8:CE]
Netmask        : 255.255.255.240
Gateway        : 193.48.57.171


Creating partition image: /usr/local/xen/domains/Frotteman/swap.img
Done

Creating swap on /usr/local/xen/domains/Frotteman/swap.img
Done

Creating partition image: /usr/local/xen/domains/Frotteman/disk.img
Done

Creating ext3 filesystem on /usr/local/xen/domains/Frotteman/disk.img
Done
Installation method: debootstrap
Done

Running hooks
Done

No role scripts were specified.  Skipping 

Creating Xen configuration file
Done 

No role scripts were specified.  Skipping
Setting up root password
Generating a password for the new guest.
All done


Logfile produced at:
	 /var/log/xen-tools/Frotteman.log

Installation Summary
---------------------
Hostname        :  Frotteman
Distribution    :  jessie
MAC Address     :  00:16:3E:F4:F8:CE
IP Address(es)  :  193.48.57.161 
RSA Fingerprint :  37:3f:a5:4a:6d:05:15:3d:55:44:e3:0b:7f:81:91:a2
Root Password   :  fsBsiSE4


Séance3

Création des partitions logiques pour la machine virtuelle.

lvcreate -L 10G -n /dev/virtual/ima5-Frotteman-home -v
lvcreate -L 10G -n /dev/virtual/ima5-Frotteman-var -v

Ajouts des partitions à la configuration de la machine virtuelle.

'phy:/dev/virtual/ima5-Frotteman-home,xvdb,w',
'phy:/dev/virtual/ima5-Frotteman-var,xvdc, w',

Séance4

Commande pour démarrer la VM lorsqu'elle est totalement éteinte :

xl create -c /etc/xen/Frotteman.cfg

Nom de domaine réservé sur gandi.net

faispastomberlasavo.net

Séance5

Installation de bind9 sur la VM xen.

Modification du fichier /etc/bind/named.conf.local

zone "faispastomberlasavo.net" {
          type master;
          file "/etc/bind/db.faispastomberlasavo.net";
          allow-transfer { 217.70.177.40; };
     };

Créez le fichier de zone /etc/bind/db.faispastomberlasavo.net

TTL    604800
@       IN      SOA     ns.faispastomberlasavo.net. root.faispastomberlasavo.net. (
                       2              ; Serial
                       604800         ; Refresh
                        86400         ; Retry
                      2419200         ; Expire
                       604800 )       ; Negative Cache TTL
;
        IN      NS      ns6.gandi.net.
@       IN      NS      ns.faispastomberlasavo.net.
ns      IN      A       193.48.57.161
www     IN      A       193.48.57.161
@       IN      A       193.48.57.161


Redémarrer bind

/etc/init.d/bind9 restart

Changez la configuration des serveurs du domaine Gandi

DNS1: ns.faispastomberlasavo.net
DNS2: ns6.gandi.net

Commande:

nslookup www.faispastomberlasavo.net

Résultat:

Server:		193.48.57.161
Address:	193.48.57.161#53 

Name:	www.faispastomberlasavo.net
Address: 193.48.57.161

Séance6

commande pour générer certificat SSL

openssl req -nodes -newkey rsa:2048 -sha1 -keyout serveur.key -out serveur.csr
Country Name (2 letter code) [AU]:FR
State or Province Name (full name) [Some-State]:France
Locality Name (eg, city) []:Lille
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Polytech
Organizational Unit Name (eg, section) []:IMA
Common Name (e.g. server FQDN or YOUR name) []:faispastomberlasavo.net
Email Address []:cedricduval94@gmail.com

On ajoute le contenu du fichier serveur.csr dans gandi