Notes on setting up a cloud server.

I’m moving a server that is on very old hardware to a Linode instance with Ubuntu Linux 18.04, Apache, MariaDB, and PHP 7. I know that I am going to have some migration issues since the current server is running Ubuntu 10.04.4 LTS.

Setting up Apache and PHP were straightforward, but I ran into problems with MariaDB. I turns out that even if you harden the installation and set a new password for root, you can’t log in with the new password. It uses the password for the root login on the machine. Once I figured that out, I created a user for myself and then installed phpMyAdmin.

Two problems occurred with that installation. First, apparently PHP7 does not include mcrypt, but the newest version of phpMyAdmin does not require it.

Second problem is that the conf file was not installed. I made a symlink to its location and restarted Apache. Then let Apache know that the conf file was available by running:


sudo a2enconf phpmyadmin


username: /etc/apache2/conf-available $ sudo ln -s /etc/phpmyadmin/apache.conf phpmyadmin.conf
sudo systemctl restart apache2

Notes on migrating user accounts to a new server

I found this link that was useful in moving my users to a new machine.


export UGIDLIMIT=1000
awk -v LIMIT=$UGIDLIMIT -F: '($3>LIMIT) && ($3!=65534)' /etc/passwd > /root/migrate/passwd.mig

awk -v LIMIT=$UGIDLIMIT -F: '($3>LIMIT) && ($3!=65534)' /etc/group > /root/migrate/group.mig

awk -v LIMIT=$UGIDLIMIT -F: '($3>LIMIT) && ($3!=65534) {print $1}' /etc/passwd | tee - |egrep -f - /etc/shadow > /root/migrate/shadow.mig

tar -zcvpf /root/migrate/home.tar.gz /home
tar -zcvpf /root/migrate/mail.tar.gz /var/spool/mail

cd /
tar -zxvf /path/to/location/home.tar.gz

cd /
# tar -zxvf /path/to/location/mail.tar.gz

There is one manual step that I needed to do. The procedures above create new groups but do not update the users in existing groups. To find out the current groups for the users run this command:


groups (admin_name)

I only need to do this for the handful of admin users on the system, so I didn’t bother to automate it.

Reboot to see your changes.