Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
elearning:workbooks:centos:6:senior:l103 [2021/10/18 10:07] – admin | elearning:workbooks:centos:6:senior:l103 [2021/10/19 14:29] (Version actuelle) – admin | ||
---|---|---|---|
Ligne 2284: | Ligne 2284: | ||
127.0.0.1 localhost.localdomain localhost | 127.0.0.1 localhost.localdomain localhost | ||
:: | :: | ||
- | 10.0.2.15 i2tch.loc | + | 10.0.2.51 i2tch.loc |
- | 10.0.2.15 www.i2tch.loc | + | 10.0.2.51 www.i2tch.loc |
- | 10.0.2.15 www.rhelnom.com | + | 10.0.2.51 www.rhelnom.com |
</ | </ | ||
Ligne 2375: | Ligne 2375: | ||
< | < | ||
[root@centos7 ~]# cat / | [root@centos7 ~]# cat / | ||
- | 10.0.2.15 - - [24/ | + | 10.0.2.51 - - [24/ |
</ | </ | ||
==Hôte virtuel par adresse IP== | ==Hôte virtuel par adresse IP== | ||
- | |||
- | Commencez par créer une adresse IP fixe : | ||
- | |||
- | < | ||
- | [root@centos7 ~]# nmcli connection add con-name ip_fixe ifname enp0s3 type ethernet ip4 10.0.2.16/ | ||
- | [root@centos7 ~]# nmcli connection up ip_fixe | ||
- | [root@centos7 ~]# nmcli connection mod ip_fixe ipv4.dns 8.8.8.8 | ||
- | [root@centos7 ~]# systemctl restart NetworkManager | ||
- | [root@centos7 ~]# nslookup www.free.fr | ||
- | Server: | ||
- | Address: | ||
- | |||
- | Non-authoritative answer: | ||
- | Name: | ||
- | Address: 212.27.48.10 | ||
- | </ | ||
Vous allez maintenant procéder à la création d'un site ( hôte ) virtuel par adresse IP. Normalement, | Vous allez maintenant procéder à la création d'un site ( hôte ) virtuel par adresse IP. Normalement, | ||
Ligne 2401: | Ligne 2385: | ||
[root@centos7 ~]# ip a | grep 'inet ' | [root@centos7 ~]# ip a | grep 'inet ' | ||
inet 127.0.0.1/8 scope host lo | inet 127.0.0.1/8 scope host lo | ||
- | inet 10.0.2.16/24 brd 10.0.2.255 scope global | + | inet 10.0.2.51/24 brd 10.0.2.255 scope global |
- | [root@centos7 ~]# ip a add 192.168.1.99/ | + | [root@centos7 ~]# ip a add 192.168.1.99/ |
[root@centos7 ~]# ip a | grep 'inet ' | [root@centos7 ~]# ip a | grep 'inet ' | ||
inet 127.0.0.1/8 scope host lo | inet 127.0.0.1/8 scope host lo | ||
- | inet 10.0.2.16/24 brd 10.0.2.255 scope global | + | inet 10.0.2.51/24 brd 10.0.2.255 scope global |
- | inet 192.168.1.99/ | + | inet 192.168.1.99/ |
</ | </ | ||
Ligne 2479: | Ligne 2463: | ||
127.0.0.1 localhost.localdomain localhost | 127.0.0.1 localhost.localdomain localhost | ||
:: | :: | ||
- | 10.0.2.16 i2tch.loc | + | 10.0.2.51 i2tch.loc |
- | 10.0.2.16 www.i2tch.loc | + | 10.0.2.51 www.i2tch.loc |
- | 10.0.2.16 www.rhelnom.com | + | 10.0.2.51 www.rhelnom.com |
192.168.1.99 | 192.168.1.99 | ||
</ | </ | ||
Ligne 2598: | Ligne 2582: | ||
< | < | ||
- | root@debian9:~# systemctl restart | + | [root@centos7 |
</ | </ | ||
Ligne 2604: | Ligne 2588: | ||
< | < | ||
- | root@debian9:~# mkdir / | + | [root@centos7 |
</ | </ | ||
Ligne 2646: | Ligne 2630: | ||
< | < | ||
- | root@debian9:~# chown -R apache: | + | [root@centos7 |
</ | </ | ||
Ligne 2686: | Ligne 2670: | ||
[root@centos7 ~]# lynx --dump http:// | [root@centos7 ~]# lynx --dump http:// | ||
- | Accueil du Project | + | Accueil du Project |
Ligne 2696: | Ligne 2680: | ||
</ | </ | ||
- | ===Sous Debian | + | ===Sous Debian |
==Hôte virtuel par nom== | ==Hôte virtuel par nom== | ||
- | Sous **Debian | + | Sous **Debian |
< | < | ||
Ligne 2749: | Ligne 2733: | ||
< | < | ||
- | root@debian9: | + | root@debian9: |
</ | </ | ||
Ligne 2781: | Ligne 2765: | ||
ff02::1 ip6-allnodes | ff02::1 ip6-allnodes | ||
ff02::2 ip6-allrouters | ff02::2 ip6-allrouters | ||
- | 10.0.2.15 i2tch.loc | + | 10.0.2.60 i2tch.loc |
- | 10.0.2.15 www.i2tch.loc | + | 10.0.2.60 www.i2tch.loc |
- | 10.0.2.15 www.debiannom.com | + | 10.0.2.60 www.debiannom.com |
</ | </ | ||
Ligne 2875: | Ligne 2859: | ||
< | < | ||
root@debian9:/ | root@debian9:/ | ||
- | 10.0.2.15 - - [27/ | + | 10.0.2.60 - - [27/ |
</ | </ | ||
==Hôte virtuel par adresse IP== | ==Hôte virtuel par adresse IP== | ||
- | NetworkManager inclus | + | Vous allez maintenant procéder à la création d'un site ( hôte ) virtuel par adresse IP. Normalement, |
- | + | ||
- | Si vous constatez que vous n'avez pas de profil | + | |
< | < | ||
root@debian9:/ | root@debian9:/ | ||
- | root@debian9: | ||
- | NAME | ||
- | </ | ||
- | |||
- | Dans ce cas, le fichier **/ | ||
- | |||
- | < | ||
- | root@debian9: | ||
- | # This file describes the network interfaces available on your system | ||
- | # and how to activate them. For more information, | ||
- | |||
- | source / | ||
- | |||
- | # The loopback network interface | ||
- | auto lo | ||
- | iface lo inet loopback | ||
- | |||
- | # The primary network interface | ||
- | allow-hotplug eth0 | ||
- | iface eth0 inet dhcp | ||
- | </ | ||
- | |||
- | Afin de permettre NetworkManager de gérer la carte malgré cette configuration, | ||
- | |||
- | < | ||
- | root@debian9: | ||
- | root@debian9: | ||
- | [main] | ||
- | plugins=ifupdown, | ||
- | |||
- | [ifupdown] | ||
- | managed=true | ||
- | </ | ||
- | |||
- | Il faut ensuite re-démarrer le service NetworkManager : | ||
- | |||
- | < | ||
- | root@debian9: | ||
- | </ | ||
- | |||
- | Constatez la sortie de la commande **nmcli c show** : | ||
- | |||
- | < | ||
- | root@debian9: | ||
- | NAME | ||
- | eth0 | ||
- | Ifupdown (eth0) | ||
- | </ | ||
- | |||
- | Créez maintenant un profil IP fixe rattaché au périphérique **eth0** : | ||
- | |||
- | < | ||
- | root@debian9: | ||
- | Connection ' | ||
- | </ | ||
- | |||
- | Constatez sa présence : | ||
- | |||
- | < | ||
- | root@debian9: | ||
- | NAME | ||
- | ip_fixe | ||
- | eth0 | ||
- | Ifupdown (eth0) | ||
- | </ | ||
- | |||
- | L' | ||
- | |||
- | < | ||
- | root@debian9: | ||
- | [connection] | ||
- | id=ip_fixe | ||
- | uuid=0421e288-cb7c-4569-ac1f-70598a13c96f | ||
- | interface-name=eth0 | ||
- | type=ethernet | ||
- | |||
- | [ipv4] | ||
- | method=manual | ||
- | address1=10.0.2.16/ | ||
- | </ | ||
- | |||
- | < | ||
- | root@debian9: | ||
- | ping: unknown host www.free.fr | ||
- | </ | ||
- | |||
- | Modifiez donc la configuration du profil **ip_fixe** : | ||
- | |||
- | < | ||
- | root@debian9: | ||
- | </ | ||
- | |||
- | L' | ||
- | |||
- | < | ||
- | root@debian9: | ||
- | [connection] | ||
- | id=ip_fixe | ||
- | uuid=0421e288-cb7c-4569-ac1f-70598a13c96f | ||
- | interface-name=eth0 | ||
- | type=ethernet | ||
- | |||
- | [ipv6] | ||
- | method=auto | ||
- | |||
- | [ipv4] | ||
- | method=manual | ||
- | dns=8.8.8.8; | ||
- | address1=10.0.2.16/ | ||
- | </ | ||
- | |||
- | Afin que la modification du serveur DNS soit prise en compte, re-démarrez le service NetworkManager : | ||
- | |||
- | < | ||
- | root@debian9: | ||
- | root@debian9: | ||
- | root@debian9: | ||
- | ● NetworkManager.service - Network Manager | ||
- | | ||
- | | ||
- | Main PID: 32570 (NetworkManager) | ||
- | | ||
- | | ||
- | |||
- | Aug 27 20:04:16 debian8 NetworkManager[32570]: | ||
- | Aug 27 20:04:16 debian8 NetworkManager[32570]: | ||
- | Aug 27 20:04:16 debian8 NetworkManager[32570]: | ||
- | Aug 27 20:04:16 debian8 NetworkManager[32570]: | ||
- | Aug 27 20:04:16 debian8 NetworkManager[32570]: | ||
- | Aug 27 20:04:16 debian8 NetworkManager[32570]: | ||
- | Aug 27 20:04:16 debian8 NetworkManager[32570]: | ||
- | Aug 27 20:04:16 debian8 NetworkManager[32570]: | ||
- | Aug 27 20:04:16 debian8 NetworkManager[32570]: | ||
- | Aug 27 20:04:22 debian8 NetworkManager[32570]: | ||
- | </ | ||
- | |||
- | Vérifiez la resolution des noms : | ||
- | |||
- | < | ||
- | root@debian9: | ||
- | PING www.free.fr (212.27.48.10) 56(84) bytes of data. | ||
- | 64 bytes from www.free.fr (212.27.48.10): | ||
- | 64 bytes from www.free.fr (212.27.48.10): | ||
- | 64 bytes from www.free.fr (212.27.48.10): | ||
- | 64 bytes from www.free.fr (212.27.48.10): | ||
- | ^C | ||
- | --- www.free.fr ping statistics --- | ||
- | 4 packets transmitted, | ||
- | rtt min/ | ||
- | </ | ||
- | |||
- | Vous allez maintenant procéder à la création d'un site ( hôte ) virtuel par adresse IP. Normalement, | ||
- | |||
- | < | ||
root@debian9: | root@debian9: | ||
inet 127.0.0.1/8 scope host lo | inet 127.0.0.1/8 scope host lo | ||
- | inet 10.0.2.15/24 brd 10.0.2.255 scope global | + | inet 10.0.2.60/24 brd 10.0.2.255 scope global |
- | root@debian9: | + | root@debian9: |
root@debian9: | root@debian9: | ||
inet 127.0.0.1/8 scope host lo | inet 127.0.0.1/8 scope host lo | ||
- | inet 10.0.2.15/24 brd 10.0.2.255 scope global | + | inet 10.0.2.60/24 brd 10.0.2.255 scope global |
- | inet 192.168.1.99/ | + | inet 192.168.1.99/ |
</ | </ | ||
Ligne 3130: | Ligne 2958: | ||
ff02::1 ip6-allnodes | ff02::1 ip6-allnodes | ||
ff02::2 ip6-allrouters | ff02::2 ip6-allrouters | ||
- | 10.0.2.16 i2tch.loc | + | 10.0.2.60 i2tch.loc |
- | 10.0.2.16 www.i2tch.loc | + | 10.0.2.60 www.i2tch.loc |
- | 10.0.2.16 www.debiannom.com | + | 10.0.2.60 www.debiannom.com |
192.168.1.99 www.debianip.com | 192.168.1.99 www.debianip.com | ||
</ | </ | ||
Ligne 3467: | Ligne 3295: | ||
</ | </ | ||
- | ===Sous Debian | + | ===Sous Debian |
Pour qu' | Pour qu' | ||
Ligne 3505: | Ligne 3333: | ||
< | < | ||
< | < | ||
- | root@debian9: | + | root@debian9: |
< | < | ||
- | UserDir public_html | + | |
- | UserDir disabled root | + | UserDir disabled root |
- | < | + | |
- | AllowOverride FileInfo AuthConfig Limit Indexes | + | AllowOverride FileInfo AuthConfig Limit Indexes |
- | Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec | + | Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec |
- | <Limit GET POST OPTIONS> | + | Require |
- | Require | + | </ |
- | </ | + | |
- | < | + | |
- | Require all denied | + | |
- | </ | + | |
- | </ | + | |
</ | </ | ||
Ligne 5259: | Ligne 5082: | ||
< | < | ||
[root@centos7 ~]# tail / | [root@centos7 ~]# tail / | ||
- | 10.0.2.16 - - [02/ | + | 10.0.2.51 - - [02/ |
- | 10.0.2.16 - - [02/ | + | 10.0.2.51 - - [02/ |
- | 10.0.2.16 - - [02/ | + | 10.0.2.51 - - [02/ |
- | 10.0.2.16 - - [02/ | + | 10.0.2.51 - - [02/ |
- | 10.0.2.16 - - [02/ | + | 10.0.2.51 - - [02/ |
127.0.0.1 - jean [02/ | 127.0.0.1 - jean [02/ | ||
127.0.0.1 - - [02/ | 127.0.0.1 - - [02/ | ||
Ligne 5428: | Ligne 5251: | ||
127.0.0.1 localhost.localdomain localhost | 127.0.0.1 localhost.localdomain localhost | ||
:: | :: | ||
- | 10.0.2.16 i2tch.com | + | 10.0.2.51 i2tch.com |
- | 10.0.2.16 *.i2tch.loc | + | 10.0.2.51 *.i2tch.loc |
- | 10.0.2.16 www.rhelnom.com | + | 10.0.2.51 www.rhelnom.com |
192.168.1.99 | 192.168.1.99 | ||
- | 10.0.2.16 dav.homeland.net | + | 10.0.2.51 dav.homeland.net |
</ | </ | ||