论坛搭建--项目

项目过程

1.关闭防火墙的开机自动启动

[root@localhost ~]# systemctl disable firewalld.service --now
Removed "/etc/systemd/system/multi-user.target.wants/firewalld.service".
Removed "/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service".

2.关闭selinux(临时)

[root@localhost ~]# setenforce 0

3.测试网络是否正常流通

[root@localhost ~]# ping www.baidu.com
PING www.a.shifen.com (183.2.172.17) 56(84) bytes of data.
64 bytes from 183.2.172.17 (183.2.172.17): icmp_seq=1 ttl=128 time=73.6 ms
64 bytes from 183.2.172.17 (183.2.172.17): icmp_seq=2 ttl=128 time=54.1 ms
64 bytes from 183.2.172.17 (183.2.172.17): icmp_seq=3 ttl=128 time=56.1 ms
64 bytes from 183.2.172.17 (183.2.172.17): icmp_seq=4 ttl=128 time=136 ms
64 bytes from 183.2.172.17 (183.2.172.17): icmp_seq=5 ttl=128 time=114 ms
^C
--- www.a.shifen.com ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4007ms
rtt min/avg/max/mdev = 54.094/86.917/136.492/32.896 ms

4.新建本地yum源配置文件

[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# ls
CentOS-9-Stream.repo  redhat.repo
[root@localhost yum.repos.d]# vim dvd.repo

5.将本地光盘挂载至本地目录/media下

[root@localhost ~]# mount /dev/sr1 /media
mount: /media: WARNING: source write-protected, mounted read-only.
[root@localhost ~]# cd /media/
[root@localhost media]# ls
AppStream  EFI   extra_files.json  images    media.repo               RPM-GPG-KEY-redhat-release
BaseOS     EULA  GPL               isolinux  RPM-GPG-KEY-redhat-beta
[root@localhost media]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# ls
CentOS-9-Stream.repo  dvd.repo  redhat.repo
[root@localhost yum.repos.d]# mv redhat.repo redhat.repo.back
[root@localhost yum.repos.d]# ls
CentOS-9-Stream.repo  dvd.repo  redhat.repo.back

6.重建缓存

[root@localhost yum.repos.d]# yum makecache 
Updating Subscription Management repositories.
Unable to read consumer identity

This system is not registered with an entitlement server. You can use subscription-manager to register.

CentOS-9-stream - Base - mirrors.aliyun.com                             13 kB/s | 3.9 kB     00:00    
CentOS-9-stream - AppStream - mirrors.aliyun.com                        19 kB/s | 4.4 kB     00:00    
BaseOS                                                                 0.0  B/s |   0  B     00:00    
Errors during downloading metadata for repository 'BaseOS':
  - Curl error (37): Couldn't read a file:// file for file:///media/BaseOS/repodata/repomd.xml [Couldn't open file /media/BaseOS/repodata/repomd.xml]
Error: Failed to download metadata for repo 'BaseOS': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
[root@localhost yum.repos.d]# yum re
remove      repolist    resolvedep  
[root@localhost yum.repos.d]# yum repolist 
Updating Subscription Management repositories.
Unable to read consumer identity

This system is not registered with an entitlement server. You can use subscription-manager to register.

repo id                         repo name
AppStream                       CentOS-9-stream - AppStream - mirrors.aliyun.com
Appstream                       Appstream
BaseOS                          BaseOS
base                            CentOS-9-stream - Base - mirrors.aliyun.com

7.安装nginx、mariadb-server、php软件

[root@yuanandzhen ~]# yum  install nginx  mariadb-server php -y
[root@yuanandzhen ~]# yum install  php-mysqlnd  -y

8.开启并运行服务

[root@localhost ~]# systemctl start nginx
[root@localhost ~]# systemctl enable nginx
[root@localhost ~]# systemctl enable --now mariadb

9.从xftp将压缩包传到/root文件中然后解压缩

[root@localhost ~]# unzip  /root/Discuz_X3.5_SC_UTF8_20250205.zip -d /usr/share/nginx/html/

10.设置权限

[root@localhost ~]# chmod -R  777   /usr/share/nginx/html/upload/{config,data,uc*}

11.初始化数据库然后成功登录进去并创建一个id为rhcsa的数据库

[root@localhost ~]# mysql_secure_installation
[root@localhost ~]# mysql -u root -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 23
Server version: 10.5.27-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 rhcsa
    -> ;
Query OK, 1 row affected (0.001 sec)

MariaDB [(none)]> quit
Bye

12.在Windows系统的浏览器中输入Linux的主机名/upload

弹出如下页面

 继续操作

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值