Fading Coder

One Final Commit for the Last Sprint

Home > Tech > Content

Comprehensive Ubuntu System Administration and Configuration Guide

Tech May 8 3

Setting Up Chinese Input Suport

Language Pack Installation

To enable localized support, install the necessary language packages:

sudo apt update
sudo apt install language-pack-zh-hans

Alternatively, access the GUI Settings menu, navigate to Region & Language, and select Install/Remove Languages. Check Simplified Chinese to trigger automatic installation.

Integrating Fcitx

Install the Google Pinyin backend via:

sudo apt install fcitx-googlepinyin
  1. Return to the Language Settings panel.
  2. Set the Input Method framework to fcitx.
  3. Reboot the system.
  4. Launch the configuration tool: fcitx-configtool.
  5. Click the Add button (+). Uncheck Only show current language to search broadly. Locate Google Pinyin, confirm selection, and save.

Troubleshooting Git SSL Connection Errors

When cloning repositories, you may encounter SSL handshake reset errors (e.g., Connection was reset). This often occurs when local configurations interfere with public certificate validation.

If running behind a proxy or using a custom CA, disable strict verification temporarily:

git config --global http.sslVerify false

Retry the git clone operation.

Establishing an Nginx RTMP Stream Server

Prerequisites: Ubuntu 20.04 environment.

Installation and Linking

sudo apt install nginx libnginx-mod-rtmp
sudo ln -s /usr/sbin/nginx /usr/bin/nginx
sudo systemctl status nginx

Configuration

Edit /etc/nginx/nginx.conf and append the following block:

rtmp {
    server {
        listen 1935;
        chunk_size 4096;

        application live_stream {
            live on;
            record off;
        }
    }
}

Reload service:

sudo /usr/sbin/nginx -s reload

Push Stream Testing

Install FFmpeg via Snap and test the push:

sudo snap install ffmpeg
ffmpeg -re -i video_source.mkv -vcodec libx264 -acodec aac -f flv -flvflags no_duration_filesize rtmp://127.0.0.1:1935/live_stream/clip

Database Configuration (MySQL & MongoDB)

Installing and Hardening MySQL

Begin with the standard repository installation:

sudo apt install mysql-server
sudo mysql_secure_installation

During initialization, select the following values:

  • Validate Password Plugin: No
  • Root Password: [Set Secure Value]
  • Remove Anonymous Users: No
  • Disallow Root Login Remotely: No
  • Remove Test Database: No
  • Reload Privilege Tables: Yes

Enable remote connectivity by modifying the bind address in /etc/mysql/mysql.conf.d/mysqld.cnf:

bind-address = 0.0.0.0

Restart the daemon:

sudo systemctl restart mysql

Remote Access Configuration

Log in locally and grant permissions:

USE mysql;
SELECT User, Host FROM user;

-- Modify root password encryption method
ALTER USER 'root'@'localhost' IDENTIFIED BY 'NewSecurePassword';

-- Allow wildcard host access
UPDATE user SET host = '%' WHERE user = 'root';
FLUSH PRIVILEGES;

Deploying MongoDB Community Edition

Import GPG keys for Ubuntu 22.04 (Jammy) or 20.04 (Focal):

curl -fsSL https://www.mongodb.org/static/pgp/server-8.0.asc | \
  sudo gpg -o /usr/share/keyrings/mongodb-server-8.0.gpg --dearmor

Create the repository source file appropriate for your version:

echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-8.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/8.0 multiverse" | \
  sudo tee /etc/apt/sources.list.d/mongodb-org-8.0.list

Install and enable persistence:

sudo apt update
sudo apt install -y mongodb-org
sudo systemctl start mongod
sudo systemctl enable mongod

To allow external connections, edit /etc/mongod.conf and set:

net:
  bindIp: 0.0.0.0

Utility Installation and System Management

Multimedia and Editors

Install popular desktop utilities via Snap or APT:

sudo snap install vlc
sudo snap install --classic code

User Administration

Verify system users and permissions:

cat /etc/passwd
who
getent passwd
getent group

Adjust ownership recursively:

sudo chown -R target_user:target_group /path/to/directory

Lightweight Web Server (Caddy)

Install Caddy using Cloudsmith repository:

sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | \
  sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | \
  sudo tee /etc/apt/sources.list.d/caddy-stable.list

sudo apt update
sudo apt install caddy

Related Articles

Understanding Strong and Weak References in Java

Strong References Strong reference are the most prevalent type of object referencing in Java. When an object has a strong reference pointing to it, the garbage collector will not reclaim its memory. F...

Comprehensive Guide to SSTI Explained with Payload Bypass Techniques

Introduction Server-Side Template Injection (SSTI) is a vulnerability in web applications where user input is improper handled within the template engine and executed on the server. This exploit can r...

Implement Image Upload Functionality for Django Integrated TinyMCE Editor

Django’s Admin panel is highly user-friendly, and pairing it with TinyMCE, an effective rich text editor, simplifies content management significantly. Combining the two is particular useful for bloggi...

Leave a Comment

Anonymous

◎Feel free to join the discussion and share your thoughts.