查看LAMP环境,需要的软件包
# 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 #下面这行的意思是允许所有计算机通过ip地址访问本地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
启动mysql
# systemctl restart mysqld
# systemctl enable mysqld
设置mysql的root密码
# mysql_secure_installation
# mysql -uroot -pcentos
3、安装php
# yum install -y php
# systemctl restart httpd
# ll /var/www/html/
4、安装discuz项目
下载discuz网站: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/