Web Technology Notes
Web Technology Notes
Web applications are software programs that run on a web server and are accessed through a
web browser over the internet or an intranet. Unlike traditional desktop applications, which are
installed locally on a user's computer, web applications operate on a client-server model where
the server hosts the application and the client interacts with it via a web interface.
1. Frontend: The frontend is the user interface of the web application. It’s what users see
and interact with in their web browsers. It is built using technologies such as:
a. HTML (HyperText Markup Language): Provides the structure of the web page.
b. CSS (Cascading Style Sheets): Controls the layout and appearance of the web page.
c. JavaScript: Adds interactivity and dynamic behavior to the web page. Frameworks
like React, Angular, and Vue.js are popular for building complex user interfaces.
2. Backend: The backend is the server-side part of the web application that processes
requests, performs logic, interacts with databases, and sends responses back to the client.
It is built using server-side languages and frameworks such as:
3. Database: Web applications often rely on databases to store and retrieve data. Common
types of databases include:
4. Web Server: The web server hosts the web application and serves requests from clients.
Popular web servers include:
b. Nginx
Key Concepts
• Purpose: FTP is used for transferring files between a client and server. It supports
various modes (active and passive) and can use different authentication methods.
• Port: 22
• Purpose: SFTP is a secure version of FTP that uses SSH (Secure Shell) to encrypt the
data transfer, providing confidentiality and integrity.
• Port: 25
• Purpose: SMTP is used for sending email messages between servers. It handles the
transmission of email from the client to the mail server and between mail servers.
• Port: 110
• Purpose: POP3 is used for retrieving email from a server. It downloads emails from
the server to the local client and typically removes them from the server.
• Port: 53
9. Telnet:
• Port: 23
• Port: 22
• Purpose: SSH provides a secure channel for remote administration of systems and
secure file transfers (via SFTP or SCP). It encrypts the communication to protect
against eavesdropping and tampering.
WEB TECHNOLOGIES
SGML (Standard Generalized Markup Language), HTML5 (Hypertext Markup Language
version 5), and CSS3 (Cascading Style Sheets level 3) are all technologies related to the
structuring and presentation of content on the web. Here's an overview of each:
• Importance: SGML is more flexible and complex than HTML, allowing for the
definition of more complex document structures, but this also made it more
cumbersome to use, leading to the adoption of simpler markup languages like
HTML.
• Overview: HTML5 is the fifth and latest major version of HTML, the standard
language for creating and structuring web pages.
• New Features:
o Canvas and SVG: <canvas> and <svg> elements allow for dynamic,
scriptable rendering of 2D graphics and animations directly in the browser.
• Importance: HTML5 is widely used in modern web development for creating rich,
interactive, and accessible web content.
• Overview: CSS3 is the latest evolution of the Cascading Style Sheets language,
used to control the presentation and layout of web pages.
• New Features:
o Modules: CSS3 is divided into modules, allowing for the introduction of new
features independently of one another (e.g., Selectors, Box Model,
Backgrounds and Borders, Animations).
o Web Fonts: CSS3 supports custom web fonts through the @font-face rule,
allowing for the use of a wider variety of fonts on websites.
• Importance: CSS3 is essential for modern web design, providing powerful tools
for creating visually appealing and responsive web pages.
These three technologies form the foundation of modern web development, enabling the
creation of structured, interactive, and visually appealing websites.
• Overview: XML is a markup language that defines a set of rules for encoding
documents in a format that is both human-readable and machine-readable.
• Purpose: Unlike HTML, XML is not a fixed language but a framework that allows
the creation of custom markup languages for specific applications. It is often used
for data representation, configuration files, document storage, and data
interchange between systems.
• Applications:
o Data Storage and Transport: XML is widely used for storing and
transporting data in web services, APIs, and other applications.
o Custom Markup Languages: XML forms the basis for many other markup
languages, such as XHTML and SVG (Scalable Vector Graphics).
• Purpose: XHTML was developed to ensure that web content can be easily
interpreted by both browsers and XML-based tools. It helps maintain compatibility
with XML-based applications.
• Key Features:
o Strict Syntax Rules: All elements must be properly nested and closed, and
attribute values must be quoted.
• Applications:
o Web Development: XHTML is used for creating web pages that adhere to
stricter standards than traditional HTML, improving consistency across
different browsers and devices.
• Purpose: XHTML MP is tailored for mobile devices with limited processing power
and display capabilities. It is designed to ensure that content can be displayed
properly on a wide range of mobile devices.
• Key Features:
• Applications:
o WAP 2.0: XHTML MP was adopted as the standard markup language for
WAP 2.0, a protocol used to access information over a mobile wireless
network.
4. Summary
• Core XML: A flexible markup language used for data representation and the
foundation for many other markup languages.
• Key Features:
o Extensibility: SOAP allows for the use of custom headers and supports
features like security, transaction management, and more through SOAP
extensions.
• Applications:
• Purpose: REST simplifies interaction with web services by using standard web
protocols and focusing on resources rather than complex messaging protocols.
• Key Features:
o Statelessness: Each request from a client to a server must contain all the
information needed to understand and process the request. The server
does not store any session state.
• Applications:
o Web APIs: REST is widely used in the development of APIs for web and
mobile applications, due to its simplicity and compatibility with web
standards.
• Purpose: WML was created to deliver content to mobile devices with limited
display and processing capabilities, before the widespread adoption of modern
web standards like HTML5 on mobile devices.
• Key Features:
o Card and Deck Metaphor: WML documents are divided into "decks," with
each deck containing one or more "cards." Each card represents a single
interaction screen.
• Applications:
• Key Features:
o XPath: XSLT uses XPath to navigate and select parts of an XML document
to be transformed.
• Applications:
o Data Transformation: XSLT is widely used to convert XML data into other
formats for different purposes, such as generating HTML from XML data or
converting XML data to PDF via XSL-FO.
• WML: A markup language for delivering content to early mobile devices with limited
capabilities, used primarily in the early mobile internet era.
• XSL: A language for transforming and rendering XML documents, with XSLT being
the most widely used for converting XML data into various formats.
Web services operate over the internet using standardized protocols to allow different
applications to communicate and exchange data. Here's a breakdown of the key topics you
mentioned:
• REST (Representational State Transfer) and SOAP (Simple Object Access Protocol) are
two primary web service operation models.
• REST is stateless and uses standard HTTP methods (GET, POST, PUT, DELETE) for
operations, while SOAP is more rigid and relies on XML for message formatting.
• WSDL (Web Services Description Language) is often used with SOAP to describe the
service operations.
• Request Methods: Common methods include GET (retrieves data), POST (sends data to
the server), PUT (updates resources), and DELETE (removes resources).
• Headers: HTTP requests include headers such as Authorization, Accept, and Content-Type
to provide additional context to the server.
• Body: In methods like POST and PUT, the request body contains data, often in JSON, XML,
or form-data formats.
• Status Codes: HTTP responses include status codes like 200 OK, 404 Not Found, 500
Internal Server Error, which indicate the result of the request.
• Headers: Response headers like Content-Type specify the format of the returned data,
while Set-Cookie can be used to send cookies to the client.
• Body: The response body contains the requested data or error messages, formatted in
HTML, JSON, or XML depending on the API or web service.
4. Cookie Coordination
• Cookies are small pieces of data stored on the client’s browser. They are used for
maintaining sessions, user preferences, and tracking.
• Cookies include parameters like Domain, Path, Expires, Secure, and HttpOnly.
• Web services can set and retrieve cookies through HTTP headers, specifically Set-Cookie
(to set a cookie) and Cookie (to retrieve a cookie in subsequent requests).
• P3P was a protocol that allowed websites to declare their intended use of information
they collect about users in a standard format. However, its usage has largely declined due
to privacy laws such as GDPR and modern browser privacy practices.
• Modern Privacy Concerns: Today, web services prioritize privacy through clear privacy
policies, encrypted communication (using HTTPS), data minimization, and compliance
with regulations like GDPR and CCPA.
• Complex HTTP interactions involve various methods and mechanisms for coordinating
multiple requests, caching strategies, authentication, and security (OAuth, JWT tokens,
etc.).
• APIs often use pagination for handling large sets of data and caching (through headers
like ETag, Cache-Control) for efficiency.
• Rate limiting is used to prevent abuse and overloading of web services by limiting the
number of requests a client can make in a given period.
7. Dynamic Content Delivery
• Dynamic content is generated in response to user interaction or changes in data. This can
be achieved using server-side scripts (PHP, Node.js) or client-side JavaScript frameworks
(React, Angular).
• Web services and APIs can dynamically serve content by querying databases, processing
business logic, and returning relevant responses.
• AJAX (Asynchronous JavaScript and XML) is used for partial page updates without
reloading the entire page, providing a more interactive user experience.
WEEK#5: Server configuration and server security in web technologies
o Apache HTTP Server: Popular due to its flexibility and module support.
o Nginx: Known for high performance, scalability, and handling static content
efficiently.
o Linux (Ubuntu, CentOS, etc.): Common for web servers due to its stability,
performance, and flexibility.
3. Virtual Hosts: Virtual hosts allow hosting multiple domains on a single server. Configuring
virtual hosts involves:
4. Port Configuration: Web servers typically serve HTTP on port 80 and HTTPS on port 443.
In some cases, other ports might be needed for services like FTP, SSH, or custom
applications.
5. Database Server: Ensure the web server communicates with the database server (e.g.,
MySQL, PostgreSQL, MongoDB) securely and efficiently by:
o Proper network configuration (open necessary ports for database
communication).
6. Reverse Proxy Setup: Reverse proxies like Nginx can distribute requests among different
backend services, cache content, and provide load balancing.
7. Caching: Configuring caching improves the speed of serving static content and reduces
the load on servers:
o Content Delivery Network (CDN): Offload static resources (images, CSS, JS).
8. Logging: Configure logging for performance monitoring, error handling, and security
auditing. Tools like Syslog or ELK (Elasticsearch, Logstash, Kibana) are often used.
Securing web servers is critical for preventing unauthorized access, data breaches, and
cyberattacks. Here are key measures to enhance server security:
o Always use HTTPS (TLS) to encrypt data transmitted between the client and server.
o Obtain SSL certificates from trusted authorities (e.g., Let’s Encrypt, DigiCert).
o Redirect HTTP requests to HTTPS using server configuration (in Nginx, Apache,
etc.).
2. Firewalls:
o Use firewalls (e.g., iptables, UFW) to control access to the server, restricting
unnecessary ports and limiting IP ranges.
o Employ Web Application Firewalls (WAFs) to block malicious traffic, such as SQL
injection, XSS, and DDoS attacks.
3. SSH Security:
4. User Permissions:
o Minimize the use of privileged accounts. Restrict web server processes to running
under non-root users.
o Use role-based access control (RBAC) for limiting user access to only necessary files
and resources.
o Tools like Snort or OSSEC can monitor server traffic and logs for suspicious activity
and alert administrators of potential breaches.
o Ensure that input from users is validated and sanitized to prevent code injection
attacks.
8. Password Policies:
o Enforce strong password policies for server access, database access, and user
accounts.
9. File Permissions:
o Ensure that server directories and files have appropriate permissions set. Sensitive
files (e.g., configuration files, logs) should not be accessible by unauthorized users
or applications.
o Regularly backup critical data and configuration files. Use encrypted backups to
protect data at rest.
o Create and test a disaster recovery plan to minimize downtime in case of attacks
or failures.
o Regularly scan the server for vulnerabilities using tools like Nessus, OpenVAS, or
Qualys.
o Follow best practices for patch management and apply patches as soon as they
become available.