Skip to content

A practical guide to Linux server management focusing on AWS and virtual environments. Learn to install, configure, and troubleshoot Linux on AWS EC2, Oracle VirtualBox, and VMware with detailed instructions and best practices.

Notifications You must be signed in to change notification settings

AlawokiTech/Linux-Fundamentals

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Linux-Fundamentals

Comprehensive Linux Server Management: A Practical Guide to AWS and Virtual Environments

Table of Contents

Overview

This guide provides a detailed and structured guide to understanding, installing, and managing Linux servers, focusing on deployments in Amazon Web Services (AWS) and virtualized environments using Oracle VirtualBox and VMware.

Introduction

The purpose of this guide is to equip students, IT enthusiasts, and IT professionals with the foundational knowledge and practical skills necessary to operate Linux servers in cloud and virtual environments. Whether you are new to Linux or looking to enhance your cloud computing capabilities, this documentation offers step-by-step instructions, best practices, and troubleshooting tips to ensure successful deployment and management of Linux systems.

Target Audience

This guide is designed for:

  • Students: Learners who require a practical introduction to Linux and cloud technologies as part of their academic curriculum.
  • IT Enthusiasts: Hobbyists and technology enthusiasts interested in exploring Linux and virtual environments.
  • IT Professionals: Individuals seeking to enhance their cloud computing expertise and Linux server management skills.

Expected Outcomes

By following this guide, you will:

  • Gain a solid understanding of various Linux distributions and their use cases.
  • Learn how to install and configure Linux servers on AWS EC2 Instances.
  • Acquire practical experience in managing Linux environments within Oracle VirtualBox and VMware.
  • Develop the skills to troubleshoot common issues encountered in cloud and virtualized Linux environments.

This comprehensive guide is structured to provide a robust foundation for those aspiring to excel in cloud computing and Linux server management, ensuring you are well-prepared for both academic assessments and real-world applications.

Linux Overview

Linux is a free, open-source operating system known for its stability, security, and flexibility. Unlike Windows or macOS, it's widely used for servers and supercomputers. Users can modify and distribute their versions. Linux runs on various devices, from desktops to smartphones, and powers much of the internet's infrastructure. A global community of developers supports its numerous distributions, tailored to different needs.

Understanding Linux Distributions

Linux comes in various distributions (distros), each tailored to different use cases and user preferences. Here's a closer look at some popular distributions:

Ubuntu

  • Overview: Ubuntu is one of the most user-friendly Linux distributions, making it a popular choice for beginners.
  • Features: It offers a vast repository of software, a strong focus on usability, and regular updates.
  • Use Cases: Ideal for desktops, laptops, and servers, Ubuntu is often the first choice for those new to Linux.

CentOS

  • Overview: CentOS is a free, community-supported distribution that is functionally compatible with Red Hat Enterprise Linux (RHEL).
  • Features: Known for its stability and reliability, CentOS is preferred for enterprise environments.
  • Use Cases: Commonly used for servers and enterprise-grade applications, it provides a robust platform for hosting and development.

Fedora

  • Overview: Fedora is a cutting-edge distribution that focuses on integrating the latest technologies.
  • Features: It offers a sleek user interface and is often used as a testing ground for new features before they are included in Red Hat Enterprise Linux.
  • Use Cases: Ideal for developers and users who want to experiment with the latest software and technologies.

Red Hat Enterprise Linux (RHEL)

  • Overview: RHEL is a commercial distribution company that offers enterprise-level support and services.
  • Features: It provides a secure, stable, high-performance platform with long-term support.
  • Use Cases: Widely used in enterprise environments, RHEL is the go-to choice for mission-critical applications and large-scale deployments.

Hands-On: Linux Installation on AWS

Linux Installation and Setup: Creating a Linux Server on AWS

1. Sign up and Sign in to your AWS account.

  • Visit the AWS website and create an account if you don't already have one. AWS Sign-up Page

  • Follow the prompts to complete the registration process and verify your email address. AWS Registration

  • Sign in to the AWS Management Console using your credentials. AWS Sing-in

2. Provisioning an Ubuntu server on AWS

2. Provisioning an Ubuntu Server on AWS

  • Navigate to the EC2 Dashboard by selecting "EC2" under the "Compute" category.

    • Click on "Services" at the top of the page.
    • Scroll down to the "Compute" category.
    • Click on "EC2." ECS
  • Click on "Launch Instance" to start creating a new EC2 Instance. Launch EC2

  • Give a name to your EC2 Instance

  • Choose an Amazon Machine Image (AMI). For this setup, select an Ubuntu Server AMI (e.g., Ubuntu Server 20.04 LTS).

  • Select an instance type based on your needs (e.g., t2.micro for the free tier).

  • Configure the instance details, storage, tags, and security group settings as needed. Setup EC2

  • Review and launch the instance. When prompted, create or select an existing key pair and download the .pem file.

  • After launching the instance, note the instance ID, public IP address, or public DNS.

  • Ensure your security group allows SSH access (port 22) from your IP address.

3. Connecting to the Server

  • Client Tools: Client tools allow users to communicate with and send commands to the server. Examples include PuTTY, GitBash, PowerShell, MobaXterm, and Command Prompt on Windows, or Terminal on macOS.
  • Secure Protocol: Secure protocol such as SSH ensures that the information relayed to the remote server is protected from unauthorized access.

4. Connecting to EC2 Instance on AWS

Connecting from the Directory with the .pem File

  • Launch an EC2 Instance: Ensure you have an EC2 Instance running and note its instance ID, public IP address, or public DNS. EC2 Instance

  • Locate the Key Pair File: Ensure you have access to the .pem file created when setting up EC2 Instance.

  • Set and Locate the Appropriate Directory of the Key Pair File: Open a terminal on your local machine and navigate to the directory containing your key pair file.

  • Connect to the EC2 Instance: Use the SSH command to connect to your instance. The command format is as follow.

ssh -i "path/to/your-key-pair.pem" ubuntu@your-ec2-public-ip EC2 Instance

  • Use the SSH Command to Connect: Use the ssh command to connect to your instance. The command will look like this and can be found on the EC2 Instance as shown in the screenshot below. SSH Commane

  • Set and Locate the Appropriate Directory of the Key Pair File: Open a terminal on your local machine and navigate to the directory containing your key pair file. locate folder

  • Connect to the EC2 Instance: Use the ssh command to connect to your instance. The command will look like this: EC2 Command

  • Accept the Connection: The first time you connect, you may see a message asking if you want to continue connecting. Type yes and press Enter. EC2 Yes

  • You Are Connected: If everything is set up correctly, you should now be logged into your EC2 Instance. The command prompt will change to indicate you are on the remote server. EC2 Connect

Connecting Remotely Using the Key Pair File Path:

  • Specify the key pair file path in your SSH command to connect to the EC2 Instance .perm path

This command tells SSH to use the specified key pair file for authentication and to connect to the EC2 Instance at the given IP address using the specified username. Connect via path

Accept the Connection: The first time you connect, you may see a message asking if you want to continue connecting. Type yes and press Enter Connect

Accept the Connection:

  • You should be logged into your EC2 Instance if everything is set up correctly. The command prompt will change to indicate you are on the remote server. Connect

Here's a detailed explanation of each part of this command:

  • ssh -i: This starts the SSH command and specifies that you're using an identity file (key pair) for authentication.
  • C:\Users\kanmy\Downloads\EC2_Mini.pem: This is the full path to your key pair file on your local machine.
  • C:\Users\kanmy\Downloads\: This part indicates the directory where your key pair file is located.
  • EC2_Mini.pem: This is the name of your key pair file.
  • ubuntu@3.135.240.50: This specifies the remote user and the public IP address of your EC2 Instance.
  • ubuntu: This is your username to connect to the instance. For Ubuntu instances, the default username is ubuntu.
  • 172.31.21.57: This is the public IP address of your EC2 Instance.

Hands-On: Linux Installation on Virtual Machines

To gain practical experience, I installed various Linux distributions on virtual machines using Oracle VirtualBox and VMware. This approach provided valuable insights into the installation process and the nuances of running Linux in a virtualized environment.

Installing Linux on Oracle VirtualBox

  1. Download and Install VirtualBox:
    • Visit the Oracle VirtualBox website and download the installer for your operating system.
    • Follow the installation prompts to set up VirtualBox on your machine.

Oracle VirtualBox

  1. Download Linux ISO:
    • Choose the Linux distribution you want to install (e.g., Ubuntu, CentOS) and download the ISO file from the official website.

Ubuntu ISO

  1. Create a New Virtual Machine:
    • Open VirtualBox and click on "New" to create a new virtual machine.

Create New VM

  • Enter the name, type, and version of the operating system.

Name VM

  • Allocate memory and create a virtual hard disk for the VM.

Hardware Disk Summary

  1. Install Linux:
    • Start the virtual machine and select the downloaded ISO file as the startup disk.

Launch VM

  • Follow the on-screen instructions to complete the Linux installation. Complete VM

Installing Linux on VMware

  1. Download and Install VMware:
    • Visit the VMware website and download VMware Workstation or VMware Player.

Download VM

  • Install the software by following the provided instructions. VMWare Workstation
  1. Download Linux ISO:

Ubuntu ISO

  1. Create a New Virtual Machine:
    • Open VMware and select "Create a New Virtual Machine."

Create New VM

  • Follow the setup wizard, specifying the ISO file and configuring the VM settings.

Load ISO Image Load ISO Image Load ISO Image

  1. Install Linux:
    • Power on the virtual machine and proceed with the Linux installation by following the guided prompts.

Troubleshooting Guide

When working with Linux servers on AWS or virtual machines, encountering various issues is common. This troubleshooting guide offers solutions for frequently faced problems.

On AWS EC2 Instances

  1. Instance Not Launching:

    • Cause: Insufficient permissions or quota limits.
    • Solution: Check permissions and EC2 service limits.
  2. Cannot Connect to Instance:

    • Cause: Incorrect security group settings.
    • Solution: Allow inbound traffic on port 22 (SSH) and whitelist your IP address.
  3. Permission Denied (Public Key):

    • Cause: Incorrect key pair file permissions.
    • Solution: Use chmod 400 your-key-pair.pem to set correct permissions.
  4. Instance Stuck in Stopping/Terminating:

    • Cause: AWS issues or hardware problems.
    • Solution: Contact AWS support or force-stop via AWS Management Console or CLI.
  5. Slow Instance Performance:

    • Cause: Under-provisioned instance type.
    • Solution: Upgrade to a more powerful instance type.
  6. Cannot Access Hosted Web Server:

    • Cause: Incorrect security group/firewall settings.
    • Solution: Allow inbound traffic on port 80 (HTTP) or 443 (HTTPS) and verify firewall settings.

On Virtual Machines

  1. VM Won’t Start:

    • Cause: Insufficient system resources.
    • Solution: Ensure adequate CPU, memory, and disk space. Close other applications.
  2. Cannot Mount ISO File:

    • Cause: Incorrect ISO file or misconfiguration.
    • Solution: Verify ISO integrity and correct startup disk configuration.
  3. Network Connectivity Issues:

    • Cause: Misconfigured network settings.
    • Solution: Check network adapter settings (NAT or Bridged mode).
  4. Slow VM Performance:

    • Cause: Limited resources or high host load.
    • Solution: Allocate more RAM and CPU cores. Reduce host machine load.
  5. Guest Additions Not Working (VirtualBox):

    • Cause: Improper installation.
    • Solution: Reinstall via "Devices" > "Insert Guest Additions CD image".
  6. VMware Tools Not Installed:

    • Cause: Not installed or outdated.
    • Solution: Install/update via "VM" > "Install VMware Tools".

Conclusion

This guide provides a comprehensive introduction to Linux server management, focusing on both AWS and virtual environments. By following the step-by-step instructions, you have gained practical experience in installing, configuring, and troubleshooting Linux servers. Whether you're a student, IT enthusiast, or professional, these skills are essential for managing Linux in today's cloud-driven landscape. As you continue to explore and refine your abilities, this guide serves as a foundational resource to support your journey in mastering Linux server management.

Version History

Version Date Description
1.0 2024-08-01 Initial release
1.1 2024-08-05 Updated with additional troubleshooting steps
1.2 2024-08-07 Added VMware installation guide and performance tips

Glossary

  • AWS: Amazon Web Services - A comprehensive cloud computing platform provided by Amazon.
  • EC2: Elastic Compute Cloud - A web service that provides resizable compute capacity in the cloud.
  • ISO File: An image file that contains an exact copy of a disc, often used for OS installations.
  • SSH: Secure Shell - A protocol for securely accessing a remote computer over an unsecured network.
  • VM: Virtual Machine - An emulation of a computer system that provides the functionality of a physical computer.
  • VirtualBox: A free and open-source hypervisor for running virtual machines on a host operating system.
  • VMware: A company that provides virtualization and cloud computing software and services.

References

  1. Amazon Web Services (AWS): aws.amazon.com
  2. Ubuntu Documentation: ubuntu.com
  3. CentOS Documentation: centos.org
  4. Fedora Project: getfedora.org
  5. Red Hat Enterprise Linux (RHEL): redhat.com
  6. Oracle VirtualBox: virtualbox.org
  7. VMware: vmware.com

About

A practical guide to Linux server management focusing on AWS and virtual environments. Learn to install, configure, and troubleshoot Linux on AWS EC2, Oracle VirtualBox, and VMware with detailed instructions and best practices.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published