how to install a second server of mariadb
You will probably run into more conflicts than just what is listed in the question, e.g. TCP port, datadir, /etc/my.cnf, as well as maybe pid and socket. I think these configuration issues can be overcome by using different settings (MariaDB-specific sections in the .cnf files). 

I'm not sure whether installing MariaDB from packages alongside a standard installation of MySQL (from packages) is feasible. rpm has an option --relocate OLDPATH=NEWPATH and --prefix NEWPATH which allows you to set a non-standard install path for rpms marked as relocatable. Not all rpms are reloatable. 

However, see Installing MariaDB alongside MySQL (mariadb.com) which talks about installing the compiled binary distribution of MariaDB 5.5 from source code alongside an existing installation of MySQL. This is also the approach used by tools like dbdeployer.

See also Running Multiple MySQL Instances on One Machine (mysql.com) which talks about installing multiple MySQL instances on the same server. This may or may not be useful.

One relatively low-effort solution could be to install MariaDB in a Docker container. See e.g. MariaDB and Docker use cases, Part 1:


  Docker use case #1: Multi Tenancy
  
  A common use case for MariaDB and Docker is running several instances of MariaDB on the same physical hosts.