实战LAMP架构+Discuz搭建bbs论坛

本文涉及的产品
RDS MySQL Serverless 基础系列,0.5-2RCU 50GB
云数据库 RDS MySQL,高可用系列 2核4GB
云数据库 RDS PostgreSQL,高可用系列 2核4GB
简介:

LAMP架构:Lnux+Apache+Mysql+Php

实验环境:RHEL7.0 server1.example.com 172.25.254.6

实验内容:1.Linux环境配置

                    2.Apache环境

                    3.php环境

                    4.Mysql环境

                    5.论坛搭建测试

论坛安装包:Discuz_X3.2_SC_UTF8.zip


    1.Linux环境

[root@server1 ~]# systemctl stop firewalld     ###关火墙

[root@server1 ~]# getenforce      ###关selinux

Disabled


    2.Apache环境

[root@server1 ~]# yum install httpd

[root@server1 ~]# systemctl start httpd

[root@server1 ~]# systemctl enable httpd

ln -s '/usr/lib/systemd/system/httpd.service' '/etc/systemd/system/multi-user.target.wants/httpd.service'

[root@server1 ~]# cd /var/www/html/

[root@server1 html]# ls                      ###将安装包放置在此处

Discuz_X3.2_SC_UTF8.zip  index.html

[root@server1 html]# unzip Discuz_X3.2_SC_UTF8.zip   ###解压

[root@server1 html]# mv upload/ bbs   ###重命名

[root@server1 bbs]# vim /etc/httpd/conf/httpd.conf  

          <IfModule dir_module>

          DirectoryIndex index.php index.html

          </IfModule>

[root@server1 bbs]# systemctl restart httpd


    3.php环境

[root@server1 bbs]# yum install php php-mysql -y

[root@server1 bbs]# pwd

/var/www/html/bbs

[root@server1 bbs]# cd config/

[root@server1 config]# cp -p config_ucenter_default.php config_ucenter.php 

[root@server1 config]# cp -p config_global_default.php config_global.php 

[root@server1 config]# chmod 777 -R  /var/www/html/bbs/


    4.mysql环境

[root@server1 config]# yum install mariadb mariadb-server -y

[root@server1 config]# systemctl start mariadb

[root@server1 config]# systemctl enable mariadb

[root@server1 config]# mysql_secure_installation 

/usr/bin/mysql_secure_installation: line 379: find_mysql_client: command not found

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB

      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current

password for the root user.  If you've just installed MariaDB, and

you haven't set the root password yet, the password will be blank,

so you should just press enter here.

Enter current password for root (enter for none):      ###回车

OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB

root user without the proper authorisation.

Set root password? [Y/n]          ###回车

New password:                 ##输入要设置的数据库密码

Re-enter new password:    ##再次输入密码

Password updated successfully!

Reloading privilege tables..

 ... Success!

By default, a MariaDB installation has an anonymous user, allowing anyone

to log into MariaDB without having to have a user account created for

them.  This is intended only for testing, and to make the installation

go a bit smoother.  You should remove them before moving into a

production environment

Remove anonymous users? [Y/n]    ###回车

 ... Success!

ormally, root should only be allowed to connect from 'localhost'.  This

ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n]      ##回车

 ... Success!

By default, MariaDB comes with a database named 'test' that anyone can

access.  This is also intended only for testing, and should be removed

before moving into a production environment.

Remove test database and access to it? [Y/n]     ###回车

 - Dropping test database...

 ... Success!

 - Removing privileges on test database...

 ... Success!

Reloading the privilege tables will ensure that all changes made so far

will take effect immediately.

Reload privilege tables now? [Y/n]     ###回车

 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB

installation should now be secure.

Thanks for using MariaDB!

[root@server1 config]# systemctl restart mariadb.service 

[root@server1 config]# mysql -uroot -p

Enter password: 

MariaDB [(none)]>  CREATE DATABASE discuz;         #新建数据库

Query OK, 1 row affected (0.00 sec) 


MariaDB [(none)]>  CREATE USER willis@localhost identified by 'willis';   #新建用户

Query OK, 0 rows affected (0.00 sec)


MariaDB [(none)]>  GRANT ALL on discuz.* to willis@localhost;      #用户授权  

Query OK, 0 rows affected (0.00 sec)


MariaDB [(none)]> quit

Bye

[root@server1 config]# mysql -uwillis -pwillis    #测试新建的用户

MariaDB [(none)]> quit

Bye

[root@server1 config]# systemctl restart httpd.service 

[root@server1 config]# systemctl restart mariadb.service 

      

LAMP论坛搭建环境完成


    5. 安装测试:

wKiom1fU1x_QrbLPAAIpkIhWdvg769.png


wKioL1fU1x7QJIH_AAENl3BOg8w779.png


wKiom1fU1x3Auo6sAACuBlzIQBs987.png



wKioL1fU1xyy_PM1AAD7X0cTDsw427.png

 wKiom1fU1xuhGlvRAAAR0pJMYro903.png



 好了,安装完成,来看看什么样子吧。

wKiom1fU1xvjSEWzAAE7ITyYv_M734.png


本文转自willis_sun 51CTO博客,原文链接:http://blog.51cto.com/willis/1851595,如需转载请自行联系原作者

相关实践学习
每个IT人都想学的“Web应用上云经典架构”实战
本实验从Web应用上云这个最基本的、最普遍的需求出发,帮助IT从业者们通过“阿里云Web应用上云解决方案”,了解一个企业级Web应用上云的常见架构,了解如何构建一个高可用、可扩展的企业级应用架构。
MySQL数据库入门学习
本课程通过最流行的开源数据库MySQL带你了解数据库的世界。 &nbsp; 相关的阿里云产品:云数据库RDS MySQL 版 阿里云关系型数据库RDS(Relational Database Service)是一种稳定可靠、可弹性伸缩的在线数据库服务,提供容灾、备份、恢复、迁移等方面的全套解决方案,彻底解决数据库运维的烦恼。 了解产品详情:&nbsp;https://www.aliyun.com/product/rds/mysql&nbsp;
相关文章
|
2月前
|
Cloud Native Serverless API
微服务架构实战指南:从单体应用到云原生的蜕变之路
🌟蒋星熠Jaxonic,代码为舟的星际旅人。深耕微服务架构,擅以DDD拆分服务、构建高可用通信与治理体系。分享从单体到云原生的实战经验,探索技术演进的无限可能。
微服务架构实战指南:从单体应用到云原生的蜕变之路
|
2月前
|
监控 Cloud Native Java
Spring Boot 3.x 微服务架构实战指南
🌟蒋星熠Jaxonic,技术宇宙中的星际旅人。深耕Spring Boot 3.x与微服务架构,探索云原生、性能优化与高可用系统设计。以代码为笔,在二进制星河中谱写极客诗篇。关注我,共赴技术星辰大海!(238字)
Spring Boot 3.x 微服务架构实战指南
|
3月前
|
消息中间件 数据采集 NoSQL
秒级行情推送系统实战:从触发、采集到入库的端到端架构
本文设计了一套秒级实时行情推送系统,涵盖触发、采集、缓冲、入库与推送五层架构,结合动态代理IP、Kafka/Redis缓冲及WebSocket推送,实现金融数据低延迟、高并发处理,适用于股票、数字货币等实时行情场景。
302 3
秒级行情推送系统实战:从触发、采集到入库的端到端架构
|
3月前
|
设计模式 人工智能 API
AI智能体开发实战:17种核心架构模式详解与Python代码实现
本文系统解析17种智能体架构设计模式,涵盖多智能体协作、思维树、反思优化与工具调用等核心范式,结合LangChain与LangGraph实现代码工作流,并通过真实案例验证效果,助力构建高效AI系统。
430 7
|
4月前
|
机器学习/深度学习 算法 文件存储
神经架构搜索NAS详解:三种核心算法原理与Python实战代码
神经架构搜索(NAS)正被广泛应用于大模型及语言/视觉模型设计,如LangVision-LoRA-NAS、Jet-Nemotron等。本文回顾NAS核心技术,解析其自动化设计原理,探讨强化学习、进化算法与梯度方法的应用与差异,揭示NAS在大模型时代的潜力与挑战。
893 6
神经架构搜索NAS详解:三种核心算法原理与Python实战代码
|
3月前
|
人工智能 Cloud Native 中间件
划重点|云栖大会「AI 原生应用架构论坛」看点梳理
本场论坛将系统性阐述 AI 原生应用架构的新范式、演进趋势与技术突破,并分享来自真实生产环境下的一线实践经验与思考。
|
3月前
|
JSON 供应链 监控
1688商品详情API技术深度解析:从接口架构到数据融合实战
1688商品详情API(item_get接口)可通过商品ID获取标题、价格、库存、SKU等核心数据,适用于价格监控、供应链管理等场景。支持JSON格式返回,需企业认证。Python示例展示如何调用接口获取商品信息。
|
5月前
|
缓存 Cloud Native Java
Java 面试微服务架构与云原生技术实操内容及核心考点梳理 Java 面试
本内容涵盖Java面试核心技术实操,包括微服务架构(Spring Cloud Alibaba)、响应式编程(WebFlux)、容器化(Docker+K8s)、函数式编程、多级缓存、分库分表、链路追踪(Skywalking)等大厂高频考点,助你系统提升面试能力。
253 0

热门文章

最新文章