查看LAMP環(huán)境,需要的軟件包
# rpm -qa |grep mysql
# rpm -qa |grep php
# rpm -qa |grep httpd
1、安裝apache:
# yum install -y httpd
# vim /etc/httpd/conf/httpd.conf
96 #下面這行的意思是允許所有計(jì)算機(jī)通過(guò)ip地址訪問(wèn)本地80端 97 ServerName localhost:80 98 ServerName www.lamp.com:80 165 <IfModule dir_module> 166 DirectoryIndex index.html index.php 167 </IfModule>
重啟apache
# systemctl start httpd
# systemctl enable httpd
查看apache端口
# netstat -antp |grep httpd
查看apache版本
# httpd -v
2、安裝mysql
# wget https://repo.mysql.com/mysql80-community-release-el7-5.noarch.rpm
# rpm -ivh mysql-community-release-el7-5.noarch.rpm
# yum install -y mysql-community-server
啟動(dòng)mysql
# systemctl restart mysqld
# systemctl enable mysqld
設(shè)置mysql的root密碼
# mysql_secure_installation
# mysql -uroot -pcentos
3、安裝php
# yum install -y php
# systemctl restart httpd
# ll /var/www/html/
4、安裝discuz項(xiàng)目
下載discuz網(wǎng)站:https://gitee.com/ComsenzDiscuz/DiscuzX
# unzip discuz.zip
# cd discuz/
# mv * /var/www/html/
# chmod -R a+w /var/www/html/
# yum -y install php-mysqli
# systemctl restart httpd
本文摘自 :https://www.cnblogs.com/