1. 程式人生 > 其它 >單機版Discuz網站LAMP架構部署

單機版Discuz網站LAMP架構部署

檢視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