Upload
beatrice-thompson
View
218
Download
2
Tags:
Embed Size (px)
Citation preview
11
Week 6 Week 6
The lynx browserApache Web Server
John Wang
With materials courtesy of Inge Mclaurin
22
The Catalyst for W3The Catalyst for W3
In 1990, while working for Europe’s high energy physics research lab (CERN), Tim Berners-Lee began to create the basic W3 infrastructure.
CERN’s problem: 1.Results of costly experiments were kept in different
formats on different computers.
2.There was high turn-over rate in CERN. New staff often could not find valuable data left by people who departed. They were “losing” information.
33
The Philosophy Behind W3The Philosophy Behind W3Tim Bernes-Lee proposed “Hypertext” system to organize information.
1. Different files can still be kept on different servers
2. An “index” can link files and information together. This index can direct the end-users to diverse pieces of info on different servers.
3. Users can jump from link to link without any hierarchical restriction.
44
W3 InfrastructureW3 Infrastructure
Two main components:
(2) Client browser program (e.g. Lynx, Microsoft Explorer), resides on end-user computers.
(1) Web servers (e.g. Apache server), storing information in Hypertext Markup Language (HTML).
55
DaemonDaemon
• “a process that runs in the background and performs a specified operation at predefined times or in response to certain events.”
• The term daemon is a UNIX term
• Microsoft Windows refers to daemons as System Agents and services.
Source: webopedia.com
66
DaemonDaemon
A daemon is a program that1. runs continuously 2.exists for the purpose of handling periodic service requests that a computer system expects to receive.
The daemon program forwards the requests to other programs
Source: techtarget.com
77
Why do we need to know about Why do we need to know about “Daemons”?“Daemons”?
because...
Each server of pages on the Web has an HTTP Daemon that continually waits for requests to come in from Web clients and their users.
Source: techtarget.com
88
The Lynx BrowserThe Lynx Browser• The Lynx browser is a text-based web
browser. http://lynx.isc.org
• Lynx browser is already installed on zenit. – Telnet into zenit.senecac.on.ca– type “lynx” followed by the website you want to
visit, and press ENTER.
$ lynx www.apache.org
1010
In the beginning… CERNIn the beginning… CERN
• CERN’s original http server was used by all early websites (1991 ~ 1993)
• It was considered to be a big and complex piece of software.
1111
New Kid on the Block… NCSANew Kid on the Block… NCSA
• Only about 200 websites existed in 1993, when National Center for Supercomputing Applications (University of Illinois) released NCSA Mosaic.
Mosaic was the first readily available graphical web browser.
•NCSA team wanted to create a small web server - so NCSA httpd was born. It quickly became the most popular web server.
1212
The Apache Web ServerThe Apache Web Server
• Lots of NCSA Mosaic/httpd project team members (mostly students) went to form Netscape company in 1994. NCSA httpd development slowed down, and security holes were not addressed quickly.
• Web administrators around the world shared their changes & modification (patches) of the NCSA httpd.
• They called their effort “A PAtCHy server”, which became “APACHE”
1313
The Apache Web ServerThe Apache Web Server
• By 1995, there were hundreds of volunteers re-writing and improving the software, making APACHE faster and better.
• Apache has been the most popular web server on the Internet since April of 1996. (Latest Netcraft survey showed that 60% of all websites use Apache. Second place is Microsoft at 30%.)
Source: www.netcraft.com/survey/
1414
Apache Design PhilosophyApache Design Philosophy
Apache teams wanted to make the software:
1.Open-source: anyone can examine the software code
2.Modular: different add-on (or “mod”) can be developed independently
3.OS independent: Apache is available on many different platforms (Windows, Netware, Unix variances)
1515
Directories &Directories &Important FilesImportant Files
apachectl
/
home
i120????HOME
binpasswordlogshtdocsconfcgi-bin
httpd.conf.default httpd.conf
index.html
httpd.pid
.htaccess .htpassword
httpd
error_log access_log
1616
The The confconf directory directory• The conf directory
contains the files used to configure apache.
/
home
i120????HOME
conf
httpd.conf.default
httpd
httpd.conf
1717
The The httpd.confhttpd.conf file file• The httpd.conf file is
used to configure apache.
• The httpd.conf.default file is a back-up copy of the httpd.conf file.
/
home
i120????HOME
conf
httpd.conf.default
httpd
httpd.conf
1818
The The binbin directory directory• “bin” is short for “binary”. The
compiled Apache binary files are stored in this directory.
• It contains the file apachectl.
/
home
i120????HOME
httpd
apachectl
bin
1919
The The apachectlapachectl file file• apachectl is a program
that starts, restarts or stops your Apache daemon/server.
• The file name is “apache” followed by “ctl” which stands for ConTroL
/
home
i120????HOME
httpd
apachectl
bin
2020
The The htdocshtdocs directory directory• The htdocs directory
contains the files that will be displayed on your webpage.
• For example:– HTML pages– Graphics files– PDF files
/
home
i120????HOME
httpd
htdocs
index.html .htaccess
2121
The The index.htmlindex.html file file• The index.html file is the
“default” HTML page for a website.
• If the users enters the URL of a site without specifying a HTML page, index.html will be displayed.
/
home
i120????HOME
httpd
index.html .htaccess
htdocs
2222
The The index.htmlindex.html file file
Example:
http://www.senecac.on.ca
is really.... http://www.senecac.on.ca/index.html
2323
The The logslogs directory directory• The logs directory contains files
that are logs of events that happen to your server.
/
home
i120????HOME
httpd
logs
httpd.pid
error_log
access_log
2424
A note on PID numbersA note on PID numbers• A process is the execution of a command by
the UNIX system.
• UNIX assigns a unique process identification (PID) number at the creation of each process.
• As long as a process is in existence, it keeps the same PID number.
2525
The The httpd.pidhttpd.pid file file• When your server is running it
will contain a file called httpd.pid.
• This file contains the PID of the running server.
/
home
i120????HOME
httpd
logs
httpd.pid
error_log
access_log
2626
The The error_logerror_log file file• The error_log file contains a
log of all error message generated by your server.
• If you are having difficulty with your server this is the first place you look when trouble-shooting.
/
home
i120????HOME
httpd
logs
httpd.pid
error_log
access_log
2727
Hint!Hint!
Whenever you have
any
problem
with your
Apache Server...
...the first thing to do is to check your “log
files”
2828
The The access_logaccess_log file file• The access_log file contains a
log of everyone who logs into your server.
/
home
i120????HOME
httpd
logs
httpd.pid
error_log
access_log
2929
apachectl
/
home
in120???HOME
binpasswordlogshtdocsconfcgi-bin
httpd.conf.default httpd.conf
index.html
httpd.pid
.htaccess .htpassword
httpd
error_log access_log
password protectionpassword protection
3030
The The passwordpassword directory directory• In the lab you are asked to
create a password directory.
• This is the directory that will store all the password files.
/
home
i120????HOME
httpd
password
.htpassword
3131
The The htpassword htpassword filefile• In the lab you are asked to
create a .htpassword file.
• This is the file that will store all the passwords you will create.
/
home
i120????HOME
httpd
password
.htpassword
3232
The The .htaccess.htaccess file file• You will also create
the .htaccess file in htdocs directory. Its password protects the directory it is stored in.
/
home
i120????HOME
httpd
htdocs
index.html .htaccess
3333
WorkingWorking with with youryour Apache Server Apache Server• Read all the instructions
• Follow all the instructions
• Do one step at a time
• Save Often
• Once completed delete everything and do it all again, and again, and again.
• Keep redoing it until you can do it without help, and without the written instructions.
3434
Remember...”Ports”?Remember...”Ports”?
• In TCP/IP networking, “port” is not the same as physical/hardware port (e.g. parallel port, serial port)
• "logical connection place" and specifically, using the Internet's protocol, TCP/IP, the way a client program specifies a particular server program on a computer in a network.
Source: techtarget.com
3535
PortPort
• Port numbers are from 0 to 65536.
• Ports 0 to 1024 (well-known ports) are reserved for use by privileged services. These include telnet, ftp, nntp, etc.
• For the HTTP service, port 80 is defined as a default and it does not have to be specified in the URL.
Example: http://zenit.senecac.on.ca is really http://zenit.senecac.on.ca:80
3636
http://zenit.senecac.on.ca/~i1201g45/
Your HTML pages on ZenitYour HTML pages on Zenit
• You now access your “public_html” directory through port 80 on Zenit.
/home/i1201g45/public_html/index.html
ZENIT