Diferències
Ací es mostren les diferències entre la revisió seleccionada i la versió actual de la pàgina.
| Ambdós costats versió prèvia Revisió prèvia Següent revisió | Revisió prèvia | ||
| info:cursos:pue:lpic2-2021:s10 [04/03/2021 09:02] – [Web Services] mate | info:cursos:pue:lpic2-2021:s10 [09/03/2021 09:03] (actual) – [Web Services] mate | ||
|---|---|---|---|
| Línia 9: | Línia 9: | ||
| === Web Services | === Web Services | ||
| * DOC: Material Practicas LPIC-2/ | * DOC: Material Practicas LPIC-2/ | ||
| + | * DOC: Material Practicas LPIC-2/ | ||
| + | * DOC: Material Practicas LPIC-2/ | ||
| * Manual Certificacion LPIC-2.pdf, pag. 289 | * Manual Certificacion LPIC-2.pdf, pag. 289 | ||
| - | * centos | + | * centos |
| + | |||
| + | ==== apache: 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** | ||
| + | * <code apache>< | ||
| + | ServerAdmin admin@server1.curso.esp | ||
| + | DocumentRoot / | ||
| + | ServerName intranet.192.168.2.5.nip.io | ||
| + | ServerAlias intranet | ||
| + | DirectoryIndex index.html index.php | ||
| + | < | ||
| + | Order Deny, | ||
| + | deny from all | ||
| + | allow from 192.168.2.1 | ||
| + | </ | ||
| + | < | ||
| + | Order Deny, | ||
| + | deny from all | ||
| + | allow from 192.168.0.9 | ||
| + | </ | ||
| + | < | ||
| + | Order Deny, | ||
| + | deny from all | ||
| + | allow from 192.168.2.1 | ||
| + | </ | ||
| + | ErrorLog logs/ | ||
| + | CustomLog logs/ | ||
| + | </ | ||
| + | * Location | ||
| + | * actua sobre las URI | ||
| + | * Directory | ||
| + | * actua sobre los directorios | ||
| + | * módulo: mod_auth_basic | ||
| + | * podríamos hacerlo con los 2 contenedores: | ||
| + | * Directory: / | ||
| + | * Location: /privado | ||
| + | <code apache> | ||
| + | < | ||
| + | ServerAdmin admin@server1.curso.esp | ||
| + | DocumentRoot / | ||
| + | ServerName intranet.192.168.2.5.nip.io | ||
| + | ServerAlias intranet | ||
| + | DirectoryIndex index.html index.php | ||
| + | < | ||
| + | Order Deny, | ||
| + | deny from all | ||
| + | allow from 192.168.2.1 | ||
| + | </ | ||
| + | < | ||
| + | Options -FollowSymLinks -Indexes | ||
| + | </ | ||
| + | ErrorLog logs/ | ||
| + | CustomLog logs/ | ||
| + | </ | ||
| + | </ | ||
| + | * Directivas | ||
| + | * Timeout | ||
| + | * KeepAlive | ||
| + | * MaxKeepAliveRequests | ||
| + | * KeepAliveTimeout | ||
| + | * Listen | ||
| + | * Options | ||
| + | * Directiva **Options**: | ||
| + | * All: todas las opciones salvo MultiViews | ||
| + | * ExecCGI: Se permite la ejecución de scripts CGI. | ||
| + | * FollowSymLinks: | ||
| + | * Includes: Se permiten incluir Server-side. | ||
| + | * Indexes: Si una URL solicita un directorio y no existe DirectoryIndex (v.g., index.html) en ese directorio, el servidor devolverá una lista del contenido del directorio. | ||
| + | * MultiViews: Se permite mostrar contenido negociado en función de diversos valores. | ||
| + | * SymLinksIfOwnerMatch: | ||
| + | * Directiva **AllowOverride**: | ||
| + | * AuthConfig: Permitir el uso de directivas de autorización (AuthDBMGroupFile, | ||
| + | * FileInfo: Permitir el uso de directivas de control de tipo de documentos (DefaultType, | ||
| + | * Indexes: Permitir el uso de directivas que controlan los índices de directorios (AddDescription, | ||
| + | * Limit: Permitir el uso de directivas de acceso de hosts (Allow, Deny y Order). | ||
| + | * Options: Permitir el uso de las opciones antes vistas en la directiva Options | ||
| + | |||
| + | <code apache> | ||
| + | < | ||
| + | ServerAdmin admin@server1.curso.esp | ||
| + | DocumentRoot / | ||
| + | ServerName intranet.192.168.2.5.nip.io | ||
| + | ServerAlias intranet | ||
| + | DirectoryIndex index.html index.php | ||
| + | < | ||
| + | Order Deny, | ||
| + | deny from all | ||
| + | allow from 192.168.2.1 | ||
| + | </ | ||
| + | < | ||
| + | Options -FollowSymLinks -Indexes | ||
| + | AllowOverride AuthConfig | ||
| + | Order allow, | ||
| + | Allow from all | ||
| + | </ | ||
| + | ErrorLog logs/ | ||
| + | CustomLog logs/ | ||
| + | </ | ||
| + | </ | ||
| + | <code; .htaccess> | ||
| + | AuthName "Solo usuarios autorizados" | ||
| + | AuthType Basic | ||
| + | require valid-user | ||
| + | AuthUserFile / | ||
| + | </ | ||
| + | <code bash> | ||
| + | touch / | ||
| + | chmod 600 / | ||
| + | chown apache: | ||
| + | htpasswd / | ||
| + | # para borrar, htpasswd -D / | ||
| + | </ | ||
| + | * **mod_digest** deprecado, para Apache 2.2 | ||
| + | |||
| + | ==== SSL | ||
| + | <code bash> | ||
| + | cd / | ||
| + | # generamos la key | ||
| + | openssl genrsa -out intranet.key 2048 | ||
| + | |||
| + | # generamos el certificado | ||
| + | openssl req -new -key intranet.key -out intranet.csr | ||
| + | |||
| + | # lo enviamos a firmar a la una CA ;) | ||
| + | openssl x509 -req -days 365 -in intranet.csr -signkey intranet.key -out intranet.crt | ||
| + | </ | ||
| + | <code apache> | ||
| + | # copiamos la configuración :80 y cambiamos por :443, añadiendo el certificado creado | ||
| + | < | ||
| + | ServerAdmin admin@server1.curso.esp | ||
| + | DocumentRoot / | ||
| + | ServerName intranet.192.168.2.5.nip.io | ||
| + | ServerAlias intranet | ||
| + | SSlEngine On | ||
| + | SSLCertificateFile / | ||
| + | SSLCertificateKeyFile / | ||
| + | DirectoryIndex index.html index.php | ||
| + | < | ||
| + | Order Deny, | ||
| + | deny from all | ||
| + | allow from 192.168.2.1 | ||
| + | </ | ||
| + | < | ||
| + | Options -FollowSymLinks -Indexes | ||
| + | AllowOverride AuthConfig | ||
| + | Order allow, | ||
| + | Allow from all | ||
| + | </ | ||
| + | ErrorLog logs/ | ||
| + | CustomLog logs/ | ||
| + | </ | ||
| + | </ | ||
| + | <code apache> | ||
| + | < | ||
| + | ServerAdmin admin@server1.curso.esp | ||
| + | DocumentRoot / | ||
| + | ServerName intranet.192.168.2.5.nip.io | ||
| + | Redirect / https:// | ||
| + | ServerAlias intranet | ||
| + | ErrorLog logs/ | ||
| + | CustomLog logs/ | ||
| + | </ | ||
| + | </ | ||
| + | * Digital Ocean | ||
| + | * Cloudflare: versión gratuita, enmascara servidor, prevención DDoS | ||
| + | * Modulos | ||
| + | * **/ | ||
| + | * LoadModule | ||
| + | * desactivar modulos no usados | ||
| + | |||
| + | ==== rsync | ||
| + | * DOC: Material Practicas LPIC-2/ | ||
| + | * montarlo como servidor | ||
| + | * a través **xnitd**, muy viejuno | ||
| + | * '' | ||
| + | * **%%--%%delete**: | ||
| + | |||
| + | ==== ldap | ||
| + | <code apache> | ||
| + | NameVirtualHost 192.168.0.150: | ||
| + | |||
| + | < | ||
| + | ServerAdmin berto@srweb1.curso.esp | ||
| + | ServerName aplicaciones.curso.esp | ||
| + | ServerAlias aplicaciones | ||
| + | < | ||
| + | Options None | ||
| + | Order deny, | ||
| + | | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | #Utilizamos el modulo de Apache mod_authnz_ldap | ||
| + | Options Includes | ||
| + | AuthBasicProvider ldap | ||
| + | AuthType Basic | ||
| + | AuthzLDAPAuthoritative off | ||
| + | AuthName "Solo Usuarios Active Directory" | ||
| + | AuthLDAPURL " | ||
| + | AuthLDAPBindDN " | ||
| + | AuthLDAPBindPassword 000000 | ||
| + | require valid-user | ||
| + | Options None | ||
| + | Order allow, | ||
| + | | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | Options None | ||
| + | Order allow, | ||
| + | allow from all | ||
| + | </ | ||
| + | |||
| + | ErrorLog logs/ | ||
| + | CustomLog logs/ | ||
| + | JkMountCopy on | ||
| + | |||
| + | </ | ||
| + | </ | ||
| + | * **IPAServer.zip**, | ||
| + | |||
| + | === proxy : squid | ||
| + | * DOC: Material Practicas LPIC-2/ | ||
| + | * DOC: pag. 309 | ||
| + | * http/ | ||
| + | * filtrado | ||
| + | * squid transparente | ||
| + | * users -> router (tráfico http(s)) -> squid | ||
| + | * protocolo WWCP | ||
| + | * algoritmos de caché | ||
| + | * LRU | ||
| + | * LFUDA | ||
| + | * '' | ||
| + | * **/ | ||
| + | * ojo con los espacios en el fichero de configuración | ||
| + | * **http_port**: | ||
| + | * **cache_dir**: | ||
| + | * **/ | ||
| + | * **/ | ||
| + | * '' | ||
| + | |||
| + | ==== restricciones | ||
| + | * regular expression | ||
| + | * **/ | ||
| + | * añadir al fichero de configuración: | ||
| + | * '' | ||
| + | * '' | ||
| + | * restricciones, | ||
| + | * **/ | ||
| + | * añadir al fichero de configuración: | ||
| + | * '' | ||
| + | * '' | ||
| + | * '' | ||
| + | * destino de dominio: **dstdomain** | ||
| + | * validación contra LDAP | ||
| + | * en los logs aparece el nombre de usuario | ||
| + | * **time**: | ||
| + | * limitaciones horarias | ||
| + | * listas | ||
| + | * **blackweb-master** | ||
| + | * **sarg**: generación de informes a partir de los logs de squid | ||