Diferències
Ací es mostren les diferències entre la revisió seleccionada i la versió actual de la pàgina.
| Següent revisió | Revisió prèvia | ||
| info:cursos:pue:lpic2-2021:s9 [28/02/2021 10:42] – creat mate | info:cursos:pue:lpic2-2021:s9 [02/03/2021 12:50] (actual) – [Web Services] mate | ||
|---|---|---|---|
| Línia 7: | Línia 7: | ||
| == Clase | == Clase | ||
| + | === DNS | ||
| + | ==== DNS: Laboratorio | ||
| + | continuación de [[info: | ||
| + | * ficheros de configuración para el master del servidor DNS | ||
| + | <code; named.conf> | ||
| + | options { | ||
| + | | ||
| + | | ||
| + | 8.8.8.8; | ||
| + | 8.8.4.4; | ||
| + | }; | ||
| + | | ||
| + | 192.168.2.152; | ||
| + | }; | ||
| + | allow-notify {192.168.2.152; | ||
| + | }; | ||
| + | |||
| + | zone " | ||
| + | type hint; | ||
| + | file " | ||
| + | }; | ||
| + | |||
| + | zone " | ||
| + | type master; | ||
| + | | ||
| + | | ||
| + | }; | ||
| + | file " | ||
| + | }; | ||
| + | |||
| + | zone " | ||
| + | type master; | ||
| + | | ||
| + | 192.168.2.0/ | ||
| + | }; | ||
| + | file " | ||
| + | }; | ||
| + | </ | ||
| + | <code; db.curso> | ||
| + | $ORIGIN . | ||
| + | $TTL 259200 ; 3 days | ||
| + | curso.esp IN SOA sercentos7.curso.esp. root.curso.esp. ( | ||
| + | 2021022502 ; serial | ||
| + | 86400 | ||
| + | 7200 | ||
| + | 2592000 | ||
| + | 172800 | ||
| + | ) | ||
| + | NS orion.curso.esp. | ||
| + | NS sercentos7.curso.esp. | ||
| + | MX 3 trasgu.curso.esp. | ||
| + | $ORIGIN curso.esp. | ||
| + | agendapc5 CNAME pc5 | ||
| + | curso A 192.168.2.3 | ||
| + | fresnosa CNAME trasgu | ||
| + | localhost A 127.0.0.1 | ||
| + | pc2 A 192.168.2.8 | ||
| + | pc3 | ||
| + | portalpc12 CNAME pc12 | ||
| + | portatil A 192.168.2.2 | ||
| + | trasgu A 192.168.2.150 | ||
| + | orion A 192.168.2.152 | ||
| + | webalizerpc12 CNAME pc12 | ||
| + | sercentos7 | ||
| + | </ | ||
| + | <code; db.192.168.2> | ||
| + | $TTL 259200 ; 3 days | ||
| + | 2.168.192.IN-ADDR.ARPA. IN SOA sercentos7.curso.esp. root.curso.esp. ( | ||
| + | 2021022501 ; serial | ||
| + | 86400 | ||
| + | 7200 | ||
| + | 2592000 | ||
| + | 172800 | ||
| + | ) | ||
| + | 2.168.192.IN-ADDR.ARPA. NS orion.curso.esp. | ||
| + | 2.168.192.IN-ADDR.ARPA. NS sercentos7.curso.esp. | ||
| + | 2.168.192.IN-ADDR.ARPA. MX 3 sercentos7.curso.esp. | ||
| + | |||
| + | 150 | ||
| + | 5 | ||
| + | 152 IN PTR | ||
| + | 8 | ||
| + | </ | ||
| + | <code; named.ca> | ||
| + | ; This file holds the information on root name servers needed to | ||
| + | ; | ||
| + | ; (e.g. reference this file in the " | ||
| + | ; | ||
| + | ; | ||
| + | ; This file is made available by InterNIC | ||
| + | ; under anonymous FTP as | ||
| + | ; | ||
| + | ; on server | ||
| + | ; | ||
| + | ; | ||
| + | ; last update: | ||
| + | ; | ||
| + | ; | ||
| + | ; | ||
| + | ; formerly NS.INTERNIC.NET | ||
| + | ; | ||
| + | . 3600000 | ||
| + | A.ROOT-SERVERS.NET. | ||
| + | ; | ||
| + | ; formerly NS1.ISI.EDU | ||
| + | ; | ||
| + | . 3600000 | ||
| + | B.ROOT-SERVERS.NET. | ||
| + | ; | ||
| + | ; formerly C.PSI.NET | ||
| + | ; | ||
| + | . 3600000 | ||
| + | C.ROOT-SERVERS.NET. | ||
| + | ; | ||
| + | ; formerly TERP.UMD.EDU | ||
| + | ; | ||
| + | . 3600000 | ||
| + | D.ROOT-SERVERS.NET. | ||
| + | ; | ||
| + | ; formerly NS.NASA.GOV | ||
| + | ; | ||
| + | . 3600000 | ||
| + | E.ROOT-SERVERS.NET. | ||
| + | ; | ||
| + | ; formerly NS.ISC.ORG | ||
| + | ; | ||
| + | . 3600000 | ||
| + | F.ROOT-SERVERS.NET. | ||
| + | ; | ||
| + | ; formerly NS.NIC.DDN.MIL | ||
| + | ; | ||
| + | . 3600000 | ||
| + | G.ROOT-SERVERS.NET. | ||
| + | ; | ||
| + | ; formerly AOS.ARL.ARMY.MIL | ||
| + | ; | ||
| + | . 3600000 | ||
| + | H.ROOT-SERVERS.NET. | ||
| + | ; | ||
| + | ; formerly NIC.NORDU.NET | ||
| + | ; | ||
| + | . 3600000 | ||
| + | I.ROOT-SERVERS.NET. | ||
| + | ; | ||
| + | ; operated by VeriSign, Inc. | ||
| + | ; | ||
| + | . 3600000 | ||
| + | J.ROOT-SERVERS.NET. | ||
| + | ; | ||
| + | ; operated by RIPE NCC | ||
| + | ; | ||
| + | . 3600000 | ||
| + | K.ROOT-SERVERS.NET. | ||
| + | ; | ||
| + | ; operated by ICANN | ||
| + | ; | ||
| + | . 3600000 | ||
| + | L.ROOT-SERVERS.NET. | ||
| + | ; | ||
| + | ; operated by WIDE | ||
| + | ; | ||
| + | . 3600000 | ||
| + | M.ROOT-SERVERS.NET. | ||
| + | ; End of File | ||
| + | </ | ||
| + | <code; / | ||
| + | nameserver 192.168.2.5 | ||
| + | nameserver 192.168.2.152 | ||
| + | search curso.esp | ||
| + | domain curso.esp | ||
| + | </ | ||
| + | * **/ | ||
| + | PEERDNS=No | ||
| + | DNS1=< | ||
| + | DNS2=< | ||
| + | * para que no sobreescriba el **resolv.conf** (el DHCP o Vagrant) y mantenga los DNS que yo le diga | ||
| + | * '' | ||
| + | |||
| + | ==== DNS: Laboratorio | ||
| + | * DOC: Material Practicas LPIC-2/ | ||
| + | * <code named.conf> | ||
| + | | ||
| + | | ||
| + | 8.8.8.8; | ||
| + | 192.168.2.1; | ||
| + | }; | ||
| + | // allow-transfer{ | ||
| + | // 192.168.2.5; | ||
| + | // 192.168.2.3; | ||
| + | // }; | ||
| + | // | ||
| + | }; | ||
| + | |||
| + | zone " | ||
| + | type hint; | ||
| + | file " | ||
| + | }; | ||
| + | zone " | ||
| + | type slave; | ||
| + | file " | ||
| + | | ||
| + | }; | ||
| + | |||
| + | zone " | ||
| + | type slave; | ||
| + | file " | ||
| + | | ||
| + | |||
| + | }; | ||
| + | </ | ||
| + | * <code; / | ||
| + | nameserver 192.168.2.5 | ||
| + | search curso.esp | ||
| + | domain curso.esp | ||
| + | </ | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | |||
| + | === DNS (continuación) | ||
| + | * masterfile-format: | ||
| + | * indica en que formato se transfieren las zonas desde el master: text, | ||
| + | * [[https:// | ||
| + | * '' | ||
| + | * '' | ||
| + | * DOC: Manual Certificacion LPIC-2.pdf, pag. 254 | ||
| + | * añadir nueva zona esclava en el master:< | ||
| + | zone " | ||
| + | type slave; | ||
| + | masters { 192.168.x.x; | ||
| + | file " | ||
| + | masterfile-format text; | ||
| + | };</ | ||
| + | * añadir a **named.conf** para que escuche en un puerto/ip determinados:< | ||
| + | options { | ||
| + | | ||
| + | | ||
| + | | ||
| + | 8.8.8.8; | ||
| + | 8.8.4.4; | ||
| + | }; | ||
| + | </ | ||
| + | |||
| + | ==== DNSSEC | ||
| + | * DOC: (pag. 267), (pag. 17 - laboratorio dns) | ||
| + | * **allow-transfer { acl };** | ||
| + | * **allow-query { acl };** | ||
| + | * **listen-on { acl };** | ||
| + | * **blackhole { acl };** | ||
| + | * **allow-notify { acl };** | ||
| + | * acl:< | ||
| + | acl redlocal { | ||
| + | 192.168.0.150; | ||
| + | 127.0.0.1; | ||
| + | 192.168.2.0/ | ||
| + | }; | ||
| + | </ | ||
| + | * valores predefinidos en la sección acl: | ||
| + | * any | ||
| + | * localhost | ||
| + | * localnets | ||
| + | * none | ||
| + | * ejemplo parcial **named.conf**:< | ||
| + | acl redlocal { | ||
| + | localnets; | ||
| + | }; | ||
| + | |||
| + | acl yomismo { | ||
| + | localhost; | ||
| + | }; | ||
| + | |||
| + | acl parias { | ||
| + | 192.168.2.152; | ||
| + | }; | ||
| + | |||
| + | options { | ||
| + | | ||
| + | | ||
| + | 8.8.8.8; | ||
| + | 8.8.4.4; | ||
| + | |||
| + | }; | ||
| + | | ||
| + | 192.168.2.152; | ||
| + | }; | ||
| + | allow-notify {192.168.2.152; | ||
| + | // | ||
| + | allow-query { yomismo; }; | ||
| + | //blackhole { parias; }; | ||
| + | |||
| + | }; | ||
| + | </ | ||
| + | * yomismo: no permite a un cliente resolver, con un mensage de **REFUSED** | ||
| + | * parias: no responde (ni se logea) a una petición de un cliente | ||
| + | * redlocal: funciona correctamente | ||
| + | * cuenta de servicio: | ||
| + | * usuario propio | ||
| + | * sin shell -> / | ||
| + | * enjaular el proceso | ||
| + | * intercambio seguro entre servidores | ||
| + | * TSIG (Transaction SIGnature) | ||
| + | * DOC: (pag. 270) (pag.9) | ||
| + | * '' | ||
| + | * **-a HMAC-MD5**: único algoritmo de cifrado soportado | ||
| + | * **-b < | ||
| + | * **-n < | ||
| + | * < | ||
| + | ==== laboratorio TSIG | ||
| + | * en el master:< | ||
| + | dnssec-keygen -r /dev/random -a HMAC-MD5 -b 128 -n HOST curso.esp # genera .key y .private | ||
| + | chmod 400 Kcurso.esp* | ||
| + | chown named.named Kcurso.esp* | ||
| + | cat Kcurso*.key # llave pública | ||
| + | </ | ||
| + | * editar **named.conf** y añadir:< | ||
| + | key curso.esp { | ||
| + | algorithm HMAC-MD5; | ||
| + | secret " | ||
| + | }; | ||
| + | </ | ||
| + | * y modificar:< | ||
| + | allow-transfer { key curso.esp; }; | ||
| + | </ | ||
| + | * '' | ||
| + | * en el esclavo, **named.conf**:< | ||
| + | key curso.esp { | ||
| + | algorithm HMAC-MD5; | ||
| + | secret " | ||
| + | }; | ||
| + | server 192.168.1.150 { | ||
| + | keys { curso.esp; }; | ||
| + | }; | ||
| + | </ | ||
| + | * eliminamos las zonas transferidas (para ver que funciona) en el esclavo | ||
| + | * '' | ||
| + | * {{: | ||
| + | |||
| + | <callout type=" | ||
| + | * laboratorio DDNS | ||
| + | * DDoS (pag. 20) | ||
| + | * consultas recursivas: [[https:// | ||
| + | * **allow-recursions** | ||
| + | |||
| + | === Web Services | ||
| + | * DOC: Material Practicas LPIC-2/ | ||
| + | * Manual Certificacion LPIC-2.pdf, pag. 289 | ||
| + | |||
| + | ==== apache | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * levanta :80 :443 <- '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * archivos de configuración | ||
| + | * **/ | ||
| + | * **/ | ||
| + | * **/ | ||
| + | * página bienvenida por defecto: **/ | ||
| + | * document root: | ||
| + | * **/ | ||
| + | * documentos soportados por defecto: | ||
| + | * index.html | ||
| + | * index.htm | ||
| + | * index.php | ||
| + | * ficheros de logs | ||
| + | * **/ | ||
| + | * **/ | ||
| + | * **/ | ||
| + | |||
| + | ==== directivas básicas | ||
| + | * DOC: Material Practicas LPIC-2/ | ||
| + | * **ServerRoot**: | ||
| + | * **Listen 80**: donde queremos que escuche (varios si queremos) | ||
| + | * **Listen < | ||
| + | * **Include conf.modules.d/ | ||
| + | * **User apache** | ||
| + | * sin shell! | ||
| + | * **Group apache** | ||
| + | * **ServerAdmin < | ||
| + | * **ServerName < | ||
| + | * contenedores: | ||
| + | * **Directory**: | ||
| + | * **Files**: afecta a ficheros | ||
| + | * **Location**: | ||
| + | * **AddDefaultCharset UTF-8** | ||
| + | |||
| + | ==== Laboratorio: | ||
| + | * DOC: Material Practicas LPIC-2/ | ||
| + | * '' | ||
| + | * <code; / | ||
| + | NameVirtualHost 192.168.2.5: | ||
| + | NameVirtualHost 192.168.2.5: | ||
| + | |||
| + | < | ||
| + | ServerAdmin admin@server1.curso.esp | ||
| + | DocumentRoot / | ||
| + | ServerName intranet.curso.esp | ||
| + | ServerAlias intranet | ||
| + | DirectoryIndex index.html index.php | ||
| + | ErrorLog logs/ | ||
| + | CustomLog logs/ | ||
| + | </ | ||
| + | </ | ||
| + | |||