监控设备网站制作工作服厂家联系方式
news/
2025/10/1 13:54:36/
文章来源:
监控设备网站制作,工作服厂家联系方式,大型电商平台有哪些,常见的英文网站目录
1. 更换yum源更新系统软件包#xff1a;
1.1备份yum源
1.1.1创建备份目录#xff1a;
1.1.2移动现有仓库配置文件到备份目录#xff1a;
1.1.3验证备份#xff1a;
1.2更换yum源
1.2.1添加yum源
1.2.2删除和建立yum缓存
1.3更新系统软件包
1.4 yum与dnf介绍…
目录
1. 更换yum源更新系统软件包
1.1备份yum源
1.1.1创建备份目录
1.1.2移动现有仓库配置文件到备份目录
1.1.3验证备份
1.2更换yum源
1.2.1添加yum源
1.2.2删除和建立yum缓存
1.3更新系统软件包
1.4 yum与dnf介绍
2. 安装 Nginx
2.1安装
2.2开启服务
3. 安装 MariaDB
3.1安装
3.2开启服务
4. 安全配置 MariaDB
5. 创建 WordPress 数据库和用户
5.1进入数据
5.2创建数据库
5.3创建用户并赋权
6. 安装 PHP
6.1修改配置文件
6.2启动并启用 PHP-FPM 服务
7. 下载并配置 WordPress
8. 配置 WordPress
8.1复制样本配置文件并编辑
8.2根据需要更新以下内容
9. 配置 Nginx
9.1编辑 Nginx 配置文件
9.2检查 Nginx 配置是否正确
9.3重新加载 Nginx 配置
10. 配置 SELinux 和防火墙
10.1如果启用了 SELinux
10.2配置防火墙允许 HTTP 和 HTTPS 流量
11. 访问 WordPress 安装界面
11.1访问
11.2安装
11.3无法写入wp-config.php
11.4填写配置信息
11.5登录 利用nginx和MariaDB搭建wordpress
1. 更换yum源更新系统软件包
1.1备份yum源
1.1.1创建备份目录
创建一个目录来保存备份的仓库配置文件 sudo mkdir -p /etc/yum.repos.d/backup 1.1.2移动现有仓库配置文件到备份目录
将 /etc/yum.repos.d/ 目录中的所有文件移动到备份目录中 sudo mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/backup/ 1.1.3验证备份
确认备份是否成功可以列出备份目录中的文件 ls /etc/yum.repos.d/backup/ 1.2更换yum源
可以参考CentOS Stream - USTC Mirror Help
1.2.1添加yum源
vim /etc/yum.repos.d/centos.repo [baseos] nameCentOS Stream $releasever - BaseOS baseurlhttps://mirrors.ustc.edu.cn/centos-stream/$releasever-stream/BaseOS/$basearch/os # metalinkhttps://mirrors.centos.org/metalink?repocentos-baseos-$streamarch$basearchprotocolhttps,http gpgkeyfile:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial gpgcheck1 repo_gpgcheck0 metadata_expire6h countme1 enabled1 [baseos-debuginfo] nameCentOS Stream $releasever - BaseOS - Debug baseurlhttps://mirrors.ustc.edu.cn/centos-stream/$releasever-stream/BaseOS/$basearch/debug/tree/ # metalinkhttps://mirrors.centos.org/metalink?repocentos-baseos-debug-$streamarch$basearchprotocolhttps,http gpgkeyfile:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial gpgcheck1 repo_gpgcheck0 metadata_expire6h enabled0 [baseos-source] nameCentOS Stream $releasever - BaseOS - Source baseurlhttps://mirrors.ustc.edu.cn/centos-stream/$releasever-stream/BaseOS/source/tree/ # metalinkhttps://mirrors.centos.org/metalink?repocentos-baseos-source-$streamarchsourceprotocolhttps,http gpgkeyfile:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial gpgcheck1 repo_gpgcheck0 metadata_expire6h enabled0 [appstream] nameCentOS Stream $releasever - AppStream baseurlhttps://mirrors.ustc.edu.cn/centos-stream/$releasever-stream/AppStream/$basearch/os # metalinkhttps://mirrors.centos.org/metalink?repocentos-appstream-$streamarch$basearchprotocolhttps,http gpgkeyfile:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial gpgcheck1 repo_gpgcheck0 metadata_expire6h countme1 enabled1 [appstream-debuginfo] nameCentOS Stream $releasever - AppStream - Debug baseurlhttps://mirrors.ustc.edu.cn/centos-stream/$releasever-stream/AppStream/$basearch/debug/tree/ # metalinkhttps://mirrors.centos.org/metalink?repocentos-appstream-debug-$streamarch$basearchprotocolhttps,http gpgkeyfile:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial gpgcheck1 repo_gpgcheck0 metadata_expire6h enabled0 [appstream-source] nameCentOS Stream $releasever - AppStream - Source baseurlhttps://mirrors.ustc.edu.cn/centos-stream/$releasever-stream/AppStream/source/tree/ # metalinkhttps://mirrors.centos.org/metalink?repocentos-appstream-source-$streamarchsourceprotocolhttps,http gpgkeyfile:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial gpgcheck1 repo_gpgcheck0 metadata_expire6h enabled0 [crb] nameCentOS Stream $releasever - CRB baseurlhttps://mirrors.ustc.edu.cn/centos-stream/$releasever-stream/CRB/$basearch/os # metalinkhttps://mirrors.centos.org/metalink?repocentos-crb-$streamarch$basearchprotocolhttps,http gpgkeyfile:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial gpgcheck1 repo_gpgcheck0 metadata_expire6h countme1 enabled1 [crb-debuginfo] nameCentOS Stream $releasever - CRB - Debug baseurlhttps://mirrors.ustc.edu.cn/centos-stream/$releasever-stream/CRB/$basearch/debug/tree/ # metalinkhttps://mirrors.centos.org/metalink?repocentos-crb-debug-$streamarch$basearchprotocolhttps,http gpgkeyfile:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial gpgcheck1 repo_gpgcheck0 metadata_expire6h enabled0 [crb-source] nameCentOS Stream $releasever - CRB - Source baseurlhttps://mirrors.ustc.edu.cn/centos-stream/$releasever-stream/CRB/source/tree/ # metalinkhttps://mirrors.centos.org/metalink?repocentos-crb-source-$streamarchsourceprotocolhttps,http gpgkeyfile:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial gpgcheck1 repo_gpgcheck0 metadata_expire6h enabled0 vim /etc/yum.repos.d/centos-addons.repo [highavailability] nameCentOS Stream $releasever - HighAvailability baseurlhttps://mirrors.ustc.edu.cn/centos-stream/$releasever-stream/HighAvailability/$basearch/os # metalinkhttps://mirrors.centos.org/metalink?repocentos-highavailability-$streamarch$basearchprotocolhttps,http gpgkeyfile:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial gpgcheck1 repo_gpgcheck0 metadata_expire6h countme1 enabled0 [highavailability-debuginfo] nameCentOS Stream $releasever - HighAvailability - Debug baseurlhttps://mirrors.ustc.edu.cn/centos-stream/$releasever-stream/HighAvailability/$basearch/debug/tree/ # metalinkhttps://mirrors.centos.org/metalink?repocentos-highavailability-debug-$streamarch$basearchprotocolhttps,http gpgkeyfile:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial gpgcheck1 repo_gpgcheck0 metadata_expire6h enabled0 [highavailability-source] nameCentOS Stream $releasever - HighAvailability - Source baseurlhttps://mirrors.ustc.edu.cn/centos-stream/$releasever-stream/HighAvailability/source/tree/ # metalinkhttps://mirrors.centos.org/metalink?repocentos-highavailability-source-$streamarchsourceprotocolhttps,http gpgkeyfile:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial gpgcheck1 repo_gpgcheck0 metadata_expire6h enabled0 [nfv] nameCentOS Stream $releasever - NFV baseurlhttps://mirrors.ustc.edu.cn/centos-stream/$releasever-stream/NFV/$basearch/os # metalinkhttps://mirrors.centos.org/metalink?repocentos-nfv-$streamarch$basearchprotocolhttps,http gpgkeyfile:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial gpgcheck1 repo_gpgcheck0 metadata_expire6h countme1 enabled0 [nfv-debuginfo] nameCentOS Stream $releasever - NFV - Debug baseurlhttps://mirrors.ustc.edu.cn/centos-stream/$releasever-stream/NFV/$basearch/debug/tree/ # metalinkhttps://mirrors.centos.org/metalink?repocentos-nfv-debug-$streamarch$basearchprotocolhttps,http gpgkeyfile:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial gpgcheck1 repo_gpgcheck0 metadata_expire6h enabled0 [nfv-source] nameCentOS Stream $releasever - NFV - Source baseurlhttps://mirrors.ustc.edu.cn/centos-stream/$releasever-stream/NFV/source/tree/ # metalinkhttps://mirrors.centos.org/metalink?repocentos-nfv-source-$streamarchsourceprotocolhttps,http gpgkeyfile:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial gpgcheck1 repo_gpgcheck0 metadata_expire6h enabled0 [rt] nameCentOS Stream $releasever - RT baseurlhttps://mirrors.ustc.edu.cn/centos-stream/$releasever-stream/RT/$basearch/os # metalinkhttps://mirrors.centos.org/metalink?repocentos-rt-$streamarch$basearchprotocolhttps,http gpgkeyfile:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial gpgcheck1 repo_gpgcheck0 metadata_expire6h countme1 enabled0 [rt-debuginfo] nameCentOS Stream $releasever - RT - Debug baseurlhttps://mirrors.ustc.edu.cn/centos-stream/$releasever-stream/RT/$basearch/debug/tree/ # metalinkhttps://mirrors.centos.org/metalink?repocentos-rt-debug-$streamarch$basearchprotocolhttps,http gpgkeyfile:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial gpgcheck1 repo_gpgcheck0 metadata_expire6h enabled0 [rt-source] nameCentOS Stream $releasever - RT - Source baseurlhttps://mirrors.ustc.edu.cn/centos-stream/$releasever-stream/RT/source/tree/ # metalinkhttps://mirrors.centos.org/metalink?repocentos-rt-source-$streamarchsourceprotocolhttps,http gpgkeyfile:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial gpgcheck1 repo_gpgcheck0 metadata_expire6h enabled0 [resilientstorage] nameCentOS Stream $releasever - ResilientStorage baseurlhttps://mirrors.ustc.edu.cn/centos-stream/$releasever-stream/ResilientStorage/$basearch/os # metalinkhttps://mirrors.centos.org/metalink?repocentos-resilientstorage-$streamarch$basearchprotocolhttps,http gpgkeyfile:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial gpgcheck1 repo_gpgcheck0 metadata_expire6h countme1 enabled0 [resilientstorage-debuginfo] nameCentOS Stream $releasever - ResilientStorage - Debug baseurlhttps://mirrors.ustc.edu.cn/centos-stream/$releasever-stream/ResilientStorage/$basearch/debug/tree/ # metalinkhttps://mirrors.centos.org/metalink?repocentos-resilientstorage-debug-$streamarch$basearchprotocolhttps,http gpgkeyfile:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial gpgcheck1 repo_gpgcheck0 metadata_expire6h enabled0 [resilientstorage-source] nameCentOS Stream $releasever - ResilientStorage - Source baseurlhttps://mirrors.ustc.edu.cn/centos-stream/$releasever-stream/ResilientStorage/source/tree/ # metalinkhttps://mirrors.centos.org/metalink?repocentos-resilientstorage-source-$streamarchsourceprotocolhttps,http gpgkeyfile:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial gpgcheck1 repo_gpgcheck0 metadata_expire6h enabled0 [extras-common] nameCentOS Stream $releasever - Extras packages baseurlhttps://mirrors.ustc.edu.cn/centos-stream/SIGs/$releasever-stream/extras/$basearch/extras-common # metalinkhttps://mirrors.centos.org/metalink?repocentos-extras-sig-extras-common-$streamarch$basearchprotocolhttps,http gpgkeyfile:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Extras-SHA512 gpgcheck1 repo_gpgcheck0 metadata_expire6h countme1 enabled1 [extras-common-source] nameCentOS Stream $releasever - Extras packages - Source baseurlhttps://mirrors.ustc.edu.cn/centos-stream/SIGs/$releasever-stream/extras/source/extras-common # metalinkhttps://mirrors.centos.org/metalink?repocentos-extras-sig-extras-common-source-$streamarchsourceprotocolhttps,http gpgkeyfile:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Extras-SHA512 gpgcheck1 repo_gpgcheck0 metadata_expire6h enabled0 1.2.2删除和建立yum缓存 yum clean all yum makecache 1.3更新系统软件包 sudo dnf update -y 1.4 yum与dnf介绍
CentOS 9 默认使用的是 DNF 作为包管理工具而不再使用 YUM。虽然 CentOS 9 中没有传统的 YUM 命令但它提供了一个 yum 的软链接指向 dnf这意味着你在命令行中输入 yum 实际上是运行 dnf。
以下是一些关键点
DNF 作为默认包管理工具CentOS 9 使用 DNF 作为其默认的包管理工具。你可以使用 dnf 命令来安装、更新和删除软件包。
YUM 的兼容性虽然没有传统的 YUM但系统提供了一个指向 DNF 的 yum 软链接这样习惯于使用 yum 的用户仍然可以使用 yum 命令如同在以前的版本中一样。例如输入 yum install package 实际上会运行 dnf install package。
命令和功能在 CentOS 9 中使用 dnf 命令时大多数你习惯于在 YUM 中使用的命令和选项仍然适用因为 DNF 保持了相当的兼容性。
总的来说在 CentOS 9 上你可以继续使用 yum 命令但它实际上是调用 DNF。 2. 安装 Nginx
2.1安装 sudo yum install nginx -y 2.2开启服务 sudo systemctl start nginx sudo systemctl enable nginx 3. 安装 MariaDB
3.1安装 sudo dnf install mariadb-server mariadb -y 3.2开启服务 sudo systemctl start mariadb sudo systemctl enable mariadb 4. 安全配置 MariaDB sudo mysql_secure_installation 按照提示设置 MariaDB root 用户密码并进行其他安全设置。
注意默认答案都是“yes”是 5. 创建 WordPress 数据库和用户
5.1进入数据 sudo mysql -u root -p 密码 5.2创建数据库 CREATE DATABASE wordpress; 5.3创建用户并赋权 CREATE USER wordpressuserlocalhost IDENTIFIED BY Huawei!123; GRANT ALL PRIVILEGES ON wordpress.* TO wordpressuserlocalhost; FLUSH PRIVILEGES; EXIT; 6. 安装 PHP sudo dnf install php-fpm php-mysqlnd php-json php-xml php-mbstring -y 6.1修改配置文件
编辑 /etc/php-fpm.d/www.conf 文件确保 user 和 group 设置为 nginx
listen 127.0.0.1:9000 6.2启动并启用 PHP-FPM 服务 sudo systemctl start php-fpm sudo systemctl enable php-fpm 7. 下载并配置 WordPress cd /usr/share/nginx/html sudo curl -O https://wordpress.org/latest.tar.gz sudo tar -zxvf latest.tar.gz sudo chown -R nginx:nginx /usr/share/nginx/html sudo chmod -R 755 /usr/share/nginx/html 8. 配置 WordPress
这一步可以跳过的
8.1复制样本配置文件并编辑 sudo cp wp-config-sample.php wp-config.php sudo nano wp-config.php 8.2根据需要更新以下内容
根据自己的具体内容来做修改如数据库密码 define( DB_NAME, wordpress ); define( DB_USER, wordpressuser ); define( DB_PASSWORD, password ); define( DB_HOST, localhost ); 9. 配置 Nginx
9.1编辑 Nginx 配置文件
vim /etc/nginx/conf.d/wordpress.conf server { listen 80; server_name your_domain_or_IP更换成你的电脑的ip地址; root /usr/share/nginx/html; index index.php index.html index.htm; location / { try_files $uri $uri/ /index.php?$args; } location ~ \.php$ { include /etc/nginx/fastcgi_params; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } location ~ /\.ht { deny all; } } 9.2检查 Nginx 配置是否正确 sudo nginx -t 9.3重新加载 Nginx 配置 sudo systemctl restart nginx 10. 配置 SELinux 和防火墙
10.1如果启用了 SELinux
运行以下命令 sudo chcon -t httpd_sys_rw_content_t /usr/share/nginx/html -R 10.2配置防火墙允许 HTTP 和 HTTPS 流量 sudo firewall-cmd --permanent --add-servicehttp sudo firewall-cmd --permanent --add-servicehttps sudo firewall-cmd --reload 11. 访问 WordPress 安装界面
在浏览器中访问您的服务器 IP 地址或域名例如 http://your_domain_or_IP然后按照屏幕上的说明完成 WordPress 安装。 11.1访问
ifconfig可以查看网络信息 http://ip/wordpress 11.2安装 11.3无法写入wp-config.php
出现这种错误是目录权限问题如果在步骤8处理过就不会有 vim /etc/share/nginx/html/wordpress/wp-config.php
把上面的东西复制粘贴进去保存
11.4填写配置信息 11.5登录 这样您就可以在 CentOS 9 上使用 Nginx 成功搭建 WordPress 了。
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/923907.shtml
如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!