Friday, 28 November 2014

Web Server: Apache Web server

Web Server: Apache Web server
CONTENTS
4.1     Web server
4.1.1 Apache Web server
4.1.2 Working with Web Server
4.1.3 Configuring and using apache web services
4.2    Introduction to MDA
4.3    Genesis of MDA
4.4    Meta Object Facility
4.5     UML – UML Profiles
4.6     MDA Applications.
4.7   Question Bank

4.1  WEB SERVER:

• A Web Server is a computer which is connected to the Internet and is running specialized World Wide Web Server software.  A computer connected to the Internet that stores and distributes Web pages upon request.
• The "server" is actually a software program running on the computer
• More specifically,  a server  is a computer  that  manages  and shares  web based applications accessible anytime from any computer connected to the Internet.
• Web server machine, in Addition to the Web page files it can serve, it runs an HTTP daemon, which waits for HTTP requests and handles them when they arrive.
• Your Web browser is an HTTP client, sending requests to server machines. When the browser     user enters file requests by either "opening" a Web file or clicking on a hypertext link, the browser builds an HTTP request and sends it to the Internet Protocol address (IP address) indicated by the URL.
• The HTTP daemon in the destination server machine receives the request and sends back the requested file or files associated with the request.

                                Figure 4.1: Web Server
Popular web servers:
• Apache (open source),
• Microsoft's Internet Information Server (IIS) (commercial).

HTTP
Ø      HTTP (Hypertext Transfer Protocol) is the set of rules for transferring files (text, graphic images, sound, video, and other multimedia files) on the World Wide Web.
Ø      Hypertext  Transfer  Protocol  (HTTP)  is  the  primary  method  used  to  convey information on the World Wide Web. The original purpose was to provide a way to publish and receive HTML pages. HTTP is an application protocol that runs on top of the TCP/IP suite of protocols (the foundation protocols for the Internet).

4.1.1 Apache Web server
• The Apache Web Server is a free, open source web server developed and maintained by the Apache Server Project. The Apache Server Project is made up of volunteer programmers as well as contributors from all over the world.
• Apache was originally developed for Unix and Linux systems however, it is now available on other platforms such as Windows and OS.
• Most Linux distributions allow you the option of including Apache in the Linux installation.
• The first version of Apache, based on the NCSA httpd Web server, was developed in 1995.
• Because it was developed from existing NCSA code plus various patches, it was called
“a patchy server” - hence the name Apache Server.



4.1.2 Working with Apache
1.  Download/unpack Apache2  source  from  the  Apache  httpd  server  website, http://httpd.apache.org/
2. In the Apache 2 source directory, create a Makefile by typing:

3. Make Apache from the just-created Makefile: make
4. If make is successful, install Apache as root: make install.

4.1.3 Configuring and using apache web services
• Configuration  is achieved by entering directives  into the httpd.conf  file (in the
/etc/httpd/conf  directory). Apache provides a default httpd.conf file with directives, some of which are commented out.
• Depending on your requirements, you might not even need to change anything in the httpd.conf  file, however there are some directives that you should customize for your site (ServerName, ServerAdmin etc).
• Here are some of the more useful directives.
Structure of httpd.conf
• DocumentRoot /var/www/html
– Specifies the root directory for your web files (index.html etc).
• ServerRoot /etc/httpd
– Specifies where your web server configuration, error, and log files are kept.
• Redirect [ status ] url-path url
– Maps an old URL into a new one. This can be useful if you move a page or directory to a new location, or if you delete a file and want to redirect users to another file.
• Two types of containers – most containers evaluated at every request.
• Some like <IfDefine> are evaluated only at startup.
• Directives are applied only for those requests that match the containers. <Directory> container. For example, directory indexes will be enabled for the directory /var/web/dir1 and all its
Subdirectories in the following:
<Directory /var/web/dir1>
Options +Indexes
                        </Directory>
Apache Files
• /usr/sbin – Contains Web Server program files and utilities.
• apachectl
• /usr/doc - Contains Web Server documentation
• /var/log/http - Contains the Apache log files
• Access.log
• Error.log

Test the web server.
1. /etc/rc.d/init.d/httpd start (starts the web server)
2. Open web browser and type http://localhost/ into the address bar
3. /etc/rc.d/init.d/httpd stop (stops the web server)

Virtual  hosts:
• Running more than one website on a single machine.
Two forms: IP-based, or name-based.
Name-based: more than one website per IP.
• IP-based: Virtual host uses IP of connection to determine correct pages to serve.

No comments:

Post a Comment