0% found this document useful (0 votes)
6 views2 pages

Ubuntu System Management Essentials

The Ubuntu System Management Guide covers essential tasks for managing an Ubuntu system, including user management, system updates, firewall configuration, Apache web server setup, MySQL database installation, PHP setup, and additional tools. Key commands for each task are provided, such as enabling root login, updating packages, configuring UFW, installing Apache and MySQL, and setting up PHP. The guide serves as a comprehensive reference for system administrators to effectively manage their Ubuntu environment.

Uploaded by

rightartuk
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)
6 views2 pages

Ubuntu System Management Essentials

The Ubuntu System Management Guide covers essential tasks for managing an Ubuntu system, including user management, system updates, firewall configuration, Apache web server setup, MySQL database installation, PHP setup, and additional tools. Key commands for each task are provided, such as enabling root login, updating packages, configuring UFW, installing Apache and MySQL, and setting up PHP. The guide serves as a comprehensive reference for system administrators to effectively manage their Ubuntu environment.

Uploaded by

rightartuk
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

Ubuntu System Management Guide

1. User Management
Add SSH key to VM metadata with user root.

Set a Root Password:


sudo passwd root

Switch to Root User:


su - root

Enable Root Login in SSH:


sudo nano /etc/ssh/sshd_config
(Ensure PermitRootLogin yes is set)

Restart SSH:
sudo systemctl restart ssh

2. System Updates
Update Package Lists:
sudo apt update

Upgrade Installed Packages:


sudo apt upgrade

3. Firewall Configuration (UFW)


Check Firewall Status:
sudo ufw status
sudo ufw status verbose

Enable/Disable UFW:
sudo ufw enable
sudo ufw disable

Allow Specific Ports:


sudo ufw allow 22
sudo ufw allow 80
sudo ufw allow 443

Allow Apache Profile:


sudo ufw allow 'Apache Full'

4. Apache Web Server


Install Apache2:
sudo apt install apache2

Create Virtual Host Config:


sudo nano /etc/apache2/sites-available/[Link]

Example Virtual Host:


(Refer to guide for full config)

Set Permissions:
sudo chown -R www-data:www-data /var/www/html/
sudo chmod -R 755 /var/www/html/
find /var/www/html -type f -exec chmod 644 {} \;
find /var/www/html -type d -exec chmod 755 {} \;

Enable the Site:


sudo ln -s /etc/apache2/sites-available/[Link] /etc/apache2/sites-enabled/
sudo systemctl restart apache2

Enable SSL with Certbot:


sudo apt install certbot python3-certbot-apache
sudo certbot --apache

5. MySQL Database
Install MySQL Server:
sudo apt install mysql-server

Access MySQL as Root:


sudo mysql -u root -p

Create New Users:


CREATE USER 'data_user'@'localhost' IDENTIFIED BY 'password';
CREATE USER 'imdad'@'localhost' IDENTIFIED BY 'password';

Grant Privileges:
GRANT ALL PRIVILEGES ON *.* TO 'data_user'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;

6. PHP Setup
Install PHP:
sudo apt install php libapache2-mod-php
php -v

Enable Apache Modules:


sudo a2enmod php
sudo a2enmod rewrite
sudo systemctl restart apache2

Install PHP 8.3:


sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt install php8.3-cli php8.3-common php8.3-curl php8.3-gd php8.3-mysql php8.3-xml php8.3-mbstr

Check PHP Versions & Modules:


php -v
php -m
sudo systemctl status apache2

7. Additional Tools
Install Unzip:
sudo apt install unzip

Install PHP Extensions:


sudo apt install php-zip php-xml

You might also like