LAMP服务器安装配置Discuz论坛

本文介绍了在CentOS 7.2 Minimal环境中配置防火墙、SELinux,安装Git、MariaDB、Apache和PHP,设置数据库,部署Discuz!论坛,进行PHP测试,最终完成论坛安装并管理权限的过程。
摘要由CSDN通过智能技术生成

一、实验环境

操作系统:CentOS7.2 Minimal

IP:192.168.1.105

Discuz!版本:X3.4

二、防火墙、selinux设置

# setenforce 0

# sed -i 's/^SELINUX=.*/SELINUX=permissive/g' /etc/selinux/config

# systemctl stop firewalld

# systemctl disable firewalld

三、软件安装

# yum -y install git

# yum -y install mariadb mariadb-server

# yum -y install httpd

# yum -y install php php-mysql

# yum -y install gd php-gd gd-devel php-xml php-common php-mbstring php-ldap php-pear php-xmlrpc php-imap

# git clone https://gitee.com/ComsenzDiscuz/DiscuzX.git

四、相关服务启动

# systemctl start mariadb httpd

# systemctl enable mariadb httpd

五、数据库设置

# mysql_secure_installation

设置mariadb的root密码:Discuz@123

创建# Discuz库和用户,授权

# mysql -u root -p"Discuz@123"

> create database discuz;

>  grant all on discuz.* to 'discuz'@'localhost' identified by 'Discuz@123';

 > flush privileges;

六、php网页解析和数据库访问测试

# vim /var/www/html/test1.php

#  vim /var/www/html/test2.php

 

测试访问:http://192.168.1.105/test1.php

测试访问:http://192.168.1.105/test2.php

http://www.w3school.com.cn/php/func_mysql_connect.asp

https://dev.mysql.com/doc/apis-php/en/apis-php-function.mysql-connect.html

七、Discuz!论坛代码部署

# cp -rf DiscuzX/upload/ /var/www/html/bbs

# chown -R apache:apache /var/www/html/bbs

# systemctl restart httpd

八、Discuz!论坛WEB安装

web访问:http://192.168.1.105/bbs/install/

数据库名: mariadb中创建的数据库discuz

数据库用户名:  mariadb中被授权的用户discuz

数据库密码: mariadb中被授权的用户discuz登录数据库discuz的密码Discuz@123

管理员账号: admin

管理员密码: 自定义后台管理员密码



 

九、安装后目录处理

安装完成后,我们应该将install目录转移,并限制访问权限

# cd /var/www/html/bbs 

# mv install/ install.lock

# chmod 600 install.lock/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值