Deploying a CentOS 7 Virtual Machine

Description
 
This install guide provides basic instructions for setting up a CentOS 7 Linux virtual machine with a default software baseline and Third Generation’s legacy compiler package. It is designed to create an environment compatible with most MU* projects, particularly where modern Linux distributions and newer glibc libraries are incompatible with decades-old source code, or where 32-bit compiler support is required. The goal is to provide a stable, predictable legacy environment for maintaining and running older MUD projects, ensuring customers have a cost-efficient and versatile solution during their migration process.
 
Important Note: CentOS 7 has reached end-of-life (EOL) and no longer receives official updates or security patches. Continuing to use it carries inherent risks, and it should only be deployed for maintaining or migrating legacy projects. Whenever possible, we strongly recommend using a modern, supported operating system such as Ubuntu 22.04 LTS or Rocky Linux 8, provided your codebase is compatible with newer libraries and compilers.
 
These instructions are intended specifically for decades-old MU* codebases that cannot run on modern systems without significant code changes, OS configuration adjustments, or containerized environments. They are offered as-is, with no warranty or guarantee of service. Third Generation cannot provide direct assistance with configurations or hands-on migration.
 
Audience
 
This guide is intended for:
 
1. Users with basic Linux experience who are comfortable using the command line
2. MUD administrators or developers migrating legacy MUD projects to a VPS
3. MUD projects that require access to older gcc compiler branches <= 4.4
4. MUD projects that require access to 32-bit standard c libraries
 
Resources
 
 
Prerequisites
 
Before beginning, ensure you have:
 
1. A VPS with adequate system resources (CPU, RAM, disk space)
2. You've been granted SSH access with administrative privileges to the VPS
3. Basic familiarity with Linux command-line operations
4. Adjusted any firewall configuration for the appropriate ports you wish to use (e.g. 80, 443, 4000)
 
Recommended System Resources
  • 1 vCPU, 2 GB RAM, 20 GB Disk
 
Software Installation
 
Purchase a virtual server from one of the recommended hosting providers

  • You should select CentOS 7 if it is still offered by your VPS provider. If it is not available, you will need to download the CentOS 7 ISO and perform a manual installation with custom configuration.
  • When deploying CentOS 7, opt for a minimal installation to reduce unnecessary packages while retaining core functionality and reducing disk space usage.
  • Log in to your virtual server via SSH with the credentials provided by your hosting provider, then run the following commands to set up the environment.
 
I.    Update the OS and reboot to the latest kernel version
 
sudo yum update -y
sudo reboot
uname -a
 
II.   Update dead mirrors for CentOS 7

  • If using the latest CentOS 7 version (7.9.2009), you will need to update the CentOS mirror to the CentOS Vault.
sudo sed -i -e 's|^mirrorlist=|#mirrorlist=|g' -e 's|^#baseurl=http://mirror.centos.org/centos/$releasever|baseurl=http://vault.centos.org/7.9.2009|g' /etc/yum.repos.d/CentOS-Base.repo
 
III.   Install Linux EPEL Repository
 
sudo yum install epel-release -y
yum clean all && yum update -y
 
IV.   Install default development tool packages
 
sudo yum groupinstall "Development Tools" "Performance Tools" -y
 
V.   Install standalone packages for development baseline
 
curl -O http://files.thirdhosting.com/public/packages.install
sudo yum install -y $(cat packages.install)
 
VI.   Install default SCLO software packages
sudo yum install centos-release-scl centos-release-scl-rh -y 
sudo sed -i -e 's|^mirrorlist=|#mirrorlist=|g' -e 's|# baseurl=http://mirror.centos.org/centos/7/sclo/$basearch/sclo/|baseurl=https://vault.centos.org/7.9.2009/sclo/$basearch/sclo/|g' /etc/yum.repos.d/CentOS-SCLo-scl.repo 
sudo sed -i -e 's|^mirrorlist=|#mirrorlist=|g' -e 's|#baseurl=http://mirror.centos.org/centos/7/sclo/$basearch/rh/|baseurl=https://vault.centos.org/7.9.2009/sclo/$basearch/rh/|g' /etc/yum.repos.d/CentOS-SCLo-scl-rh.repo 
sudo yum install devtoolset-7 -y 
sudo yum install devtoolset-8 -y 
sudo yum install devtoolset-9 -y 
sudo yum install devtoolset-10 -y
 
VII.   Install Third Generation Legacy Compilers
 
sudo su
mkdir -p /root/tmp
cd /root/tmp
curl -o /root/tmp/legacy-compilers.tar.gz http://files.thirdhosting.com/public/legacy-compilers.tar.gz tar -zxf legacy-compilers.tar.gz && cd compilers64 && ./install.sh && ./install34.sh && ./install_defaultgcc.sh && ./install_mysql32.sh && ./install_scl.sh
 
Verification and Testing
 
Confirm that all installed compilers and libraries are functional
 
I.    Verify compiler version commands
 
gcc --version
gcc32 --version
gcc34 --version
gcc41 --version
gcc44 --version
 
II.   Verify Alternative SCLO Compilers
 
scl --list
scl enable devtoolset-7 bash
gcc --version
exit
 
Once your environment is set up, transfer your MU* project’s source code to your new VPS using SSH, SCP, or another file transfer tool. After the files are in place, recompile the code to confirm compatibility, making adjustments to your makefile if a different compiler version is required. Test network connectivity to ensure the MUD is accessible. From there, begin migrating your project using the backup and restore processes outlined in our companion KB article: Exporting a Backup of Your Account from cPanel.
 
MariaDB Database Server Install and Migration
 
The following instructions demonstrate how to set up a legacy MariaDB Database Server (MySQL), create a database account, and export and import your databases.
 
I.   Install MariaDB
 
sudo yum install mariadb-server mariadb -y
sudo systemctl enable mariadb
sudo systemctl start mariadb
sudo systemctl status mariadb
II.   Configure MariaDB
 
sudo mysql_secure_installation
>> Hit Enter for Blank Password
>> Change the root password: Y
>> Enter a new root password for mariadb management
>> Confirm the new root password
>> Remote anonymous users: Y
>> Disallow root login remotely: Y
>> Remove test database: Y
>> Reload privilege tables now: Y
III.   Create a database user
 
  • When creating a user, you'll typically want to retain the 'localhost' address here unless you want remote connectivity enabled.
mysql -u root -p
>> Enter the new root password

CREATE DATABASE database_name;
CREATE USER 'new_username'@'localhost' IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON database_name.* TO 'new_username'@'localhost';
FLUSH PRIVILEGES;
EXIT
IV.   Verify the new database
 
mysql -u new_username -p
>> Enter the new_username password

>> SHOW DATABASES;
>> USE database_name;
>> SHOW TABLES;
>> EXIT
V.   Exporting a database
 
  • Login to your Third Generation Shell Account and run the following command to export your existing database
mysqldump -u db_user -p database_name > database_name.sql
VI.   Importing a database
 
  • Transfer the database_name.sql file to your new server and import it with the following command
mysql -u db_user -p database_name < database_name.sql

Nginx Web Server Install
 
The following instructions demonstrate how to set up a simple Nginx web server with a custom version of PHP
 
I.   Install Nginx Web Server
 
sudo yum install nginx -y
II.   Install Nginx Web Server
 
  • Create a new Nginx default configuration by copy/pasting the data below
  • Change the "server_name" variable to your server's IP address or your domain name
  • It is recommended to use your domain name if you intend to configure HTTPS later
sudo nano /etc/nginx/conf.d/default.conf

server { listen 80; server_name CHANGE-TO-DOMAIN-NAME-OR-IP; root /usr/share/nginx/html; index index.php index.html index.htm; location / { try_files $uri $uri/ =404; } error_page 404 /404.html; error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } location ~ \.php$ { try_files $uri =404; fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } }
III.   Start the Nginx Web Server 
sudo systemctl enable nginx
sudo systemctl start nginx
sudo systemctl status nginx
IV.   Install custom PHP Version
V.   List all available PHP Versions

  • The following command will list all available custom PHP versions.
yum --disablerepo="*" --enablerepo="remi-safe" list php[7-9][0-9].x86_64
VI.   Install selected PHP Version
 
  • Pick a php version that is required to support your web context from the previous list 
sudo yum-config-manager --enable remi-php74
sudo yum install php php-mysqlnd php-fpm -y
php --version
VII.   Configuring PHP
 
sudo sed -i 's/user = apache/user = nginx/' /etc/php-fpm.d/www.conf
sudo sed -i 's/group = apache/group = nginx/' /etc/php-fpm.d/www.conf
sudo sed -i 's/listen = 127.0.0.1:9000/listen = \/var\/run\/php-fpm\/php-fpm.sock;/' /etc/php-fpm.d/www.conf
sudo sed -i 's/;listen.owner = nobody/listen.owner = nginx/' /etc/php-fpm.d/www.conf
sudo sed -i 's/;listen.group = nobody/listen.group = nginx/' /etc/php-fpm.d/www.conf
sudo sed -i 's/;listen.mode = 0660/listen.mode = 0660/' /etc/php-fpm.d/www.conf
VIII.   Starting the PHP FPM Process
 
sudo systemctl enable php-fpm
sudo systemctl start php-fpm
sudo systemctl status php-fpm
IX.   Stage PHP verification check
 
  • Create a PHP file in the default web location  
sudo nano /usr/share/nginx/html/index.php

<?php
phpinfo();
?>
 
X.   Verify the Webserver and PHP
 
Installing an SSL Certificate
 
The following instructions demonstrate how to use Certbot to obtain a Let’s Encrypt SSL certificate and automatically configure Nginx to use it.
 
Important Note: Before running Certbot, ensure your domain has the correct DNS records in place. Log in to your domain registrar’s control panel and create the necessary DNS A Records pointing your domain (and any subdomains you wish to secure) to your VPS’s public IP address. Without these records, the certificate request and validation process will fail.
 
I.   Update Nginx Configuration (If Necessary)
 
  • Change the "server_name" attribute to your domain name 
sudo nano /etc/nginx/conf.d/default.conf

>> server_name your-domain-name.com;
II.   Update Nginx Configuration (if necessary)
 
sudo yum install certbot python2-certbot-nginx -y
sudo certbot --nginx -d your-servers-domain-name.com
III.   Verify a successful configuration
 
Migration
 
You should now be able to transfer your files from your Third Generation account to your new VPS.  Start by creating a new user and moving files to the appropriate directories as well as importing any databases.
 
You can update your nginx configuration to point to the user's new home directory.
 
Troubleshooting
 
Third Generation cannot provide direct setup or configuration assistance. This guide is provided as-is to support initial deployment and migration planning.
 
 
  • 0 Los Usuarios han Encontrado Esto Útil
¿Fue útil la respuesta?

Artículos Relacionados

Recommended Web Providers

As we approach the sunset of our operations, we recognize that transitioning to a new hosting...

Recommended MUD Providers

As we prepare to sunset our operations, we understand that migrating to a new hosting provider...

Recommended VPS Providers

For customers who prefer full control over their environment, VPS hosting can provide the...

Recommended Domain Providers

As part of your migration, you may also need to transfer domain registrations. Choosing a...

Exporting a Backup of Your Account from cPanel

To assist in migrating your account to a new provider, you can create a full backup from your...