How to Manually Install Apache, MariaDB, PHP and Discuz Forum on Linux

This guide walks through manually installing Apache, MariaDB, PHP, and the Discuz X2 forum on a Linux system, covering prerequisite checks, mounting installation media, configuring yum repositories, installing and starting services, securing MariaDB, deploying Discuz files, setting permissions, creating the database, and completing the setup wizard.

Liangxu Linux
Liangxu Linux
Liangxu Linux
How to Manually Install Apache, MariaDB, PHP and Discuz Forum on Linux

Prerequisite Check

First verify whether Apache is installed; restart the service if present, or remove any existing installations before proceeding.

Mount Installation Media

Mount the CD/DVD containing the required packages to /mnt (or use mount /dev/sr0 /mnt on RHEL 7) and confirm the files are accessible.

Install Required Packages

Configure a yum repository (e.g., /etc/yum.repos.d/aa.repo) that points to the mounted media, then install the web stack with:

yum -y install http*
yum -y install mysq*
yum -y install php*

Start Services

Restart Apache and start MariaDB using the appropriate commands:

service httpd restart
systemctl restart httpd.service
systemctl start mariadb
systemctl enable mariadb

Configure MariaDB

Secure the database by running mysql_secure_installation, setting a root password, removing anonymous users, disallowing remote root login, deleting the test database, and reloading privilege tables.

Deploy Discuz Forum

Copy the Discuz_X2_SC_UTF8 package to the VM, unzip it on the desktop, then copy the upload directory to /var/www/html. Adjust ownership so Apache can access the files:

chown apache upload html -R

Create Database for Discuz

Log into MariaDB and execute the following commands to create a database and user for Discuz:

show databases;
create database aidata character set utf8;
CREATE USER 'aidata'@'%' IDENTIFIED BY '123456';
GRANT ALL PRIVILEGES ON *.* TO 'aidata'@'%';
FLUSH PRIVILEGES;

Finalize Installation

Open a browser and navigate to the server’s IP (e.g., http://192.168.6.5/upload) to launch the Discuz installation wizard and complete the setup.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

PHPInstallationApacheMariaDBDiscuz
Liangxu Linux
Written by

Liangxu Linux

Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.