# LNMP环境部署discuz论坛 **Repository Path**: lingding0521/discuz ## Basic Information - **Project Name**: LNMP环境部署discuz论坛 - **Description**: 在lnmp环境部署discuz论坛 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-02-09 - **Last Updated**: 2025-02-10 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # LNMP环境部署discuz论坛 #### 介绍 在lnmp环境部署discuz论坛 #### 软件架构 软件架构说明 L指Linux,N指Nginx,M一般指MySQL,也可以指MariaDB,P一般指PHP,也可以指Perl或Python。 #### 安装教程 1. 安装nginx ``` yum -y install nginx ``` 2. 修改nginx的配置文件并启动,在server下插入 ``` vim /etc/nginx/nginx.conf ``` ``` location / { index index.php index.html index.htm; } ``` ``` systemctl enable nginx systemctl start nginx ``` 3. 在discuz官网下载项目资源 ``` https://foruda.gitee.com/attach_file/1716183924840081332/discuz_x3.5_sc_utf8_20240520.zip?token=525b7f840ce5ebb66241c2cabcfc6e0d&ts=1739154597&attname=Discuz_X3.5_SC_UTF8_20240520.zip ``` 4.下载mysql或mariadb(注意版本是否支持),我这里有mysql包所以就用mysql。下载地址访问国内镜像站下载mysql组件,中国科学技术大学开源软件镜像:http://mirrors.ustc.edu.cn/ ![输入图片说明](%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE%202025-02-10%20102844.png) ``` wget http://mirrors.ustc.edu.cn/mysql-repo/yum/mysql-8.0-community/el/9/x86_64/mysql-community-server-8.0.31-1.el9.x86_64.rpm wget http://mirrors.ustc.edu.cn/mysql-repo/yum/mysql-8.0-community/el/9/x86_64/mysql-community-libs-8.0.31-1.el9.x86_64.rpm wget http://mirrors.ustc.edu.cn/mysql-repo/yum/mysql-8.0-community/el/9/x86_64/mysql-community-icu-data-files-8.0.31-1.el9.x86_64.rpm wget http://mirrors.ustc.edu.cn/mysql-repo/yum/mysql-8.0-community/el/9/x86_64/mysql-community-common-8.0.31-1.el9.x86_64.rpm wget http://mirrors.ustc.edu.cn/mysql-repo/yum/mysql-8.0-community/el/9/x86_64/mysql-community-client-plugins-8.0.31-1.el9.x86_64.rpm wget http://mirrors.ustc.edu.cn/mysql-repo/yum/mysql-8.0-community/el/9/x86_64/mysql-community-client-8.0.31-1.el9.x86_64.rpm ``` 5.启动mysql,更改初始化密码并创建discuz的数据库 ``` systemctl start mysqld systemctl enable mysqld ``` ``` cat /var/log/mysqld.log mysqladmin -uroot -p'wydf,BI=!9Yy' password 'Ling@123' mysql -uroot -p'Ling@123' -e 'create database discuz' ``` 6.下载php所需包并启动 ``` yum -y install epel-release yum -y install php php-cli php-fpm php-mysqlnd php-json php-mbstring php-xml systemctl start php-fpm systemctl enable php-fpm ``` 7.创建php安装测试文件 ``` echo "" >> /usr/share/nginx/html/index.php systemctl restart nginx ``` 8.访问虚拟机ip查看是否安装成功 ![输入图片说明](%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE%202025-02-10%20111517.png) 9.上传项目资源,upload 这个目录下面的所有文件是我们需要上传到服务器上的可用程序文件(仅上传目录里边的文件);readme 目录为产品介绍、授权、安装、升级、转换以及版本更新日志说明(不要上传);readme.html 为安装、升级教程(不要上传);utility.html 为论坛附带工具下载地址,比如升级程序(不要上传)。 ``` yum install -y unzip unzip Discuz_X3.5_SC_UTF8.zip cp -rf upload/* /usr/share/nginx/html/ chmod -R 777 /usr/share/nginx/html ``` 10.访问虚拟机ip地址,完成discuz安装向导 ![输入图片说明](%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE%202025-02-10%20103831.png) ![输入图片说明](%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE%202025-02-10%20104000.png) ![输入图片说明](%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE%202025-02-10%20104042.png) ![输入图片说明](%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE%202025-02-10%20111925.png) 至此discuz论坛安装完成