[go: up one dir, main page]

0% found this document useful (0 votes)
5 views80 pages

Client and Server

The document outlines the setup of a client-server environment using Ubuntu-based services, specifically focusing on DHCP and web server configurations. It explains the purpose of a web server, the characteristics of Ubuntu as a Linux distribution, and provides detailed instructions for setting up Oracle VirtualBox, configuring network settings, and installing necessary software packages. Additionally, it covers commands for managing the DHCP server and accessing the web server hosted on the Ubuntu system.

Uploaded by

heartycutie841
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views80 pages

Client and Server

The document outlines the setup of a client-server environment using Ubuntu-based services, specifically focusing on DHCP and web server configurations. It explains the purpose of a web server, the characteristics of Ubuntu as a Linux distribution, and provides detailed instructions for setting up Oracle VirtualBox, configuring network settings, and installing necessary software packages. Additionally, it covers commands for managing the DHCP server and accessing the web server hosted on the Ubuntu system.

Uploaded by

heartycutie841
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 80

Client-Server Setup

Demonstration
Using Ubuntu-based Services: DHCP and
Web Server

Prepared by : Gerardo S. Carlos Jr.


What is web server? And why we need it?
• A web server is a computer system that processes request via
HTTP, the basic network protocol used to distribute information
on the World Wide Web.

• A web server main purpose is to store web site files and


broadcast them over the internet for you site visitor to see.

• Thus, the main purpose of a web server is to store and transfer


web site data upon the request of a visitor’s browser
What is Ubunto?

• Ubunto is a Linux-based Operating system

•It is most popular Linux Distribution

•It is open sourced, Cost Free, non-proprietary

•Strong focus on , Usability, Easy to installation, one user


(initially-you can add more users later)
Origin

• Ubunto is an African concept meaning “humanity


towards other”

• It is developed under Debian Project. (Largest Linux


software development community)

• Sponsored by Canonical Ltd.

• Owned by South African billionaire Mark


Shuttleworth.
Security
Oracle VirtualBox
Virtualbox Manager and set
up
Oracle VirtualBox is a free and open-source
virtualization software that allows you to run multiple
operating systems on a single physical machine.
When installed on Ubuntu (or any Linux distribution)
Preferences
Appearance: A wrench or gears icon commonly symbolizes "settings" or
"preferences."
Function in VirtualBox: Clicking this button would open the Global Settings or
Preferences dialog for VirtualBox. Here, you can configure various aspects of
the VirtualBox application itself, not a specific virtual machine.
This includes:
• General settings: Default machine folder, interface language, update
settings.
• Input settings: Hotkeys for the host key.
• Update settings: How and when VirtualBox checks for updates.
• Network settings: Host-only networks, NAT networks.
• Proxy settings: For internet access.
• Extensions: Managing installed VirtualBox Extension Packs.
Import
Appearance:
• A downward arrow often indicates "downloading" or "bringing in."
The U-turn shape can imply bringing something from an external
source into the current environment.
Function in VirtualBox:
• This button is used to import an existing virtual appliance. A virtual
appliance is typically a pre-configured virtual machine packaged in
an Open Virtualization Format (OVF) or Open Virtualization
Archive (OVA) file. You would use this if you've downloaded a
ready-to-use virtual machine from a website or received one from
another user. Importing it adds it to your VirtualBox inventory,
making it available to run.
Export
Appearance:
• An upward arrow usually signifies "uploading" or "sending out." The U-turn
shape, in this case, implies taking something from the current environment
and preparing it for external use.
Function in VirtualBox:
• This button allows you to export a virtual machine as a virtual appliance
(OVF/OVA file).
This is useful for:
• Sharing: Giving your virtual machine to someone else.
• Backup: Creating a complete, portable backup of your virtual machine.
• Migration: Moving a virtual machine to another VirtualBox installation or
even another virtualization platform that supports OVF/OVA.
New
Appearance:
• A star or asterisk often denotes something "new" or "important." The
plus sign unambiguously means "add" or "create."
Function in VirtualBox: This is arguably one of the most frequently used
buttons. Clicking "New" starts the "Create Virtual Machine" wizard. This
wizard guides you through the process of setting up a new virtual machine
from scratch, including:
• Giving it a name.
• Selecting the operating system type (e.g., Windows, Linux, macOS)
andversion.
• Allocating RAM.
• Creating or selecting a virtual hard disk.
Add
Appearance:
• A green plus sign universally means "add."
Function in VirtualBox: While "New" creates a new virtual machine from
scratch, "Add" is used to add an existing virtual machine to the VirtualBox
Manager inventory.
• ou've manually moved a virtual machine's files (like its .vbox
configuration file and its virtual hard disk files) to a new location.
• You've created a virtual machine on another VirtualBox installation and
copied its files over, but not as an OVF/OVA appliance (in which case you'd
use Import).
• You removed a virtual machine from the manager's list (but didn't delete
its files) and now want to bring it back. You would browse to the .vbox file
of the virtual machine.
Set-up VirtualBox

https://www.virtualbox.org/wiki/Downloads

Ubuntu Server
https://ubuntu.com/download/server
Set-up Server in Oracle Virtual
Box
Click Setting to continue Set-up
Go to Storage
Click the “Controller: IDE then
disk point by red arrow
Click the point red arrow, then click
the Choose button
Click the Empty , then remove
attachment, then click ok button
Back to click settings the click Adapter 2 and check
Enable Network Adapter
Take note: Adapter 1 for NAT for internet
connection, adapter 2 for internal network
Change it into “internal Network”
Click Start
Click start(Done) inside the red box and Choose
ubuntu Server
Create name, username and
password
Put x in “Install OpenSSh server
Click Reboot Now
Need to set-up internal network
Install and update
Set a Static IP on enp0s8
Set to network server
Use this to apply all your works
Configure DHCP Server on
Connect internal
network
Connect internal
network
Meaning done set-up
To show subnet
Client Set up
Press the arrow to start set-up
Press enter the install ubuntu
server
Choose the language you want to
X the Ubuntu Server
Proxy configuration
Processing ubuntu archieve mirror
If the last part it say’s…
“reading package lists…”
Then click done
Storage configuration
Storage configuration
Set up name
Ubuntu pro
Click SPACE “Install OpenSSH server”
and enter done
Enter “Done”
Enter your user and password
After logging in
Set up Command for
Server
sudo apt update
The command sudo apt update is used to update the package index on your
Debian-based Linux system (such as Ubuntu).
Retrieves the latest list of available software packages and updates from
configured repositories.
sudo apt install isc-dhcp-server
apache2
Sudo:
● Runs the command with superuser (administrator) privileges. Many system
management tasks, like installing software, require elevated permissions.

apt:
● The Advanced Package Tool, a command-line tool for managing packages on
Debian-based Linux distributions. It helps search, install, update, and remove software
packages.

install:
● A subcommand of apt, used to install a specified package identified by its name.
apache2:
● The name of the package you want to install. It refers to the Apache HTTP Server
version 2, a popular open-source web server software.
sudo nano
/etc/netplan/01-netcfg.yaml
This YAML file defines how your Ubuntu system configures its network
interfaces, including:
• IP addressing (static or DHCP)
• Gateway
• DNS servers
• Interface names (like eth0, ens33, etc.)
network:
version: 2
ethernets:
enp0s8:
addresses: [10.0.0.1/24]
dhcp4: no
enp0s3:
dhcp4: true # For internet access (NAT)

Network:
• Top-level key that starts the network configuration block.
Version: 2
• Specifies the Netplan configuration version. Version 2 is the current standard.
Ethernets:
• Defines configuration for Ethernet interfaces.
Enp0s8:
• Assigned a static IP address.
Addresses: [10.0.0.1/24]:
• Assigns the IP 10.0.0.1 with a subnet mask of 255.255.255.0 (CIDR /24).
Dhcp4:
• DHCP is disabled — it will not request an IP from a DHCP server.
Interface 2: enp0s3
• The system will request an IP from a DHCP server (likely your router or a
virtual NAT adapter).
• The comment # For internet access (NAT) indicates this interface is used to
connect to the internet, typically via NAT if on a virtual machine (e.g.,
VirtualBox or VMware).
sudo netplan apply
Is used on Ubuntu (and other systems using Netplan) to apply the network
configuration defined in Netplan YAML files — typically located in
/etc/netplan/.
• Reads the configuration files (e.g., /etc/netplan/01-netcfg.yaml)
• validates the YAML syntax
• Applies the specified settings to the system's network interfaces
● Sets static Ips
● Enables/disables DHCP
● Sets gateways, DNS, routes, etc.
sudo apt update
Used on Debian-based Linux systems (like Ubuntu) to refresh the
package index — the list of available software packages and versions from
your configured repositories.
sudo apt install isc-dhcp-server
It’s the Internet Systems Consortium (ISC) DHCP server, a widely-used
DHCP (Dynamic Host Configuration Protocol) server that:

• Automatically assigns IP addresses to clients on a network.


• Provides another network configuration like subnet mask, gateway, DNS,
etc.
• Can be configured for static leases, dynamic ranges, and more.
sudo nano /etc/dhcp/dhcpd.conf
Is used to open and edit the main configuration file for the ISC DHCP
server on Ubuntu (or any Debian-based system).
What is /etc/dhcp/dhcpd.conf?
This file defines how the DHCP server behaves — such as:

● Which IP address range to assign to clients


● Lease durations
● Default gateway and DNS settings
● Static IP assignments (optional)
● Subnets and network masks
Subnet netmask Range
This defines how the ISC DHCP server should assign IP addresses and
related settings to clients on the 10.0.0.0/24 network. On the 10.0.0.0/24
network, assign IPs from 10.0.0.10 to 10.0.0.50. Tell clients that 10.0.0.1 is the
gateway and 8.8.8.8 is the DNS server.

subnet 10.0.0.0 netmask 255.255.255.0 {


range 10.0.0.10 10.0.0.50;
option routers 10.0.0.1;
option domain-name-servers 8.8.8.8;
}
sudo nano
/etc/default/isc-dhcp-server
The command sudo nano /etc/default/isc-dhcp-server opens the configuration
file for the ISC DHCP server in the nano text editor with superuser privileges.
This file is where you specify which network interface(s) the DHCP server
should listen on.
INTERFACESv4="enp0s8"
The variable INTERFACESv4="enp0s3" likely refers to the configuration of
the IPv4 network interface named "enp0s3" on a Linux system. This interface
name typically indicates an Ethernet connection on the first PCI bus, slot 3.
The INTERFACESv4 variable is likely used in a configuration file, such as
/etc/network/interfaces (for older systems) or a Netplan configuration file (for
newer systems like Ubuntu 22.04) to specify that the interface named
"enp0s3" should be configured for IPv4.
sudo systemctl restart isc-dhcp-server
sudo systemctl status isc-dhcp-server
The first command restarts the DHCP server, which can be necessary after
configuration changes or to troubleshoot issues.
The second command checks whether the DHCP server is currently running
correctly, provides status details, and shows recent logs for diagnostics.
echo "Welcome from the Server VM!" |
sudo tee /var/www/html/index.html
This file is the default webpage for a web server (like Apache) served from
/var/www/html/. So, after running this command, visiting your server's IP
address in a browser will display "Welcome from the Server VM!".
sudo systemctl restart apache2
The command sudo systemctl restart apache2 is used to restart the Apache
web server service on a Linux system that uses systemd for service
management.
It stops the running Apache server and then immediately starts it
again.Useful for applying configuration changes, resolving issues, or after
updates.
Connect to Cient
sudo nano
/etc/netplan/01-netcfg.yaml
Pens the 01-netcfg.yaml file in the Nano editor with root permissions so you
can view or modify your network configuration settings.
Typically used when you want to change how your network interfaces are
configured, such as switching between DHCP and static IP, or adjusting
network parameters.
dhcp4: true
Dhcp4:
● This specifies whether DHCP (Dynamic Host Configuration Protocol) for IPv4 is
enabled for a network interface.

True:
● Means DHCP is enabled.
When you set dhcp4: true, the network interface will automatically obtain its
IPv4 address, subnet mask, default gateway, and DNS servers from a DHCP
server on the network.
sudo netplan apply
It applies the network settings based on the configuration files. If you've made
changes to the YAML files (like setting static IP addresses, enabling DHCP, or
modifying DNS), this command makes those changes take effect right away. It
might temporarily disrupt network connectivity depending on the
ip a
The command ip a (short for ip address) is used to display all network
interfaces and their current IP addresses on your Linux system.

● A list of all network interfaces (like eth0, wlan0, lo for loopback, etc.)
● Details about each interface, including:
● MAC address (link layer address)
● IPv4 addresses (e.g., 192.168.1.10)
● IPv6 addresses (if configured)
● Interface status (whether it's UP or DOWN)
● Other related information such as MTU size and more
Network Testing
Ping server
ping 10.0.0.1

● The command ping 10.0.0.1 is used to test connectivity between your computer
and the network device or server at the IP address 10.0.0.1.
Address
http://10.0.0.1

● The URL http://10.0.0.1 refers to a web address using the Hypertext Transfer
Protocol (HTTP), pointing to the IP address 10.0.0.1.
Access Web Server
curl http://10.0.0.1

● The command curl http://10.0.0.1 is used to make an HTTP request to the


server at IP address 10.0.0.1. It attempts to fetch the web page or resource
hosted at that address.

You might also like