Tencent Cloud provides [Developer Lab] (https://cloud.tencent.com/developer/labs/lab/10030?from=10680) to help users build Discuz forums. The content of the tutorial is as follows. Users can click [Developer Lab] (https://cloud.tencent.com/developer/labs/lab/10030?from=10680) to quickly get on the computer to complete the experiment.
experiment screenshot
Task time: 15min ~ 30min
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
Use yum
to install MySQL:
yum install mysql-server -y
After the installation is complete, start the MySQL service:
service mysqld restart
This experiment uses the mysql default account name and password. You can also set your own MySQL account name and password: [?], refer to the following:
/usr/bin/mysqladmin -u root password 'Password'
Set MySQL to start automatically at boot:
chkconfig mysqld on
The password in the following command is automatically generated by the tutorial for you. In order to facilitate the experiment, it is not recommended to use other passwords. If you set another password, please remember the password, you will use it in the next steps.
Use yum
to install Apache components:
yum install httpd -y
After installation, start the httpd process:
service httpd start
Set httpd to start automatically after booting:
chkconfig httpd on
Use yum
to install PHP:
yum install php php-fpm php-mysql -y
After installation, start the PHP-FPM process:
service php-fpm start
After startup, you can use the following command to see which port the PHP-FPM process is listening on
netstat -nlpt | grep php-fpm
Set PHP-FPM to start automatically after booting:
chkconfig php-fpm on
CentOS 6 has already installed PHP-FPM and PHP-MYSQL by default, and the following commands may prompt that they have been installed.
PHP-FPM listens on port 9000 by default
Task time: 15min ~ 30min
CentOS 6 does not have Discuz's yum
source, so we need to download a Discuz compressed package:
wget http://download.comsenz.com/DiscuzX/3.2/Discuz_X3.2_SC_UTF8.zip
After the download is complete, unzip the compressed package
unzip Discuz_X3.2_SC_UTF8.zip
After unzipping, you can see the source code of discuz in the upload folder
Go to Discuz official website to find an installation package and copy the installation package download path, here we use Discuz_X3.2_SC_UTF8.zip
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
cp -r upload/* /var/www/html/
Grant permissions to the /var/www/html directory and its subdirectories
chmod -R 777/var/www/html
Restart Apache
service httpd restart
Task time: 15min ~ 30min
If you don’t have a domain name yet, you can Buy on Tencent Cloud. For the process, please refer to the video below.
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:
< Your CVM IP address>
For the domain name purchased in Tencent Cloud, you can [add resolution record to the console] (https://console.qcloud.com/domain), and the process can refer to the following video:
It takes some time for the domain name setting to take effect after resolution. Use the ping
command to check whether the domain name is effective, 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.
Pay attention to replace
www.yourmpdomain.com
in the following command as your own registered domain name
Recommended Posts