![ローカル ネットワーク上のリポジトリ サーバーに接続できません](https://rvso.com/image/789263/%E3%83%AD%E3%83%BC%E3%82%AB%E3%83%AB%20%E3%83%8D%E3%83%83%E3%83%88%E3%83%AF%E3%83%BC%E3%82%AF%E4%B8%8A%E3%81%AE%E3%83%AA%E3%83%9D%E3%82%B8%E3%83%88%E3%83%AA%20%E3%82%B5%E3%83%BC%E3%83%90%E3%83%BC%E3%81%AB%E6%8E%A5%E7%B6%9A%E3%81%A7%E3%81%8D%E3%81%BE%E3%81%9B%E3%82%93.png)
現在、2 つの VM があります。
- ノード1(192.168.55.201)
- リポジトリ(192.168.55.203)
セットアップしようとしていますノード1リポジトリサーバーからパッケージを取得できるようにします。現在、AppStreamリポジトリとhttpdをセットアップしています。リポジトリホスト。
[root@rhel9 test_repos]# tree -d AppStream/
AppStream/
├── Packages
└── repodata
[root@rhel9 test_repos]# systemctl status httpd
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Active: active (running) since Wed 2023-09-13 11:51:53 UTC; 18min ago
Docs: man:httpd.service(8)
Main PID: 37453 (httpd)
Status: "Total requests: 20; Idle/Busy workers 100/0;Requests/sec: 0.0182; Bytes served/sec: 10 B/sec"
Tasks: 213 (limit: 11077)
Memory: 23.1M
CPU: 1.929s
CGroup: /system.slice/httpd.service
├─37453 /usr/sbin/httpd -DFOREGROUND
├─37454 /usr/sbin/httpd -DFOREGROUND
├─37455 /usr/sbin/httpd -DFOREGROUND
├─37456 /usr/sbin/httpd -DFOREGROUND
└─37457 /usr/sbin/httpd -DFOREGROUND
Sep 13 11:51:53 rhel9.localdomain systemd[1]: Starting The Apache HTTP Server...
Sep 13 11:51:53 rhel9.localdomain systemd[1]: Started The Apache HTTP Server.
Sep 13 11:51:53 rhel9.localdomain httpd[37453]: Server configured, listening on: port 80
の上ノード1、AppStream.repoファイルを作成した。/etc/yum.repos.d
[AppStream]
name=AppStream
baseurl=http://192.168.55.203:/test_repos/AppStream
gpgcheck=0
enabled=1
を実行しようとするとdnf update
、次のエラーが発生します。
Errors during downloading metadata for repository 'AppStream':
- Status code: 404 for http://192.168.55.203/test_repos/repodata/repomd.xml (IP: 192.168.55.203)
Error: Failed to download metadata for repo 'AppStream': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
リポジトリデータディレクトリを確認すると、リポジトリホスト、ファイルが存在することがわかりますrepodata.xml
。
└── repodata
├── 278a30984eda05dd66bf5b64b4c73e3ad594b4d7e53c88a2c65aeaa0c5948590-filelists.xml.gz
├── 538c923c865cbbe37031914cb741d828109b4ca5a75d7295a44044a5919d5dfa-primary.sqlite.bz2
├── 58ab9375821de1a81796ad3f0037d2dfa2ab8b1659ed191152ac848a7851c7d8-filelists.sqlite.bz2
├── a5bca624b05d997d2558ed577fe5eceba8429ef7df1237d95f5dd3d57c5e8165-other.xml.gz
├── b77637ccd437dfab4e6352a43838094f7d9c6a4c91de7ccb97e11ca83b349fed-primary.xml.gz
├── ecb122d15f31549a564c15d66fb89e336e777812ae30c83620fa53f6df86f4b5-other.sqlite.bz2
├── productid
└── repomd.xml
次のトラブルシューティングを完了しました。
- 正常にpingされましたリポジトリからノード1逆もまた同様
- カール成功リポジトリからノード1Apacheのウェルカムページが表示されました
- ファイアウォールルールが設定されていることを確認しましたリポジトリ
public (active)
target: default
icmp-block-inversion: no
interfaces: eth0 eth1
sources:
services: cockpit dhcpv6-client http ssh
何が問題なのか分かりますか?
ありがとう !
答え1
エラー ログを確認した後、アクセス許可が拒否されたというメッセージが表示されました。問題は、ディレクトリに正しいファイル コンテキストがなかったことですtest_repos
。httpd_sys_content_t
問題は解決されました。