本文主要是介绍RHEL7搭建Discuz论坛,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
RHEL7中配置
- 关闭防火墙和selinux
[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# setenforce 0
- 安装php
[root@localhost ~]# yum install php* -y
- 安装httpd服务
[root@localhost ~]# yum install httpd -y
- 安装数据库
[root@localhost ~]# yum install mariadb -y 这一步可以省略 系统默认有mysql
[root@localhost ~]# rpm -qa | grep mariadb
mariadb-libs-5.5.44-2.el7.x86_64
mariadb-server-5.5.44-2.el7.x86_64
mariadb-5.5.44-2.el7.x86_64
- 启动数据库
[root@localhost ~]# systemctl start mariadb
- 初始化数据库
[root@localhost ~]# mysql_secure_installation
/usr/bin/mysql_secure_installation:行379: find_mysql_client: 未找到命令NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDBSERVERS 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): (这里回车,设置root密码)
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 -uroot -predhat
- 创建数据库
注意命令分号结尾
MariaDB [(none)]> create database luntan;
Query OK, 1 row affected (0.00 sec)
database' at line 1
MariaDB [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| luntan |
| mysql |
| performance_schema |
+--------------------+
4 rows in set (0.00 sec)
MariaDB [(none)]> exit
Bye
- 重启两个服务
[root@localhost ~]# systemctl restart mariadb
[root@localhost ~]# systemctl restart httpd
- 复制并解压论坛源码
[root@localhost test]# cp /test/Discuz_X3.2_SC_UTF8.zip /var/www/html/
[root@localhost test]# cd /var/www/html/
[root@localhost test]# unzip Discuz_X3.2_SC_UTF8.zip
[root@localhost html]# ll
总用量 12204
-rw-r--r--. 1 root root 12486773 12月 2 20:35 Discuz_X3.2_SC_UTF8.zip
drwxr-xr-x. 2 root root 4096 5月 31 2016 readme
drwxr-xr-x. 12 root root 4096 5月 31 2016 upload
drwxr-xr-x. 4 root root 68 5月 31 2016 utility
- 配置论坛数据目录
[root@localhost html]# cd upload/
[root@localhost upload]# ll
总用量 92
-rw-r--r--. 1 root root 2739 5月 31 2016 admin.php
drwxr-xr-x. 11 root root 4096 5月 31 2016 api
-rw-r--r--. 1 root root 727 5月 31 2016 api.php
drwxr-xr-x. 2 root root 22 5月 31 2016 archiver
drwxr-xr-x. 2 root root 87 5月 31 2016 config
-rw-r--r--. 1 root root 922 5月 31 2016 connect.php
-rw-r--r--. 1 root root 253 5月 31 2016 cp.php
-rw-r--r--. 1 root root 106 5月 31 2016 crossdomain.xml
drwxr-xr-x. 13 root root 4096 5月 31 2016 data
-rw-r--r--. 1 root root 5558 5月 31 2016 favicon.ico
-rw-r--r--. 1 root root 2242 5月 31 2016 forum.php
-rw-r--r--. 1 root root 821 5月 31 2016 group.php
-rw-r--r--. 1 root root 1290 5月 31 2016 home.php
-rw-r--r--. 1 root root 5669 5月 31 2016 index.php
drwxr-xr-x. 5 root root 60 5月 31 2016 install
-rw-r--r--. 1 root root 1025 5月 31 2016 member.php
-rw-r--r--. 1 root root 2462 5月 31 2016 misc.php
-rw-r--r--. 1 root root 1757 5月 31 2016 plugin.php
-rw-r--r--. 1 root root 988 5月 31 2016 portal.php
-rw-r--r--. 1 root root 582 5月 31 2016 robots.txt
-rw-r--r--. 1 root root 1161 5月 31 2016 search.php
drwxr-xr-x. 10 root root 4096 5月 31 2016 source
drwxr-xr-x. 6 root root 67 5月 31 2016 static
drwxr-xr-x. 3 root root 36 5月 31 2016 template
drwxr-xr-x. 6 root root 86 5月 31 2016 uc_client
drwxr-xr-x. 13 root root 4096 5月 31 2016 uc_server
-rw-r--r--. 1 root root 1682 5月 31 2016 userapp.php
[root@localhost upload]# chmod 777 config/ data/ uc_* -R
通过页面进行访问并安装
-
论坛安装界面
http://172.16.40.5/upload/ -
我同意
-
下一步
-
选择全新安装,下一步
-
数据库名改为刚刚设置的luntan
数据库密码为刚刚设置的数据库的密码
管理员账号和密码可自行设置
-
安装成功
-
可正常使用论坛
这篇关于RHEL7搭建Discuz论坛的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!