Server rental store

Linux Server Administration

# Linux Server Administration

This article provides a foundational overview of Linux server administration, geared towards newcomers to server management within our wiki environment. It covers essential aspects of initial setup, security, and basic maintenance. This knowledge is crucial for those contributing to the infrastructure supporting our MediaWiki installation.

Initial Server Setup

Choosing the right Linux distribution is the first step. Popular choices include Ubuntu Server, Debian, CentOS, and Rocky Linux. The distribution determines the package manager and overall system philosophy. Once the distribution is selected, you'll need to perform a base installation, typically via a minimal image to reduce the attack surface.

After installation, initial configuration involves setting the hostname, timezone, and network settings. Static IP addresses are strongly recommended for servers. Ensure the server's hostname is resolvable via DNS. It's also vital to update the system packages immediately after installation.

Required System Resources

The following table outlines minimum recommended specifications for a MediaWiki server. These values will vary based on the size and traffic of the wiki.

CPU RAM Storage Network
2 Cores 4 GB 100 GB SSD 1 Gbps

User and Security Management

Strong security practices are paramount. The `root` account should be disabled for direct login. Instead, create a dedicated administrative user with `sudo` privileges. Utilize strong, unique passwords for all user accounts.

User Management Commands

The following table lists essential user management commands:

Command Description
`useradd ` Creates a new user account.
`passwd ` Sets or changes a user's password.
`usermod -aG ` Adds a user to a group.
`userdel ` Deletes a user account.

Implement SSH key-based authentication to eliminate password-based logins. Configure a firewall (e.g., `ufw` or `firewalld`) to restrict access to necessary ports only (typically 80 for HTTP, 443 for HTTPS, and 22 for SSH, though changing the SSH port is a good security practice). Regularly review system logs using tools like `journalctl` for suspicious activity. Consider using a intrusion detection system (IDS) like Fail2ban to automatically block malicious IPs.

Basic Server Maintenance

Regular maintenance is crucial for server stability and performance. This includes keeping software packages up-to-date, monitoring resource usage, and performing backups.

Update Management

The following table outlines how to update packages on common distributions:

Distribution Update Command
Ubuntu/Debian `apt update && apt upgrade`
CentOS/Rocky Linux `yum update` or `dnf update`
Arch Linux `pacman -Syu`

Implement automated backups using tools like `rsync` or dedicated backup solutions. Regularly check disk space usage with `df -h` and monitor CPU and memory usage with tools like `top` or `htop`. Utilize log rotation to prevent log files from consuming excessive disk space. Periodically review system logs for errors and warnings. Consider setting up system monitoring with tools like Nagios or Zabbix.

Networking Configuration

Proper network configuration is vital for accessibility. Ensure DNS records are correctly configured to point to the server's IP address. Configure a firewall to allow only necessary traffic. Consider using a reverse proxy like Nginx or Apache to improve performance and security. Understanding TCP/IP fundamentals is essential.

Further Resources

⚠️ *Note: All benchmark scores are approximate and may vary based on configuration. Server availability subject to stock.* ⚠️