initial web server configuration 1wucm1. overview planning testing the os/environment – ip setup...

15
Initial web server configuration 1 WUCM1

Post on 19-Dec-2015

221 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: Initial web server configuration 1WUCM1. Overview Planning Testing the OS/Environment – IP setup Installation Configuration – Simple minimum details Testing

Initial web server configuration

1WUCM1

Page 2: Initial web server configuration 1WUCM1. Overview Planning Testing the OS/Environment – IP setup Installation Configuration – Simple minimum details Testing

Overview

• Planning• Testing the OS/Environment– IP setup

• Installation• Configuration– Simple minimum details

• Testing– Default website – with the manuals!

WUCM1 2

Page 3: Initial web server configuration 1WUCM1. Overview Planning Testing the OS/Environment – IP setup Installation Configuration – Simple minimum details Testing

Planning

• For a live system:– Requirements Planning (Session 3)– Information Architecture and Website Structure

(Session 4) – Name Planning (Session 5) – Interaction Planning – CGI environments (Session 6) – Security Planning (Session 7) – User Access Planning (Session 8)– Planning for Growth (Session 11)

• Much ‘a given’ for your practical work

WUCM1 3

Page 4: Initial web server configuration 1WUCM1. Overview Planning Testing the OS/Environment – IP setup Installation Configuration – Simple minimum details Testing

TCP/IP Configuration Check

• Check the Windows settings

WUCM1 4

Page 5: Initial web server configuration 1WUCM1. Overview Planning Testing the OS/Environment – IP setup Installation Configuration – Simple minimum details Testing

Apache web server

• Most commonly used web server software• Open source• Free to use• Based on NCSA httpd software (early 1990s)• Currently three versions: 2.2, 2.0 and 1.3

supported• httpd.apache.org• Note distinction between Apache Software

Foundation and Apache HTTP Server

WUCM1 5

Page 6: Initial web server configuration 1WUCM1. Overview Planning Testing the OS/Environment – IP setup Installation Configuration – Simple minimum details Testing

Installation

• Two choices for Apache:– From source code– From distributed binaries, for Win32, Linux etc.

• For Win2000/XP the binary is a standard windows installer package– see tutorial notes

WUCM1 6

Page 7: Initial web server configuration 1WUCM1. Overview Planning Testing the OS/Environment – IP setup Installation Configuration – Simple minimum details Testing

Configuration

• Apache configured using text files.– http.conf

the main Apache server configuration file– srm.conf

server resource configuration– access.conf

directory and file access restrictions– mime.types

relates media types to file name extensions– magic

lists recognisable byte sequences

WUCM1 7

Page 8: Initial web server configuration 1WUCM1. Overview Planning Testing the OS/Environment – IP setup Installation Configuration – Simple minimum details Testing

Configuration file syntax (1)

• A hash symbol ( # ) is used to introduce a comment

• There are two kinds of conf directive: – Variable assignment – Block directive

• The syntax of a variable assignment is: <variable name><white space><value>

WUCM1 8

DocumentRoot "D:/WebRoot/Roger/htdocs"

Page 9: Initial web server configuration 1WUCM1. Overview Planning Testing the OS/Environment – IP setup Installation Configuration – Simple minimum details Testing

Configuration file syntax (2)

• A block directive – looks a little like an HTML tag (but isn't)– serves to apply specific directives to specific parts

of the Apache system

WUCM1 9

<Directory / > Options none AllowOverride none Order allow, deny Deny from all</Directory>

Page 10: Initial web server configuration 1WUCM1. Overview Planning Testing the OS/Environment – IP setup Installation Configuration – Simple minimum details Testing

Minimum basic configuration file

• For Windows, Apache v1

WUCM1 10

# Simple conf file for the web site Roger

ServerType standalone

ServerRoot "C:/Apache"

ServerName "H01.CommsLab.port.ac.uk"

DocumentRoot "D:/WebRoot/Roger/htdocs"

TransferLog "logs/access.log"

Page 11: Initial web server configuration 1WUCM1. Overview Planning Testing the OS/Environment – IP setup Installation Configuration – Simple minimum details Testing

Log files

• Will be covered in Session 04 practical• Brief example of common:

WUCM1 11

192.168.27.58 - - [10/Feb/2002:17:59:02 +0000] "GET / HTTP/1.1" 200 1494

192.168.27.58 - - [10/Feb/2002:17:59:02 +0000] "GET /apache_pb.gif HTTP/1.1" 200 2326

192.168.27.58 - - [10/Feb/2002:17:59:21 +0000] "GET /manual/ HTTP/1.1" 200 9580

192.168.27.58 - - [10/Feb/2002:17:59:21 +0000] "GET /manual/images/apache_header.gif HTTP/1.1" 200 4084

192.168.27.58 - - [10/Feb/2002:17:59:21 +0000] "GET /manual/images/pixel.gif HTTP/1.1" 200 61

192.168.27.58 - - [10/Feb/2002:17:59:21 +0000] "GET /manual/images/index.gif HTTP/1.1" 200 1540

192.168.27.58 - - [10/Feb/2002:17:59:33 +0000] "GET /manual/windows.html HTTP/1.1" 200 27725

192.168.27.58 - - [10/Feb/2002:17:59:34 +0000] "GET /manual/images/sub.gif HTTP/1.1" 200 6083

Page 12: Initial web server configuration 1WUCM1. Overview Planning Testing the OS/Environment – IP setup Installation Configuration – Simple minimum details Testing

Testing

• Apache can be run as an application– From Start menu – assuming install ok– From a command prompt

• Why notextcursor?

WUCM1 12

Page 13: Initial web server configuration 1WUCM1. Overview Planning Testing the OS/Environment – IP setup Installation Configuration – Simple minimum details Testing

Apache as a service

• Apache can also be run as "service"/"daemon"• Default install of version 2 is as service• Implications:– No user interface at all, not even a window!– Started automatically at server boot– Stopped automatically at shutdown– You may need to remove from "service list" to use

a manual console

WUCM1 13

Page 14: Initial web server configuration 1WUCM1. Overview Planning Testing the OS/Environment – IP setup Installation Configuration – Simple minimum details Testing

Starting/Stopping Apache

• To start:– Change directory to Apache install– Open a DOS command prompt– Command apache

• To stop:– Open a new command prompt– Command apache –k shutdown– Wait a while– CTRL–C a valid alternative!

WUCM1 14

Page 15: Initial web server configuration 1WUCM1. Overview Planning Testing the OS/Environment – IP setup Installation Configuration – Simple minimum details Testing

Default web site

WUCM1 15