01 Local Web Server (setup and configuration)
01 Local Web Server (setup and configuration)
◦ Web page - A Web page is a simple text file that contains not only text, but also a set of HTML
tags that describe how the text should be formatted when a browser displays it on the
screen. The tags are simple instructions that tell the Web browser how the page should look
when it is displayed. The tags tell the browser to do things like change the font size or color or
arrange things in columns. The Web browser interprets these tags to decide how to format
the text onto the screen.
Webpage Terminologies
◦ HTML - HTML stands for Hyper Text Markup Language. A "markup language" is a computer
language that describes how a page should be formatted. If all you want to do is display a long
string of black and white text with no formatting, then you don't need HTML. But if you want
to change fonts, add colors, create headlines and embed graphics in your page, HTML is the
language you use to do it.
Webpage Terminologies
Web browser - A Web browser, like Netscape Navigator or Microsoft Internet Explorer, is a
computer program (also known as a software application, or simply an application) that does
two things:
o A Web browser knows how to go to a Web server on the Internet and request a page, so
that the browser can pull the page through the network and into your machine.
o A Web browser knows how to interpret the set of HTML tags within the page in order to
display the page on your screen as the page's creator intended it to be viewed.
How a web browser works.
Webpage Terminologies
◦ It is extremely easy to experiment with Web pages without using a server. Your browser can
view the Web pages you create from your personal machine.
◦ Once you understand how to create your own pages, it is likely that you will want to put them
"out on a server," so that people around the world can load your pages and read them. We
will talk about how to do that later.
Server Side Technologies
◦ Active Server Pages (ASP): A Microsoft technology. ASP pages typically have the extension .asp.
◦ Server Side Includes (SSI): Involves the embedding of small code snippets inside the HTML page.
An SSI page typically has .shtml as its file extension.
Server-Side Technologies
◦ With these server technologies it has become easier to maintain Web pages especially helpful
for a large web site. The developer needs to embed the server-side language code inside the
HTML page.
◦ This code is passed to the appropriate interpreter which processes these instructions and
generates the final HTML displayed by the browser.
◦ Note, the embedded server-script code is not visible to the client (even if you check the
source of the page) as the server sends ONLY the HTML code.
Server-Side Technologies
Let's look at PHP as an example.
◦ A request sent for a PHP page from a client is passed to the PHP interpreter by the server
along with various program variables. The interpreter then processes the PHP code and
generates a dynamic HTML output. This is sent to the server which in turn redirects it to the
client.
◦ The browser is not aware of the functioning of the server. It just receives the HTML code,
which it appropriately formats and displays on your computer.
HTML BASICS
HTML
◦ HTML is an acronym for Hyper Text Markup Language.
◦ To tell the Web browser to "end" doing what you just told it to do, a forward slash is used in
the closing tag:
Example: </center></body>
The HTML Tag
◦ Any Web page you create will contain the following tags at the start of the page:
<HTML>: tells the Web browser that this is the beginning of an HTML document
<HEAD>: tells that Web browser that this is the header for the page. This section contains metadata
about the document, like the title, links to stylesheets, scripts, etc.
<TITLE>: tells the Web browser that this is the title of the page
<BODY>: tells the Web browser that this is the beginning of the Web page content -- everything you
want to say and see on your page will follow this tag.
◦ The tags needed to end any Web page are:
</BODY>
</HTML>
An HTML
Document
The diagram illustrates the general format of
an HTML document.
<html>
Example
<head>
<title>My Simple Webpage</title> Let us try the example:
</head> 1. Create a new folder on your desktop, name
<body> it html_code
<h1>Hello, World!</h1> 2. Open a text editor such as notepad, and
type the code.
<p>This is a simple HTML webpage.</p>
3. Save the file to the html_code folder
</body> located on your desktop with a .html
</html> extension e.g. index.html
4. Double click the file to preview the
document in your web browser.
Example
Preview in the web browser.
HTML TAGS
There are numerous HTML Tags which can be utilized in your webpages. They are as follows:
Tag Name Code Example Browser View
<!-- comment <!--This can be viewed in the HTML part of a document--> Nothing will show
<a href="http://www.domain.com/">
<a - anchor Visit Our Site
Visit Our Site</a>
<body> body of HTML document <body>The content of your HTML page</body> Contents of your web page
<font> font
<font face="Times New Roman" size="+3"
color="#ff0000">Example</font> Example
<form action="mailto:[email protected]">
Name: <input name="Name" value=""
Name:
size="10"><br>
<form> form Email: <input name="Email" value="" Email:
size="10"><br> Submit
<center><input type="submit"></center>
</form>
HTML TAGS Cont’d
<menu> Example 1:
<li type="disc">List item 1</li>
<li type="circle">List item 2</li> List item 1
<li type="square">List item 3</li> o List item 2
List item 3
</MENU>
Example 2:
Example 2:
<ol type="i"> i. List item 1
<li>List item 1</li> ii. List item 2
<li>List item 2</li> iii. List item 3
<li>List item 3</li> iv. List item 4
<li>List item 4</li>
</ol>
HTML TAGS Cont’d
<div align="center">
<table>
<tr>
<th>Column 1</th>
<th>Column 2</th>
<th>Column 3</th>
</tr>
<tr>
<td>Row 2</td> Column 1 Column 2 Column 3
<td>Row 2</td>
Row 2 Row 2 Row 2
<td>Row 2</td>
<th> table header
</tr>
Row 3 Row 3 Row 3
<tr>
<td>Row 3</td> Row 4 Row 4 Row 4
<td>Row 3</td>
<td>Row 3</td>
</tr>
<tr>
<td>Row 4</td>
<td>Row 4</td>
<td>Row 4</td>
</tr></table></div>
document Title of your web page will be viewable in the title
<title> <title>Title of your HTML page</title>
title bar.
Example 1:<br>
<br>
<ul> Example 1:
<li>List item 1</li>
<li>List item 2</li> List item 1
</ul> List item 2
<br>
Example 2:<br>
<ul> unordered list
<ul type="disc">
Example 2:
<li>List item 1</li>
<li>List item 2</li> List item 1
<ul type="circle"> List item 2
<li>List item 3</li> o List item 3
<li>List item 4</li> o List item 4
</ul>
</ul>
A WEB SERVER
What is a web server?
◦ A web server is a software application or hardware device that serves content (such as web pages,
images, files) to clients over the internet or a local network. It responds to requests from web browsers
or other web-enabled clients by delivering the requested content via the Hypertext Transfer Protocol
(HTTP) or its secure variant (HTTPS).
◦ HTTP Protocol: Web servers typically communicate with clients using the HTTP protocol. When a web
browser sends a request for a webpage or file, the web server processes the request and sends back the
requested content along with an HTTP response code indicating the status of the request (e.g., 200 for
success, 404 for not found).
◦ Client-Server Architecture: Web servers operate on a client-server model, where the server (the web
server) responds to requests from clients (web browsers or other client applications). This architecture
allows multiple clients to access the same web server simultaneously.
What is a web server?
◦ Examples: Some popular web server software includes Apache HTTP Server, Microsoft Internet
Information Services (IIS), and LiteSpeed Web Server. These servers can run on various operating
systems, such as Linux, Windows, and macOS.
◦ Configuration and Management: Web servers can be configured to serve different types of content,
manage user authentication, handle security features (such as SSL/TLS encryption), and optimize
performance. Administrators can typically manage and configure web servers through a graphical
interface or by editing configuration files.
XAMPP
◦ XAMPP is a free and open-source cross-platform web server solution stack package developed by
Apache Friends. The name "XAMPP" is an acronym that stands for:
• X: Stands for "Cross-platform," meaning it can run on various operating systems such as Windows,
macOS, Linux, and more.
• A: Stands for "Apache," which is the web server software included in the package.
• M: Stands for "MySQL," which is a relational database management system (RDBMS) included in the
package.
• P: Stands for "PHP," which is a popular server-side scripting language used for web development.
• P: Stands for "Perl," which is another programming language often used for web development.
XAMPP
◦ In addition to Apache, MySQL, PHP, and Perl, XAMPP also typically includes other useful tools and
software components such as phpMyAdmin, OpenSSL, and more. These tools help developers set up a
local web development environment quickly and easily without having to manually install and configure
each component separately.
◦ XAMPP is particularly popular among developers for its simplicity and ease of use. It provides a
complete and ready-to-use environment for developing and testing web applications locally on a
personal computer before deploying them to a live server.
◦ Overall, XAMPP is a valuable tool for developers looking to create and test web applications in a local
environment before deploying them to a live server. It simplifies the process of setting up a web server
environment and provides a convenient way to work on web projects offline.
XAMPP
Installation
◦ Link to download
https://www.apachefriends.org/
◦ 127.0.0.1 is the loopback Internet protocol (IP) address also referred to as the “localhost.”
◦ The address is used to establish an IP connection to the same machine or computer being
used by the end-user.
◦ Therefore, you may also enter the url: http://localhost/ to load your webpage. Try it!
Create a sample webpage using the following HTML Tags:
◦ Heading 1 (<h1>)
◦ Paragraph (<p>)
◦ Heading 2 (<h2>)
Activity ◦ Bold (<b>)
◦ Underline (<u>)
◦ Unordered List (<ul> and <li>)
◦ Image (<img>)
◦ Font <font>
Sample
Solution
Sample
Solution
Questions
References
◦ ASP tutorial. (n.d.). W3Schools Online Web
Tutorials. https://www.w3schools.com/asp/asp_introduction.asp
◦ PHP: Hypertext preprocessor (PHP). (23, May 11).
WebDev. https://www.memphis.edu/webdev/scripts/php.php
◦ Introduction to JSP. (2023, November 2).
GeeksforGeeks. https://www.geeksforgeeks.org/introduction-to-jsp/
◦ Introduction to HTML. (n.d.). W3Schools Online Web
Tutorials. https://www.w3schools.com/html/html_intro.asp
◦ 127.0.0.1 – What are its uses and why is it important? - Tech-FAQ. (2019, April 6). Tech-FAQ -
. https://www.tech-faq.com/127-0-0-1.html