1.安装httpd服务
[root@bogon yum.repos.d]# dnf install httpd -y
2.安装php
[root@bogon yum.repos.d]# yum install php-* libjpeg* -y
3.安装数据库(客户端以及服务器端)
[root@bogon yum.repos.d]# dnf install mariadb mariadb-server -y
4.启动数据库
[root@bogon yum.repos.d]# systemctl start mariadb //mariadb表示数据库的名称
[root@bogon yum.repos.d]# systemctl enable mariadb //让mariadb数据库开机启动
5.查看网络端口
[root@bogon yum.repos.d]# netstat -lntup | grep 3306 tcp6 0 0 :::3306 :::* LISTEN 8087/mysqld
6.初始化数据库
[root@bogon yum.repos.d]# mysql_secure_installation Enter current password for root (enter for none): //该root为数据库的root,不是Linux里的root Set root password? [Y/n] y New password: Re-enter new password: Password updated successfully! Remove anonymous users? [Y/n] y Disallow root login remotely? [Y/n] y Remove test database and access to it? [Y/n] y Reload privilege tables now? [Y/n] y
7.创建数据库(每条命令后加分号;)
[root@bogon yum.repos.d]# mysql -uroot -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or g. Your MariaDB connection id is 16 Server version: 10.3.17-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)]> show databases; //查看最初的数据表 +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | +--------------------+ 3 rows in set (0.001 sec) MariaDB [(none)]> create database suibian; //创建suibian数据库 Query OK, 1 row affected (0.000 sec) MariaDB [(none)]> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | performance_schema | | suibian | +--------------------+ 4 rows in set (0.000 sec) MariaDB [(none)]> exit //退出数据库
8.配置httpd文档
在99行添加 99 ServerName 0.0.0.0:80
[root@bogon /]# vim /etc/httpd/conf/httpd.conf 98 #ServerName www.example.com:80 99 ServerName 0.0.0.0:80
wq保存退出
9.启动httpd服务
[root@bogon /]# systemctl start httpd
10.查询网络信息
netstat -lntup 查看端口
[root@bogon /]# netstat -lntup | grep httpd tcp6 0 0 :::80 :::* LISTEN 8498/httpd
11.用xftp传输文件
注:文件传输失败可将文件所传目录改为777
12.将该文件移动到/var/www/html下 并解压该文件
[root@bogon file1]# mv /file1/Discuz_X3.4_SC_UTF8_20191201.zip /var/www/html/ [root@bogon html]# rm -rf Discuz_X3.4_SC_UTF8_20191201.zip [root@bogon html]# ll total 96 -rw-r--r--. 1 root root 18451 Jul 3 2019 qqqun.png drwxr-xr-x. 2 root root 102 Dec 1 2019 readme -rw-r--r--. 1 root root 70883 Dec 1 2019 readme.html drwxr-xr-x. 13 root root 4096 Dec 1 2019 upload drwxr-xr-x. 4 root root 94 Dec 1 2019 utility
13.进入upload目录修改其下部分文件权限
[root@bogon upload]# chmod 777 uc_server/ uc_client/ data/ config/ -R
14.关闭SELINUX
[root@bogon ~]# setenforce 0
15.浏览器输入 ip/upload
16.如图设置



