LAMP builds DISCUZ forum and WordPress blog
Foreword:
Article Directory
What is LAMP
LAMP is an open source software commonly used to build dynamic websites or servers. It refers to the first letter of Linux (operating system), ApacheHTTP server, MySQL (sometimes MariaDB, database software) and PHP (sometimes Perl or Python) , Generally used to establish web application channels. At present, about 70% of visit traffic is provided by LAMP.
What is DISCUZ Forum
Discuz! is one of the world's most mature and largest open source forum website software systems, used by more than 2 million website users. You can build a forum through Discuz!. This document introduces how to build a Discuz! forum on Tencent Cloud Cloud Server and the required LAMP (Linux + Apache + MariaDB + PHP) environment.
What is WordPress blog
Wordpress is a worldwide popular free and open source website building program that provides a large number of themes and rich plug-ins. Wordpress was originally a website building program for blogs, but now many other types of websites are built using it. Data shows that more than 35% of the websites on this blue star are based on wordpress [1]. Whether it’s a personal blog that publishes a blog post, a social information website, or an e-commerce and corporate portal, with the help of wordpress, you can easily build it even if you don’t write code
lab environment:
Server system: centos7
server address: 10.8.161.75
test machine address: 10.8.161.76
virtual local domain name: DISCUZ forum www.luntan.com
WORDPRESS blogwww.boke.com
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1. LAMP installation
[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博客目录
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2. Install DISCUZ Forum
[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 ### 保存退出
Restart the httpd service as shown
[root@localhost conf]# systemctl restart httpd ### 重启httpd服务
So far, the DISCUZ forum server has been built
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3. Install WordPress blog
[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 ### 保存退出
Restart the httpd service as shown
[root@localhost conf]# systemctl restart httpd ### 重启httpd服务
So far, the wordpress blog server is built
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Four. Client access configuration
Take the windos client as an example
. The ip address of the windos client is: 10.8.161.76 (the same LAN as the server)
1. Set the virtual domain name resolution,
you can see that the ip pointed to by the ping domain name is the local server ip address
2. Browser access forum address www.luntan.com
Set forum installation wizard
Confirm the installation
3. Browser access forum address www.boke.com
Set blog installation wizard
+++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++
++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++++
+ ++++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++
So far, LAMP’s local establishment of DISCUZ forum and WordPress blog is over, let’s experience it
================================================= ================================================= ================================================= ================================================= ================================================= =============================================
Hard browsing and watching, if right You are helpful, please like it (σ゚∀゚)σ…:*☆