System Configuration

Configuring a UNIX/Linux system involves adjusting settings and parameters to tailor the system to your needs or the requirements of specific applications. This can range from kernel tweaks to service configuration, and it requires a good understanding of the underlying system components and how they interact.

Kernel Configuration and Compilation

The Linux kernel is the core of the operating system, interfacing between the hardware and software applications. Customizing the kernel allows you to optimize performance, add or remove functionality, and secure the system against certain types of attacks.

Why Customize

Reasons to customize the kernel include optimizing for specific hardware, improving performance, or enabling/disabling features (e.g., filesystems, network protocols).

Compilation and Installation

After configuration, the kernel is compiled and installed. This process is critical and should be approached with caution to avoid system instability.

# demo of compilation of kernel

make

make modules_install

make install

Service Management

Services, or daemons, are background processes that start at boot time or on demand. Managing these services efficiently is crucial for system performance and security.

systemd

With systemd, services are managed through units. Learn to use systemctl to start, stop, enable (start at boot), and disable services.

systemctl start nginx

systemctl enable nginx

systemctl status nginx

systemctl stop nginx

Managing log files

Log files are crucial for monitoring system health, debugging issues, and auditing security events. Efficient log management involves configuring log rotation, monitoring log files, and understanding the importance of syslog and journaling.

Log Rotation

Use logrotate to manage log files' size and number, ensuring that logs do not consume excessive disk space.

Journalctl

Part of systemd, journalctl allows querying and displaying logs from the systemd journal, offering advanced filtering options.

Network Configuration

Configuring network settings is essential for ensuring that a UNIX/Linux system can communicate effectively on a network.

Static vs Dynamic IP Addressing

Understand the difference between static IP configuration (The IP address is manually configured) and dynamic configuration via DHCP. (The IP address is assigned by the DHCP server and may change)

Network Interfaces

Configure network interfaces by editing /etc/network/interfaces or nmcli (NetworkManager command-line interface) for network settings.

Firewall Configuration

Use ufw (Uncomplicated Firewall) or firewalld for firewall management, setting up rules that define allowed and blocked traffic.