Build Discuz Forum in LAMP Environment

LAMP environment build Discuz forum

LAMP is short for Linux+Apache+Mysql/MariaDB+Perl/PHP/Python. A group of open source software commonly used to build dynamic websites or servers. They are all independent programs themselves, but because they are often used together, they have higher and higher compatibility and together form a powerful Web application platform. . Because each part is free, it is favored by the majority of small and medium-sized websites.

LAMP environment deployment

1. Deployment system

	Centos7阿里云云服务器

2. Software package needed by lamp

	*检测系统是否安装这些软件及卸载*
	安装环境软件之前建议yum源更换为国内的yum源(阿里云,清华等)	
  • apache(http)

  • mysql-server

  • php

	rpm -qa |grep httpd
 	rpm -qa |grep mysql
 	rpm -qa |grep php

Third, turn off the firewall and SELINUX before deploying the environment

	systemctl stop firewalld
	setenforce 0

The cloud server is closed by default. To avoid incorrect local environment setup, it must be closed.

Fourth, Apache installation

1, yum install httpd package

yum install httpd -y

Insert picture description here
2. Modify the http configuration file

vim /etc/httpd/conf/httpd.conf

Add port 80 to the configuration file

Insert picture description here

Restart the fttpd service

systemctl restart httpd

3. Enter the ip address in the browser url to see if the access is successful

This interface shows that the access is successfulApache installed successfully

Five, Mysql installation

Since there is no mysql source on the yum source by default, you must download the mysql source from the official website or add the mysql yum warehouse yourself.

**1,我是自行添加了清华的mysql yum源**


2, reload the yum warehouse cache

yum makecache

Insert picture description here
3. Install mysql

yum install -y mysql-community-server 

Insert picture description here4. Start mysql and check if port 3306 is open

systemctl restart mysql-service
netstat -ntlp

Insert picture description here5. Initialize the database

mysql_secure_installation

Insert picture description hereOther options depend on your own situation
6, connect to the database

mysql -uroot -p

Insert picture description here

Six, php installation

1. Install php and restart httpd service

yum install php -y
systemctl restart httpd

Insert picture description here

Seven, test whether the lamp environment is available

1. Create the file index.php under the httpd service website and the directory /var/www/html

cd /var/www/html
touch index.php
vim index.php

Insert picture description here
2. Restart the httpd service

systemctl restart httpd

3. Enter the ip address of the browser url address. If you can access the following interface, the lamp environment is successfully built
Insert picture description here

Eight, Discuz Forum deployment

1. Download and upload the discuz source code package to the server
2. Unzip the discuz.zip package

Install the unzip command and unzip

yum -y install unzip

Insert picture description here

Unzip to the current directory

unzip discuz.zip

Insert picture description here

Move all files in the discuz directory to the /var/www/html directory

Insert picture description here

Nine, install discuz forum

1. Use the server IP address to access the forum.
Insert picture description hereInsert picture description hereAs shown in the figure, the system prompts that many files do not have write permissions. Set the directory to add permissions. The
Insert picture description hereInsert picture description hereabove is the lack of php-mysql extensions. Install and restart the httpd service.

yum -y install php-mysqli
systemctl restart httpd

Insert picture description here
2. Set the operating environment
Insert picture description here
3. Install the database
Insert picture description here4. Visit the forum homepage

Insert picture description hereInsert picture description hereThis forum has been successfully installed everywhere.

Guess you like

Origin blog.csdn.net/scdn_fm/article/details/107787124