Overview
This is the second part in a series of posts where I’m restoring my homelab environment. My goal is to automate as much as I can and make notes where it’s not working. This will consist of sections for each bit I’m installing.
I may repeat information as I’ll need to check my previous post.
MariaDB
In order to get the general stuff working, I need to install the web servers. This requires PHP, HTTP, and MARIADB packages and associated packages.
For MariaDB, I did some hunting and found a set of playbooks however they fail on the initialization tasks. The software is installed and started but when it tries to emulate the steps from the mysql_secure_installation program, it fails with a password error.
Eventually I simply ran the program by hand. I’ll have to revisit this.
PHP
This one was pretty simply. I simply need PHP and the PHP-MYSQLND packages. They installed cleanly with no errors.
HTTPD
This one also installed easily enough. We’ll need to follow up with some configuration work though in order to access the Inventory applications as they’re under the inventory DNS name for each site.
Import
Next up is to load up the websites. First follow any instructions such as creating the appropriate accounts and creating the database. For the Inventory:
mysql --user=root -p
Password:
create database inventory;
CREATE USER 'invadmin'@'localhost' IDENTIFIED BY '[password]';
GRANT ALL PRIVILEGES ON inventory.* TO 'invadmin'@'localhost';
FLUSH PRIVILEGES;
Set the appropriate password of course.
Database backups are in /opt/mysqlbackups. Simply uncompress the most recent full backup, drop into the directory then into the directory where the actual data is and import the SQL and data.
cd /opt/mysqlbackups
gzip -dc mysql.20260115.tar.gz | tar fvx -
cd mysql.20260115/inventory
for IMPORT in $(ls *sql)
do
echo ${IMPORT}
mysql --user=root -p inventory < ${IMPORT}
done
for IMPORT in $(ls *txt)
do
mysqlimport --user=root -p inventory $(pwd)/${IMPORT}
done
One of the changes was removing prod from all the production hostnames. This required a minor update to the settings.php file in the inventory to remove prod from the credential blocks. Once that was done, I was able to log in and view all the servers!
At this point, I can start adding the cronjobs back in to manage the inventory and ansible playbook inventories.
Next up is to hit the other tool servers and get them going plus any non-tool servers such as the wiki server.