使用rpm包安装lamp,并发布discuz论坛
安装步骤
(1)还原初始快照,测试ping通外网,关闭防火墙和selinux
~]# ping baidu.com
PING baidu.com (220.181.38.148) 56(84) bytes of data.
64 bytes from 220.181.38.148 (220.181.38.148): icmp_seq=1 ttl=128
time=239 ms
64 bytes from 220.181.38.148 (220.181.38.148): icmp_seq=2
ttl=128 time=31.7 ms
^C
--- baidu.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1002ms
rtt min/avg/max/mdev = 31.748/135.651/239.555/103.904 ms
~]# systemctl stop firewalld
~]# setenforce 0
(2)使用yum安装httpd mariadb php
~]# yum -y install httpd mariadb-server mariadb php php-mysql
(3)启动httpd、mariadb
~]# systemctl start httpd
~]# systemctl start mariadb
(4)无密登录mariadb,为提高安全性,设置密码
~]# mysql \\无密root登录
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 2
Server version: 5.5.65-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)]>
~]# mysql_secure_installation \\修改root密码
(5)使用新密码登录Mariadb,并为网站创建数据库和管理用户
~]# mysql -uroot -pasd123
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 12
Server version: 5.5.65-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 bbs;
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> grant all on bbs.* to runbbs@localhost identified by 'asd123';
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> exit
Bye
(6)测试php是否安装成功
~]# cd /var/www/html
~]# vim info.php
<?php
phpinfo();
?>
测试访问:
http://192.168.229.134/info.php
(7)discuz代码包移动到/usr/src解压
src]# unzip Discuz_X3.3_SC_UTF8.zip
src]# ls
debug Discuz_X3.3_SC_UTF8.zip kernels readme upload utility
(8)移动解压后的upload到网站根目录下
src]# mv upload/ /var/www/html/bbs
(9)设置bbs目录权限
src]# chmod -R 777 /var/www/html/bbs
(10)安装discuz论坛
http://192.168.229.134/bbs
注意:安装过程,除了数据库的名:bbs和数据库用户名:runbbs、密码,其他一概下一步。
(11)访问论坛后台
http://192.168.1.102/bbs/admin.php