Está en la página 1de 9

LPIC-201

Web Services
El estudiante ser capaz de:
Instalar y configurar un servidor Web

Objetivo:
Configurar un servidor web, incluir autenticacin, permitir navegar a una red interna.

Ing. Luis Machado R.

LPIC-201

Esquema de trabajo

1.

Descargueeinstaleelservidorapache yuminstallhttpd Verifiqueelarchivodeconfiguracin cd/etc/httpd/conf vihttpd.conf

2.

3.

Configuresuservidor.Chequequelassiguienteslneasdelarchivoseencuentrencomoseindica acontinuacin: ServerRoot "/etc/httpd" Listen 192.168.N.1:80 User apache Group apache DocumentRoot "/var/www/html" <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory "/var/www/html"> DirectoryIndex index.html index.html.var index.php Inicieelservicio servicehttpdstart CreeunapginawebycoloquelaenelDocumentRoot

4.

5.

Ing. Luis Machado R.

LPIC-201

vi/var/www/html/index.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Lumosity - Iniciar sesin</title> </head> <body> <p>Este es un ejemplo de una pgina web </body>

6.

Abraunnavegadoreingresealapginarecincreada.

7.

Creetressitiosensuservidorutilizandohostvirtuales.Configuresuhttpd.confdelasiguiente manera:

NameVirtualHost 192.168.N.1 <VirtualHost 192.168.N.1> ServerName www.domainN.com DocumentRoot /var/www/html/domainN </VirtualHost> <VirtualHost 192.168.N.1> ServerName www.domain10N.com DocumentRoot /var/www/html/domain10N </VirtualHost> <VirtualHost 192.168.N.1> ServerName www.domain100N.com DocumentRoot /var/www/html/domain100N
Ing. Luis Machado R.

LPIC-201

</VirtualHost> 8. CreeunapginawebycoloquelaenelDocumentRootdecadasitio mkdir/var/www/html/domainN mkdir/var/www/html/domain10N mkdir/var/www/html/domain100N vi/var/www/html/domainN/index.html


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Lumosity - Iniciar sesin</title> </head> <body> <p>Este es un ejemplo de una pgina web del dominio 1N </body>

vi/var/www/html/domain10N/index.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Lumosity - Iniciar sesin</title> </head> <body> <p>Este es un ejemplo de una pgina web del dominio 10N </body>

vi/var/www/html/domain100N/index.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Lumosity - Iniciar sesin</title> </head> <body> <p>Este es un ejemplo de una pgina web del dominio 100N </body>

9.

Agregueenelarchivo/etc/hosts,losnombresdelosdominioscreados 192.168.N.1 www.domainN.com 192.168.N.1 www.domain10N.com 192.168.N.1 www.domain100N.com

10.

Abraunnavegadoreingresealapginasrecincreadas.

Ing. Luis Machado R.

LPIC-201

11.

Agregueenelmdulomod_sslalservidorapache yuminstallmod_ssl servicehttpdrestart

12.

Abraunnavegarycompruebasuconexinhttpsconsupginalocal

Ing. Luis Machado R.

LPIC-201
13.

Modifiquesuarchivodeconfiguracinparahabilitarhttpsensusvirtualhosts

NameVirtualHost *:443 <VirtualHost _default_:443> ServerName www.domainN.com DocumentRoot /var/www/html/domainN </VirtualHost> <VirtualHost _default_:443> ServerName www.domain10N.com DocumentRoot /var/www/html/domain10N </VirtualHost> <VirtualHost _default_:443> ServerName www.domain100N.com DocumentRoot /var/www/html/domain100N </VirtualHost>

Proxy con Apache


14.

Descomentelassiguienteslneas:

<IfModule mod_proxy.c> ProxyRequests On <Proxy *> Order deny,allow Deny from all Allow from .example.com </Proxy> ProxyVia On <IfModule mod_disk_cache.c> CacheEnable disk / CacheRoot "/var/cache/mod_proxy" </IfModule>

Ing. Luis Machado R.

LPIC-201
15. 16.

Reiniciesuservicio. Abraelnavegadoryeditesuspreferencias.

Ing. Luis Machado R.

LPIC-201

17.

Configureelproxy.

18. 19.

Intentenavegar. Depermisosparasuredinterna.

<Proxy *> Order Deny,Allow Allow from 192.168.N.0 </Proxy> Reinicieelserviciohttpd. Vulevaaintentarnavegar.

20. 21.

Ing. Luis Machado R.

LPIC-201

Desafo: Intenteconfigurarsuproxyparaquenieguesitioscomo:

facebook.com yahoo.com hotmail.com

Proxy con Squid


22.

Instaleelservidorsquid yuminstallsquid Verifiqueelarchivodeconfiguracin/etc/squid/squid.conf acl localnet src 192.168.N.0/24

23.

24.

Verifiquequesutengatengapermisos http_access allow locanet

25.

Verifiqueelpuertodelservicio http_por 3128

26.

Inicieelservicio servicesquidstart Configuresunavegadorperoahoraelpuertoes3128 Pruebenavegar

27. 28.

Desafo: Intenteconfigurarsuproxyparaquenieguesitioscomo:

facebook.com yahoo.com hotmail.com TIP(verifiqueelarchivodeejemplo/usr/share/doc/squidversion/squid.conf.documented) Configuresuproxyparaquelosusuariosseautentiquen Creeelarchivoquecontendrsususuarios htpasswdc/etc/squid/passwdlmachado Asgneleunpassword password:

29.

30.

Reviseelarchivoparaversielusuariofuecreado cat/etc/squid/passwd Aadalassiguienteslneas auth_param basic program /usr/lib64/squid/ncsa_auth /etc/squid/passwd acl autorizacion proxy_auth REQUIRED http_access allow localnet autorizacion

31.

Ing. Luis Machado R.

También podría gustarte