LAMP environment build Discuz forum
- LAMP environment build Discuz forum
-
- LAMP environment deployment
- 1. Deployment system
- 2. Software package needed by lamp
- Third, turn off the firewall and SELINUX before deploying the environment
- Fourth, Apache installation
- Five, Mysql installation
- Six, php installation
- Seven, test whether the lamp environment is available
- Eight, Discuz Forum deployment
- Nine, install discuz forum
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
2. Modify the http configuration file
vim /etc/httpd/conf/httpd.conf
Add port 80 to the configuration file
Restart the fttpd service
systemctl restart httpd
3. Enter the ip address in the browser url to see if the access is successful
Apache 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
3. Install mysql
yum install -y mysql-community-server
4. Start mysql and check if port 3306 is open
systemctl restart mysql-service
netstat -ntlp
5. Initialize the database
mysql_secure_installation
Other options depend on your own situation
6, connect to the database
mysql -uroot -p
Six, php installation
1. Install php and restart httpd service
yum install php -y
systemctl restart httpd
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
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
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
Unzip to the current directory
unzip discuz.zip
Move all files in the discuz directory to the /var/www/html directory
Nine, install discuz forum
1. Use the server IP address to access the forum.
As shown in the figure, the system prompts that many files do not have write permissions. Set the directory to add permissions. The
above is the lack of php-mysql extensions. Install and restart the httpd service.
yum -y install php-mysqli
systemctl restart httpd
2. Set the operating environment
3. Install the database
4. Visit the forum homepage
This forum has been successfully installed everywhere.