You are on page 1of 37

Apache Web Server

Instalacin y Configuracin

MSc. Javier Gonzlez Snchez


javiergs@itesm.mx

ITESM, campus Guadalajara

Introduccin
1

cmo funciona el www? HTTP el web y sus protocolos

Historia del proyecto Apache que es Apache ? Arquitectura de Apache

Instalacin y configuracin

4.

Problemas y adiciones finales.


M.Cs. Javier Gonzalez Sanchez (javiergs@itesm.mx)

cmo funciona el www ?


El

www se basa en el paradigma cliente / servidor.


transaccin www 1. DNS Lookup

URL

DNS Server TCP connection HTTP request HTTP response Web Server

2. 3. 4.

browser tracert

Web Client
M.Cs. Javier Gonzalez Sanchez (javiergs@itesm.mx)

HTTP el web y sus protocolos


protocolo, (elaborado por Tim Berners - Lee) en 1989 protocolo a nivel de aplicacin (dependiente de TCP/IP) El cliente (browser) elabora una peticin (request) El servidor (web Server) responde la peticin (response) soporta:
l l

uso de URLs (Uniform Resource Locators) Internet media types (MIME types: RFC2045-RFC2049)

i.e. acceso a diferentes tipos de informacion estndar:


l

HTTP 1.0 (RFC 1945), HTTP 1.1 (RFC 2616)

http:// www.tallersur.com:80 / directory/file.html


browser telnet
M.Cs. Javier Gonzalez Sanchez (javiergs@itesm.mx)

protocolo

server name or IP

puerto

directorio / archivo

HTTP (request / response)


Simple client request
GET /index.html HTTP/1.1 Host: www.gda.ites.mx
HTTP/1.1 200 OK Date: Tue, 09 Jan 2001 10:49:14 GMT Server: Apache/1.3.14 (Unix) Last-Modified: Tue, 09 Jan 2001 01:11:02 GMT ETag: "131e-a074-3a5a6526" Accept-Ranges: bytes Content-Length: 41076 Content-Type: text/html <html> </html>
M.Cs. Javier Gonzalez Sanchez (javiergs@itesm.mx)

Server reply

Cdigos de respuesta

Los cdigos de estatus son nmeros de tres dgitos agrupados como sigue:
1xx - informational 2xx - client request successful 200 - OK 3xx - request redirected 4xx - client errors (request incomplete) 403 - Forbidden 404 - Not found 5xx - server errors

browser
M.Cs. Javier Gonzalez Sanchez (javiergs@itesm.mx)

Web server

proyecto Apache HTTP


objetivo

proporcionar un servidor open-source, seguro, eficiente y extensible que proporcione servicios HTTP acorde a los estndares del www.

Apache Group
l l l l l

Organizacin no lucrativa Desarrollo de parches y mdulos adicionales Aprobar e implementa parches y adiciones enviadas por desarrolladores externos al grupo. Prueba de nuevas versiones Documentar nuevas caractersticas

M.Cs. Javier Gonzalez Sanchez (javiergs@itesm.mx)

que es Apache?

Disponible de forma gratuita : l Cdigo fuente y objeto l Para diferentes plataformas l Basado en el server de NCSA (1995) Estadsticas
l

El 60% de los servidores web en Internet son Apache o un derivado de Apache


netscaft port80

Totalmente configurable, muchas directivas... Mdulos adicionales le proveen funcionalidad extra Apache is A PAtCHy server Excelente rendimiento y actualizaciones continuas

M.Cs. Javier Gonzalez Sanchez (javiergs@itesm.mx)

A favor
http://news.netcraft.com/archives/2005/10/index.html

M.Cs. Javier Gonzalez Sanchez (javiergs@itesm.mx)

En contra
http://www.port80software.com/surveys/top1000webservers/

M.Cs. Javier Gonzalez Sanchez (javiergs@itesm.mx)

Apache

Web server HTTP

obtener
l l

La Precompilada El Cdigo Fuente

Instalar
l l l

Plataformas Iniciar el Servidor Detener el Servidor

Configurar
l l l

conf/httpd.conf Seguridad Compatibilidad

instalacin
M.Cs. Javier Gonzalez Sanchez (javiergs@itesm.mx)

Instalacin

M.Cs. Javier Gonzalez Sanchez (javiergs@itesm.mx)

Instalacin

M.Cs. Javier Gonzalez Sanchez (javiergs@itesm.mx)

Instalacin

M.Cs. Javier Gonzalez Sanchez (javiergs@itesm.mx)

Instalacin

M.Cs. Javier Gonzalez Sanchez (javiergs@itesm.mx)

Instalacin

M.Cs. Javier Gonzalez Sanchez (javiergs@itesm.mx)

Instalacin

M.Cs. Javier Gonzalez Sanchez (javiergs@itesm.mx)

Instalacin

M.Cs. Javier Gonzalez Sanchez (javiergs@itesm.mx)

Apache directorios
cgi-bin/ - CGI scripts directory conf/ - configuration files for httpd server htdocs/ - main directory for documents logs/ - directory with log files other stuff (bin/, icons/, include/,proxy/, man/ )

bin

cgi-bin

conf

htdocs libexec

logs

apachectl ab

httpd htpasswd
M.Cs. Javier Gonzalez Sanchez (javiergs@itesm.mx)

configuracin

Choosing functionality
Apache functionality is available through modules which are either built into or loaded into the server l Apache reads its run-time configuration instructions from text files l No GUI available
l

General rules
case insensitive(exclude a file/directory names) l one directive in per line l extra whitespace is ignored l comment lines begin with #
l
M.Cs. Javier Gonzalez Sanchez (javiergs@itesm.mx)

configuracin

How ? (Its basic configuration)


l l l l l l l l l l l l

ServerType standalone Port 80 User nobody Group nobody ServerAdmin your_e-mail_address ServerRoot /usr/local/apache ErrorLog /usr/local/apache/logs/error_log TransferLog /usr/local/apache/logs/access_log DocumentRoot /usr/local/apache/htdocs/ UserDir public_html DirectoryIndex index.html ScriptAlias /cgi-bin/ /usr/local/apache/cgi-bin/

More Directives :
l

StartServers, Min/MaxSpareServers, MaxClients,

M.Cs. Javier Gonzalez Sanchez (javiergs@itesm.mx)

En conclusin
Pros:
Precio (de libre uso, gratuito). Desempeo y Robustez. Solidez. Seguridad. Soporte para el protocolo HTTP 1.1. Extensibilidad. Rpido soporte va grupo de noticias.

M.Cs. Javier Gonzalez Sanchez (javiergs@itesm.mx)

En conclusin
Contras:
No existe una versin para MAC. La versin para WinNT es todava dbil (No posee an el crecimiento en el desempeo obtenido en las versiones UNIX). Carece de interfaces grficas para facilitar las tareas de configuracin y administracin. Un soporte tcnico ms extenso requiere de comprar el servicio a un tercero.

M.Cs. Javier Gonzalez Sanchez (javiergs@itesm.mx)

Httpd.conf

Apache

Web server HTTP

bitcoras

servers logs access information in the file it is possible (and easy) to produce many kinds of activity reports from that data plenty of freeware log analyzers (webalizer, analog,) Common Log Format (CLF)

211.52.197.57 - - [03/Aug/2000:21:57:26 +0900] "POST /cgi-bin/bbs HTTP/1.1" 200 3840

Date host ident authuser

request

[day/month/year:hour:minute:second zone]

status bytes

M.Cs. Javier Gonzalez Sanchez (javiergs@itesm.mx)

virtual host

The term Virtual Host refers to the practice of maintaining more than one server on one machine, as differentiated by their apparent hostname. NSPs and ISPs do this a lot Allows additional Web presence without accompanying hardware or software investment required each of the virtual server may have totally different content, configuration, separate log and error files, alternative is to run another server on a different port part of basic server configuration (httpd.conf)
M.Cs. Javier Gonzalez Sanchez (javiergs@itesm.mx)

mdulos apache

La arquitectura modular hace posible para cualquiera aadir funciones al servidor Existe una enorme cantidad de mdulos escritos para Apache (pblicos y privados)

Es fcil aadir un modulo a Apache

M.Cs. Javier Gonzalez Sanchez (javiergs@itesm.mx)

referencias

Apache HTTP Server Project http://www.apache.org/info.html Apache API notes http://www.apache.org/docs/misc/API.html Netcraft Survey http://www.netcraft.com Apache Week http://www.apacheweek.com/issues/00-02-18 Apache modules http://www.apache.org/docs/mod/index.html Apache directives http://www.apache.org/docs/mod/directives.html
M.Cs. Javier Gonzalez Sanchez (javiergs@itesm.mx)

sitios de inters

WWW consortium http://www.w3c.org

About NCSA http://www.ncsa.uiuc.edu/AboutUs/

Netcraft Survey for Apache http://www.serverwatch.com/news/article.php/3073801

port 80 Survey for Apache


http://www.port80software.com/surveys/top1000webservers/archive/200301/

M.Cs. Javier Gonzalez Sanchez (javiergs@itesm.mx)

problemas

Revisar el archivo error.log ! Revisar el FAQ Apache


http://www.apache.org/docs/misc/FAQ.html

Leer la documentacin de Apache Revisar la base de datos de reportes de errores (bugs)


http://bugs.apache.org/

M.Cs. Javier Gonzalez Sanchez (javiergs@itesm.mx)

preguntas
gracias!
http://www.javiergs.com/ javiergs@itesm.mx

preguntas

gracias!
http://www.javiergs.com/ javiergs@itesm.mx

preguntas

gracias! javiergs@itesm.mx

You might also like