linux-运维进阶-27 Discuz论坛搭建

linux-运维进阶-27 Discuz论坛搭建

LAMP动态网站架构

关闭selinux,重启才能生效!

[root@localhost ~]# vim /etc/selinux/config 
将SELINUX=enforcing那一行改为:
SELINUX=disabled

保存退出,重启虚拟机
[root@localhost ~]# reboot

Discuz下载地址

简体中文GBK
http://download.comsenz.com/DiscuzX/3.2/Discuz_X3.2_SC_GBK.zip
繁体中文 BIG5
http://download.comsenz.com/DiscuzX/3.2/Discuz_X3.2_TC_BIG5.zip
简体 UTF8
http://download.comsenz.com/DiscuzX/3.2/Discuz_X3.2_SC_UTF8.zip
繁体 UTF8
http://download.comsenz.com/DiscuzX/3.2/Discuz_X3.2_TC_UTF8.zip

本次实验用的是简体 UTF8 ,如果是简体中文GBK 的话会出现如下图的乱码,就需要改参数了:

用yum安装lamp架构的web服务器(部署discuz论坛为例)

[root@localhost ~]# yum install wget unzip httpd mariadb mariadb-server php php-mysql -y
[root@localhost ~]# cd /var/www/html/
[root@localhost html]# wget http://download.comsenz.com/DiscuzX/3.2/Discuz_X3.2_SC_UTF8.zip
[root@localhost ~]# 
[root@localhost html]# unzip Discuz_X3.2_SC_UTF8.zip 
[root@localhost html]# ls
Discuz_X3.2_SC_UTF8.zip  readme  upload  utility
[root@localhost html]# chown -R apache:apache *
[root@localhost html]# chmod 755 -R *
[root@localhost html]# cd
[root@localhost ~]# 
[root@localhost ~]# systemctl restart httpd mariadb
[root@localhost ~]# systemctl enable httpd mariadb
[root@localhost ~]# firewall-cmd --add-port={80,3306}/tcp --permanent
[root@localhost ~]# firewall-cmd --reload
success
[root@localhost ~]# 

初始化数据库

  • 设置root管理员在数据库中的密码值(注意,该密码并非root管理员在系统中的密码,这里的密码值默认应该为空,可直接按回车键)。
  • 设置root管理员在数据库中的专有密码。
  • 随后删除匿名账户,并使用root管理员从远程登录数据库,以确保数据库上运行的业务的安全性。
  • 删除默认的测试数据库,取消测试数据库的一系列访问权限。
  • 刷新授权列表,让初始化的设定立即生效。
[root@localhost ~]# mysql_secure_installation

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] y
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] y
 ... Success!

Normally, 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] y
 ... 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] y
 - 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] y
 ... 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@localhost ~]# mysql -u root -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 10
Server version: 5.5.60-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)]> exit
Bye
[root@localhost ~]# 
[root@localhost ~]# systemctl restart mariadb.service 
[root@localhost ~]# 

浏览器打开discuz服务器的ip加上/upload/forum.php,例如http://192.168.141.132/upload/forum.php,回车后自动跳转到安装界面http://192.168.141.132/upload/install/,如下图:

数据库密码就是刚刚我们登录mysql的root密码,这里你再想一个discuz论坛管理员的密码填进去即可:

用你刚刚设置的管理员密码登录,管理员指的是admin

登录成功后,你就可以随心所欲地设置你论坛的主题了,自己多玩玩就熟悉了。

本篇到此结束。

猜你喜欢

转载自blog.csdn.net/weixin_42560249/article/details/88797457
今日推荐