Installing MediaCMS on Debian Latest

MediaCMS is an open-source and free content management system for managing and showcasing media content like videos, images, and audio files. In this tutorial, we will provide step-by-step instructions to install MediaCMS on Debian Latest.

Prerequisites

Before starting the installation, make sure that you have the following:

  1. A running Debian Latest server
  2. A sudo user with root privileges

Step 1: Update the System

The first step is to update the system packages to their latest versions. To update the system, run the following command:

sudo apt-get update && sudo apt-get upgrade -y

Step 2: Install Apache Web Server

MediaCMS requires a webserver to run, and Apache is an excellent choice for hosting PHP-based web applications. To install Apache, execute the following command:

sudo apt-get install apache2 -y

Once Apache is installed, start the Apache service and enable it at boot time by running the following commands:

sudo systemctl start apache2
sudo systemctl enable apache2

Step 3: Install MySQL Database Server

MediaCMS stores all its data in a MySQL database, and we need to install MySQL database server to be able to use MediaCMS. To install MySQL, run the following command:

sudo apt-get install mysql-server -y

After the installation, start the MySQL service and enable it at boot time:

sudo systemctl start mysql
sudo systemctl enable mysql

Step 4: Install PHP and Required PHP Extensions

MediaCMS is a PHP-based web application, so we need to install PHP and the required PHP extensions. To install PHP and the necessary PHP extensions, run the following command:

sudo apt-get install php libapache2-mod-php php-mysql php-curl php-gd php-mbstring php-xml php-xmlrpc php-zip -y

Step 5: Download and Install MediaCMS

Now that we have Apache, MySQL, and PHP installed, we can download and install MediaCMS.

Download MediaCMS

To download MediaCMS, we will use the wget command to download the latest release of MediaCMS:

cd /var/www/html/
sudo wget https://github.com/mediacms-io/mediacms/releases/latest/download/mediacms.zip

Install MediaCMS

After we have downloaded the MediaCMS archive, we need to extract its contents to the document root directory of Apache:

sudo apt-get install unzip -y
sudo unzip mediacms.zip -d /var/www/html/

Before proceeding to the next step, make sure that the ownership of the MediaCMS files is set to the www-data user and group:

sudo chown -R www-data:www-data /var/www/html/mediacms

Step 6: Create a MySQL Database for MediaCMS

Next, we will create a MySQL database for MediaCMS to store its data. To create a new MySQL database, follow these steps:

  1. Log in to MySQL as the root user:
sudo mysql -u root -p
  1. Create a new MySQL database:
CREATE DATABASE mediacms;
  1. Create a new MySQL user:
CREATE USER 'mediacmsuser'@'localhost' IDENTIFIED BY 'password';

Replace password with your desired password.

  1. Grant all privileges to the MySQL user on the mediacms database:
GRANT ALL PRIVILEGES ON mediacms.* TO 'mediacmsuser'@'localhost';
  1. Flush the privileges and exit MySQL:
FLUSH PRIVILEGES;
EXIT;

Step 7: Configure MediaCMS

After we have downloaded and installed MediaCMS, we need to configure it to use the MySQL database we created in the previous step.

  1. Rename the env.example file to .env:
sudo mv /var/www/html/mediacms/env.example /var/www/html/mediacms/.env
  1. Edit the .env file and update the following settings:
APP_URL=http://your-server-ip-or-domain
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=mediacms
DB_USERNAME=mediacmsuser
DB_PASSWORD=password

Replace your-server-ip-or-domain with your actual IP address or domain name.

Step 8: Enable Apache Rewrite Module

MediaCMS uses .htaccess files to enable URL rewriting and SEO-friendly URLs. We need to enable the Apache rewrite module to use it. To enable the rewrite module, run the following command:

sudo a2enmod rewrite

Next, restart the Apache service:

sudo systemctl restart apache2

Step 9: Access MediaCMS

At this point, we have configured MediaCMS, and it is ready to use. Open your web browser and enter the following URL:

http://your-server-ip-or-domain/mediacms/public/

Replace your-server-ip-or-domain with your actual IP address or domain name.

MediaCMS should now be accessible from your web browser.

Conclusion

In this tutorial, we have shown you how to install MediaCMS on Debian Latest. MediaCMS is a powerful and easy-to-use content management system, and we hope that this tutorial has provided you with a helpful guide to installing and setting up MediaCMS on your Debian Latest server.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!