Você está na página 1de 17

Overview

How Web works? HTTP - Web and protocols History of the Apache Project Whats the Apache ? Apache 2.0 Design Basic concepts and components Troubleshooting

How WWW works?


The Web is based on the client/server paradigm.
Typical Transaction on the Web 1. DNS Lookup

URL

DNS Server

2. 3. 4.

TCP connection HTTP request HTTP response Web Server

Web Client

HTTP / Hypertext Transfer Protocol


The protocol, designed by Tim Berners-Lee as early as 1989 Application-level protocol client (browser) makes request - server responds support for: use of URLs Internet media types (MIME types: RFC2045-RFC2049) allows access to different data formats standards: HTTP 1.0 (RFC 1945), HTTP 1.1 (RFC 2616, a formal on 07.99)

http://www.apache.kr.net:8080/directory/file.html
protocol server name port directory/file name on the server

HTTP Request/Response
GET /index.html HTTP/1.1 Host: orange.kr.psi.net Simple

client request

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 <!--Copyright (c) 1997-2001 by Kwan-jin,Jung --> <!--All Rights Reserved --> <html>

Server reply

Server status codes

Status codes are three digit numbers grouped as follows:


1xx - informational 2xx - client request successful

200 - OK

3xx - request redirected 4xx - client errors (request incomplete)

403 - Forbidden 404 - Not found

5xx - server errors

The Apache HTTP Project

A common Goal

To provide an open-source, secure, efficient and extensible server that provides HTTP services in sync with non-proprietary World Wide Web standards

Apache Group

Non-Profit Organization Develop bug fixes and software additions Approve and implement any bug fixes and software additions submitted by non-core developers Test new releases Document new features

Whats the Apache ?

Freely Available :

source code binaries for many platforms (version 1.3.x includes also the Windows NT)

Web server orginally based on NCSA server(in 1995) Over 60% of Internet Web servers run Apache or an Apache derivative(In the December 2000 survey) very configurable, lots of directives... optional modules provide extra functionality Apache is A PAtCHy server Powerful performance and Continually upgrade

Whats an Apache Module?

'modular' architecture makes is possible for anyone to add new functions to the server There are a large number of modules now written for Apache A way to extend the Web servers request processing It is easy to add a module to Apache Can be statically or dynamically loaded

New features of Apache 1.3.x


Support for Windows NT systems (Available on Windows 95/98/2000) Better configuration and building process Support for dynamic modules Better performance Better security Enhanced virtual host configurations

Related Projects

Apache-SSL Apache Interface to SSLeay (mod_ssl) Apache Module Registry PHP Project Apache/Perl Integration Project Java-Apache Project Jakarta Project The Java-Apache Project Apache Graphical User Interface Project Apache Documentation Project XML-Apache Project

Apache 2.0 Design


layered abstractions for multithreading, shared memory, portability, and protocol streams HTTP protocol extensions, WebDAV(Web-based Distributed Authoring and Versioning) Better new configuration language and run-time interface Filtering (Layered IO) Source Code Rewrite more flexible, detailed module hooks and API

Installing the Server on Unix

If you have a pre-built package

Install it and runs download and unpack in suitable directory (ftp, uncompress, gunzip, tar...) initial configuration(Choose your modules) Compile the server install executable in system further configuration files to reflect your environment Run httpd

Otherwise,

Apache directory structure

some important directories: 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

default location is /usr/local/apache apachectl ab httpd htpasswd

Configuring Apache

Choosing functionality

Apache functionality is available through modules which are either built into or loaded into the server Apache reads its run-time configuration instructions from text files No GUI available case insensitive(exclude a file/directory names) one directive in per line extra whitespace is ignored comment lines begin with #

General rules

Configuring Apache
(continued)

How ? (Its basic configuration)


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/ StartServers, Min/MaxSpareServers, MaxClients,

More Directives :

Virtual Hosts

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)

Logfiles

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 384
Date request
[day/month/year:hour:minute:second host ident zone] authuser

status bytes

e.g.

LogFormat %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" TranferLog logs/access_log

Você também pode gostar