LAMP本地搭建DISCUZ论坛和WORDPRESS博客

LAMP搭建DISCUZ论坛和WORDPRESS博客

前言:


什么是LAMP

LAMP是常用来建立动态网站或者服务器的开源软件,指的是Linux(操作系统)、ApacheHTTP 服务器,MySQL(有时也指MariaDB,数据库软件) 和PHP(有时也是指Perl或Python) 的第一个字母,一般用来树立web应用渠道。目前,大约70%的拜访流量经过LAMP来供给的。

什么是DISCUZ论坛

Discuz! 是全球成熟度最高、覆盖率最大的开源论坛网站软件系统之一,被200多万网站用户使用。您可通过 Discuz! 搭建论坛,本文档介绍在腾讯云云服务器上搭建 Discuz! 论坛及其所需的 LAMP(Linux + Apache + MariaDB + PHP)环境。

什么是WORDPRESS博客

Wordpress是一款全球流行的免费开源的建站程序,提供了海量的主题和丰富的插件。Wordpress最初是一款面向博客搭建的建站程序,但现在也有很多其他类型的网站都是使用它搭建的。数据显示这个蓝星上超过35%的网站都是基于wordpress的[1]。无论是发布博文的个人博客,还是社交资讯网站,亦或者是电子商务和企业门户,借助wordpress,即便不会写代码,你也可以轻松搭建

实验环境:

服务器系统: centos7
服务器地址:10.8.161.75
测试机地址:10.8.161.76
虚拟本地域名: DISCUZ论坛 www.luntan.com WORDPRESS博客 www.boke.com

在这里插入图片描述
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

一 .LAMP安装

[root@apache ~]# systemctl disable firewalld.service                            # 禁用防火墙
[root@apache ~]# sed -ri '/^SELINUX=/cSELINUX=disabled' /etc/selinux/config     # 关闭selinux

[root@localhost ~]# yum -y install httpd mariadb-server mariadb php php-mysql gd php-gd  
####   安装 ApacheHTTP,mariadb-server(数据库服务,Mysql收购后改名) ,mariadb(数据库依赖) ,PHP 
####   gd (PHP依赖的库)

[root@localhost luntan]# systemctl start httpd mariadb            ### 启动网站和数据库服务程序
[root@localhost luntan]#  systemctl enable httpd mariadb          ### 开机自启网站和服务器程序


[root@localhost html]# mkdir  /var/www/html/{boke,luntan}         ###  创建DISCUZ论坛 和WORDPRESS博客目录 

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

二. 安装DISCUZ论坛

[root@localhost html]#   cd   /var/www/html/luntan/          ### 进入论坛目录

[root@localhost luntan]# wget http://download.comsenz.com/DiscuzX/2.5/Discuz_X2.5_SC_UTF8.zip   ###下载论坛包
[root@localhost luntan]# ls                                  ### 查看下载的包
Discuz_X2.5_SC_UTF8.zip

[root@localhost luntan]# unzip  Discuz_X2.5_SC_UTF8.zip      ### 解压下载的包

[root@localhost luntan]# ls                                  ### 查看
Discuz_X2.5_SC_UTF8.zip  readme  upload  utility             ### 解压出三个包,其中upload包含主页信息

[root@localhost luntan]# chown -R  apache.apache  upload/    ### 给予 upload 路径Apache的权限,保证后面有足够的权限读写。

[root@localhost luntan]# mysql                              ### 打开数据库,配置数据库
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 4
Server version: 5.5.68-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> create database luntan ;                  ### 创建一个论坛的luntan库,待会放论坛的数据,后面的(;)记得带上,表示语句的结束
Query OK, 1 row affected (0.00 sec)


[root@localhost conf]# vim  /etc/httpd/conf/httpd.conf     ### 配置httpd的 虚拟本地域名,方便我们访问
:set number       ### 显示行号
#### 在 105 行后添加这四行

 <VirtualHost  *:80>                              ### 指定80端口
 ServerName   www.luntan.com                      ### 虚拟本地域名
 DocumentRoot   /var/www/html/luntan/upload       ### 指向的主页目录
 </VirtualHost>                                   ### 结束符号
 
:wq              ### 保存退出

如图所示
在这里插入图片描述重启httpd服务

[root@localhost conf]# systemctl restart httpd   ###  重启httpd服务

至此DISCUZ论坛服务端搭建完成

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

三. 安装WORDPRESS博客


[root@localhost ~]# cd /var/www/html/boke                       ### 进入博客目录
[root@localhost boke]# wget http://cn.wordpress.org/wordpress-4.7.2-zh_CN.tar.gz   ### 下载博客包

[root@localhost boke]# ls                                       ### 查看下载的包
wordpress-4.7.2-zh_CN.tar.gz
[root@localhost boke]# tar -zxvf wordpress-4.7.2-zh_CN.tar.gz   ### 解压下载的包
[root@localhost boke]# ls                                       ### 查看

wordpress  wordpress-4.7.2-zh_CN.tar.gz                         ### 多了一个 wordpress ,这里包含博客的主页目录
[root@localhost boke]# chown -R  apache.apache wordpress/       ### 给予这个wordpress Apache权限,方便博客的用户的读写


[root@localhost ~]#  mysql                                      ### 进入数据库,配置博客所用的数据库
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 5
Server version: 5.5.68-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> create database boke ;                       ### 创建boke库 ,记得后面加(;)
Query OK, 1 row affected (0.00 sec)


[root@localhost conf]# vim  /etc/httpd/conf/httpd.conf     ### 配置httpd的 虚拟本地域名,方便我们访问
:set number       ### 显示行号
#### 在 105 行后添加这四行

 <VirtualHost  *:80>                               ### 指定80端口
 ServerName   www.boke.com                         ###虚拟本地域名
 DocumentRoot    /var/www/html/boke/wordpress      ### 指向的主页目录
 </VirtualHost>                                    ### 结束符号
 
:wq              ### 保存退出

如图所示
在这里插入图片描述重启httpd服务

[root@localhost conf]# systemctl restart httpd   ###  重启httpd服务

至此wordpress博客服务端搭建完成

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

四.客户端访问配置

以windos客户端为例
windos的客户端ip地址为:10.8.161.76 (与服务端为同一局域网)

1. 设置虚拟域名解析
在这里插入图片描述在这里插入图片描述可以看到现在ping 域名指向的ip 为本地服务器ip地址

在这里插入图片描述
2. 浏览器访问论坛地址www.luntan.com 设置论坛安装向导

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述在这里插入图片描述

确认安装即可

3. 浏览器访问论坛地址www.boke.com 设置博客安装向导
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

至此LAMP本地搭建DISCUZ论坛和WORDPRESS博客 结束,开始体验吧

======================================================================================================================================================================================================================================================================================================
辛苦浏览观看,如果对你有帮助,请顺手点个赞吧 (σ゚∀゚)σ…:*☆

猜你喜欢

转载自blog.csdn.net/qq_26129413/article/details/110949878