Post

Happy Sysadmin Day Yall

Title: Happy Sysadmin Day Yall: Mastering Infrastructure Management and System Administration in Your Homelab.

Title: Happy Sysadmin Day Yall: Mastering Infrastructure Management and System Administration in Your Homelab


INTRODUCTION

On this auspicious occasion of “Happy Sysadmin Day Yall”, we celebrate the tireless efforts and dedication of system administrators who ensure smooth operation of our digital ecosystems. Today, let’s discuss a crucial topic for homelab and self-hosted environments: setting up and managing your infrastructure like a pro! This guide will walk you through installing, configuring, and operating an efficient system administration platform tailored to your unique needs.

PREREQUISITES

System Requirements

  • Operating System: CentOS 7 or Ubuntu 18.04 LTS (64-bit)
  • Hardware: 2GB RAM, 1CPU, 20GB HDD
  • Network Requirements: Static IP address, accessible through your local network and Internet
  • Firewall Considerations: Ports 22 (SSH), 80 (HTTP), 443 (HTTPS) should be open
  • User Permissions: Root access recommended for initial setup

Software Requirements

  • Apache Web Server: Version 2.4 or higher
  • PHP: Version 7.x or higher
  • MySQL Database Server: Version 5.6 or higher
  • phpMyAdmin: Latest version

INSTALLATION & SETUP

Install Apache, PHP, and MySQL

1
2
3
4
5
# CentOS 7
sudo yum install httpd php php-mysql -y

# Ubuntu 18.04 LTS
sudo apt-get install apache2 php libapache2-mod-php php-mysql -y

Install phpMyAdmin

For CentOS 7:

1
sudo yum install phpmyadmin -y

For Ubuntu 18.04 LTS, use the following commands:

1
2
3
sudo apt-get install phpmyadmin -y
sudo systemctl start mysql
sudo systemctl enable mysql

Next, configure phpMyAdmin to connect with your MySQL database server:

  1. Edit /etc/phpmyadmin/config.inc.php.
  2. Set $cfg['Servers'][$i]['user'] = 'your_mysql_username'; and $cfg['Servers'][$i]['password'] = 'your_mysql_password';.
  3. Save the file, and reload Apache: sudo systemctl reload apache2.

CONFIGURATION

Tune your configuration options to optimize performance and enhance security.

  • Tighten PHP security by disabling certain functions and extensions using a php.ini file (e.g., disable_functions, disable_extensions).
  • Implement strong password policies for user accounts.
  • Enable SSL for secure connections by installing an SSL certificate.
  • Configure access controls to limit who can access your infrastructure.

USAGE & OPERATIONS

Common Operations and Commands

  • Check server status: sudo systemctl status httpd/apache2
  • Start, stop, or restart Apache: sudo systemctl start/stop/restart apache2
  • Check MySQL status: sudo systemctl status mysql

Monitoring and Maintenance Procedures

Regularly check server logs for any errors or suspicious activity. Use tools like top and htop to monitor resource usage.

TROUBLESHOOTING

Common Issues and Solutions

  • Connection errors: Check your network settings, firewall configurations, and credentials.
  • Performance issues: Optimize PHP configurations, limit concurrent connections, and implement caching solutions.
  • Security vulnerabilities: Patch your software regularly, keep up with the latest security advisories, and harden your systems against attacks.

CONCLUSION

This guide has walked you through setting up a simple yet effective system administration platform for self-hosted environments. With this foundation in place, you can now explore more advanced topics like containerization, automation, and orchestration. Keep learning, stay curious, and always remember to celebrate the unsung heroes of our digital world: system administrators!

Resources for Further Learning

This post is licensed under CC BY 4.0 by the author.