Prepare the LAMP environment
LAMP is the abbreviation of Linux, Apache, MySQL and PHP. It is the basic operating environment on which the Discuz forum system depends. Let's prepare the LAMP environment first:
Install Apache2
ubuntu needs to install Apache2, use apt-get to install Apache2:
sudo apt-get install apache2 -y
After installation, you can view the apache interface by visiting the laboratory IP address http://123.207.9.240, indicating that apache2 is successfully installed.
Install PHP components
There is php7.0 in apt-get, so we can install php7.0 directly:
sudo apt-get install php7.0 -y
Install php related components:
sudo apt-get install libapache2-mod-php7.0
Restart the Apache service:
sudo /etc/init.d/apache2 restart
Install PHP components
There is php7.0 in apt-get, so we can install php7.0 directly:
sudo apt-get install php7.0 -y
Install php related components:
sudo apt-get install libapache2-mod-php7.0
Restart the Apache service:
sudo /etc/init.d/apache2 restart
Install PHP components
There is php7.0 in apt-get, so we can install php7.0 directly:
sudo apt-get install php7.0 -y
Install php related components:
sudo apt-get install libapache2-mod-php7.0
Restart the Apache service:
sudo /etc/init.d/apache2 restart
Install MySQL service
Install the MySQL service. During the MySQL installation, the console will prompt you to enter the MySQL password. You need to enter the password twice and remember the password you entered, which will be used in subsequent installation steps.
sudo apt-get install mysql-server -y
Note that the password needs to be entered twice
Install php MySQL related components:
sudo apt-get install php7.0-mysql
Restart MySQL service
sudo service mysql restart
Install phpmyadmin
Use apt-get to install phpmyadmin. During the installation process, you need to select apache2 as prompted, and then enter the database name and phpmyadmin password as prompted.
sudo apt-get install phpmyadmin -y
Follow the prompts
Set the database name and phpmyadmin password
Install and configure Discuz
Install Discuz
We need to download a Discuz compressed package:
wget 'http://download.comsenz.com/DiscuzX/3.3/Discuz_X3.3_SC_UTF8.zip'
In order to unzip the compressed package, you need to install an unzip:
sudo apt-get install unzip
After the download is complete, unzip the compressed package
sudo unzip Discuz_X3.3_SC_UTF8.zip
After unzipping, you can see the source code of discuz in the upload folder
Configure Discuz
Since PHP accesses the /var/www/html/ folder by default, we need to copy all the files in the upload folder to the /var/www/html/ folder
sudo mv upload/* /var/www/html/
Change the directory to the folder accessed by php,
cd /var/www/html/
Modify the directory permissions of config, data, uc_server/data/, uc_client/data/cache:
sudo chmod -R 777 config/ data/ uc_server/data/ uc_client/data/cache/
Specify apache to index.html
sudo mv /var/www/html/index.html /var/www/html/index~.html
Restart the Apache service:
sudo /etc/init.d/apache2 restart
Prepare domain name and certificate
If you don’t have a domain name yet, you can buy one on Tencent Cloud. You can refer to the video below for the process.
https://v.qq.com/x/page/p05077pwelw.html
After the domain name is purchased, the domain name needs to be resolved to the experimental cloud host. The IP of the experimental cloud host is:
123.207.9.240
For domain names purchased on Tencent Cloud, you can add resolution records to the console. For the process, please refer to the following video:
https://v.qq.com/x/page/t0507ps9kxo.html
It takes some time for the domain name settings to take effect after being resolved. Use the ping command to check whether the domain name is valid
,Such as:
ping www.yourdomain.com
If the information returned by the ping command contains the resolved IP address you set, the resolution is successful.
This experiment is taken from the Tencent Cloud Lab and is done manually according to the contents of the lab
Nowadays, some sources may have expiration issues, which can be added in the cloud + Q&A
Recommended Posts