Comprehensive Ubuntu System Administration and Configuration Guide
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
- Return to the Language Settings panel.
- Set the Input Method framework to
fcitx. - Reboot the system.
- Launch the configuration tool:
fcitx-configtool. - 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