<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      RHEL 7創建本地安裝源

      聲明

      受限于網絡環境和網絡速度的影響,我們很多時候需要更加便捷的下載軟件包的方式,那么創建一個不受網絡因素影響的本地安裝源就很有必要。本文檔所有使用的賬號為個人紅帽開發者賬號,所有安裝的包以及工具或是紅帽提供的安裝包,或是GIT HUB上的開源項目,請大家在能力范圍內積極支持正版。

      安裝操作系統

      1、加載鏡像后選擇 Install Red Hat Enterprise Linux 7.9

      image

      2、語言選擇中文(看個人習慣,安裝數據庫最好默認選英文)

      image

      3、總覽需要配置的項

      image

      4、時區選擇亞洲-上海

      image

      5、軟件選擇 最小安裝

      image

      6、分區選擇 先選擇磁盤后再選擇我要配置分區

      image

      一般情況下,沒特殊要求可以選擇自動分區,如果有需求知道數據具體存放在哪里,可以指定特定的分區,比如下面的/repos就是手動創建的

      image

      7、配置網絡和主機名,選擇一定連接的網卡,點擊右下角的配置,選擇IPv4設置,手動配置網絡后,打開網卡,修改主機名

      image

      8、上述都配置好后,點擊開始安裝開始安裝操作系統

      image

      9、配置root用戶密碼并創建新用戶

      image

      10、等待系統安裝完成后,重啟操作系統

      image

      注冊開發者賬號

      1、登錄紅帽開發者網站注冊賬號 https://developers.redhat.com/后即可成為紅帽開發者一員,可以獲得紅帽操作系統1年的臨時使用權限。

      2、注冊成功后,在已經安裝好的紅帽操作系統中使用subscription-manager register --username=username --password=password --auto-attach即可將當前系統資源添加至紅帽賬戶。

      3、注冊成功后可以通過subscription-manager list查看系統的激活信息

      [root@rhel ~]# subscription-manager list
      +-------------------------------------------+
          Installed Product Status
      +-------------------------------------------+
      Product Name:   Red Hat Enterprise Linux Server
      Product ID:     69
      Version:        7.9
      Arch:           x86_64
      Status:         Subscribed
      Status Details:
      Starts:         03/05/2024
      Ends:           03/05/2025
      
      

      安裝依賴包

      安裝工具包

      reposync -- 同步rpm包工具

      該命令用于rpm的同步,其中RHEL 6和7 版本需要的reposync命令需要單獨安裝rpm包: yum-utils,RHEL 8 版本則是集成在dnf命令中。

      createrepo --創建軟件倉庫工具

      該包用于同步完軟件包后,創建本地源用。

      nginx -- web服務

      通過nginx可以使本地的源文件供內網中可以和本機通信的機器使用。

      1. 創建nginx安裝源

        [root@rhel ~]# cat >> /etc/yum.repos.d/nginx.repo << EOF
        [nginx-stable]
        name=nginx stable repo
        baseurl=http://nginx.org/packages/rhel/\$releasever/\$basearch/
        gpgcheck=1
        enabled=1
        gpgkey=https://nginx.org/keys/nginx_signing.key
        module_hotfixes=true
        EOF
        
      2. 安裝nginx最新版本

        [root@rhel ~]# yum install nginx
        Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
        nginx-stable                                                                                                                                                          | 2.9 kB  00:00:00
        nginx-stable/7Server/x86_64/primary_db                                                                                                                                |  87 kB  00:00:00
        Resolving Dependencies
        --> Running transaction check
        ---> Package nginx.x86_64 1:1.24.0-1.el7.ngx will be installed
        --> Finished Dependency Resolution
        
        Dependencies Resolved
        
        =============================================================================================================================================================================================
         Package                                 Arch                                     Version                                               Repository                                      Size
        =============================================================================================================================================================================================
        Installing:
         nginx                                   x86_64                                   1:1.24.0-1.el7.ngx                                    nginx-stable                                   804 k
        
        Transaction Summary
        =============================================================================================================================================================================================
        Install  1 Package
        
        Total download size: 804 k
        Installed size: 2.8 M
        Is this ok [y/d/N]: y
        Downloading packages:
        warning: /var/cache/yum/x86_64/7Server/nginx-stable/packages/nginx-1.24.0-1.el7.ngx.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 7bd9bf62: NOKEY-    ] 137 kB/s | 756 kB  00:00:00 ETA
        Public key for nginx-1.24.0-1.el7.ngx.x86_64.rpm is not installed
        nginx-1.24.0-1.el7.ngx.x86_64.rpm                                                                                                                                     | 804 kB  00:00:04
        Retrieving key from https://nginx.org/keys/nginx_signing.key
        Importing GPG key 0x7BD9BF62:
         Userid     : "nginx signing key <signing-key@nginx.com>"
         Fingerprint: 573b fd6b 3d8f bc64 1079 a6ab abf5 bd82 7bd9 bf62
         From       : https://nginx.org/keys/nginx_signing.key
        Is this ok [y/N]: y
        Running transaction check
        Running transaction test
        Transaction test succeeded
        Running transaction
          Installing : 1:nginx-1.24.0-1.el7.ngx.x86_64                                                                                                                                           1/1
        ----------------------------------------------------------------------
        
        Thanks for using nginx!
        
        Please find the official documentation for nginx here:
        * https://nginx.org/en/docs/
        
        Please subscribe to nginx-announce mailing list to get
        the most important news about nginx:
        * https://nginx.org/en/support.html
        
        Commercial subscriptions for nginx are available on:
        * https://nginx.com/products/
        
        ----------------------------------------------------------------------
          Verifying  : 1:nginx-1.24.0-1.el7.ngx.x86_64                                                                                                                                           1/1
        
        Installed:
          nginx.x86_64 1:1.24.0-1.el7.ngx
        
        Complete!
        

      同步軟件包

      查看所有可用的軟件倉庫

      使用yum repolist all可以查看當前賬戶可以使用的軟件倉庫,默認情況下只會啟用rhel-7-server-rpms/7Server/x86_64這一個軟件倉庫。

      下面是展示出來的部分內容。可以在實際操作中選擇其他臁倉庫啟用。

      [root@rhel ~]# yum repolist all
      Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
      repo id                                                                      status
      a-mq-clients-1-for-rhel-7-server-debug-rpms/7Server/x86_64                   disabled
      a-mq-clients-1-for-rhel-7-server-rpms/7Server/x86_64                         disabled
      a-mq-clients-1-for-rhel-7-server-source-rpms/7Server/x86_64                  disabled
      rhel-ha-for-rhel-7-server-rpms/7Server/x86_64                                disabled
      rhel-7-server-extras-rpms/x86_64                                             enabled:  1,468
      ...
      rhel-7-server-rpms/7Server/x86_64                                            enabled: 34,270
      ...
      repolist: 36,603
      

      啟用停用軟件倉庫

      [root@repos ~]# subscription-manager repos --enable=rhel-7-server-extras-rpms
      為這個系統啟用軟件倉庫 'rhel-7-server-extras-rpms'。
      [root@repos ~]# subscription-manager repos --disable=rhel-7-server-extras-rpms
      為這個系統停用軟件倉庫 'rhel-7-server-extras-rpms'。
      

      同步軟件包到本地

      使用命令reposync --plugins --newest-only --delete --download_path=$download_path --repoid=rhel-7-server-rpms 可以同步單個軟件源到本地,如果需要同步多個軟件源,可以創建一個shell腳本如下:

      #!/bin/bash
       
      #定義下載回來的包存放的目錄
      download_path="/repos"
       
      reposync --plugins --newest-only --delete --download_path=$download_path --downloadcomps --repoid=rhel-7-server-rpms
      reposync --plugins --newest-only --delete --download_path=$download_path --downloadcomps --repoid=rhel-7-server-extras-rpms
      reposync --plugins --newest-only --delete --download_path=$download_path --downloadcomps --repoid=rhel-ha-for-rhel-7-server-rpms
       
      #--plugins              啟用yum插件支持
      #--newest-only          每次回購僅下載最新的軟件包。
      #--download_path        軟件包存放地址
      #--repoid               需要下載的倉庫ID
      

      同步成功后會在指定的目錄下生成如下的目錄結構,一個comps.xml的文件,一個包含下載的所有包的Packahes目錄。

      [root@rheloracle home]# tree /repos/
      repos
      └── rhel-7-server-rpms
          ├── comps.xml
          └── Packages
              ├── 3
              │   ├──···.rpm
              ├── a
              │   ├──···.rpm
              ...
              └── z
              │   ├──···.rpm
      
      29 directories 5515 files
      

      創建本地倉庫

      進入到下載本地的repo id的目錄下,使用createrepo命令將下載到本地的軟件包創建成軟件倉庫

      [root@rhel ~]# cd /repos/rhel-7-server-rpms/
      [root@rhel rhel-7-server-rpms]# ls
      comps.xml  Packages
      [root@rhel rhel-7-server-rpms]# createrepo -g comps.xml .
      Spawning worker 0 with 2757 pkgs
      Spawning worker 1 with 2757 pkgs
      Workers Finished
      Saving Primary metadata
      Saving file lists metadata
      Saving other metadata
      Generating sqlite DBs
      Sqlite DBs complete
      

      創建本地安裝源

      [root@rhel ~]# cat >> /etc/yum.repos.d/rhel7-local.repo << EOF
      [rhel7-local]
      name=rhel7-local
      baseurl=file:///repos/rhel-7-server-rpms/  # 按照實際本地存儲路徑填寫
      enabled=1
      gpgcheck=0 
      EOF
      

      查看當前可用的安裝源

      [root@rhel ~]# yum repolist
      Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
      repo id                                                                        repo name                                                                                               status
      nginx-stable/7Server/x86_64                                                    nginx stable repo                                                                                          324
      rhel-7-server-rpms/7Server/x86_64                                              Red Hat Enterprise Linux 7 Server (RPMs)                                                                34,270
      rhel-ha-for-rhel-7-server-rpms/7Server/x86_64                                  Red Hat Enterprise Linux High Availability (for RHEL 7 Server) (RPMs)                                      865
      repolist: 35,459
      
      

      禁用網絡源

      [root@rhel ~]# subscription-manager repos --disable=rhel-7-server-rpms
      Repository 'rhel-7-server-rpms' is disabled for this system.
      [root@rhel ~]# subscription-manager repos --disable=rhel-ha-for-rhel-7-server-rpms
      Repository 'rhel-ha-for-rhel-7-server-rpms' is disabled for this system.
      

      清理舊緩存并創建新緩存

      [root@rhel ~]# yum clean all
      Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
      Cleaning repos: nginx-stable rhel7-local
      Other repos take up 1.3 G of disk space (use --verbose for details)
      [root@rhel ~]# yum makecache
      Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
      nginx-stable                                                                                                                                                          | 2.9 kB  00:00:00
      rhel7-local                                                                                                                                                           | 3.6 kB  00:00:00
      (1/7): nginx-stable/7Server/x86_64/primary_db                                                                                                                         |  87 kB  00:00:00
      (2/7): nginx-stable/7Server/x86_64/filelists_db                                                                                                                       | 112 kB  00:00:00
      (3/7): rhel7-local/group_gz                                                                                                                                           | 138 kB  00:00:00
      (4/7): rhel7-local/primary_db                                                                                                                                         | 4.5 MB  00:00:00
      (5/7): rhel7-local/filelists_db                                                                                                                                       | 3.7 MB  00:00:00
      (6/7): rhel7-local/other_db                                                                                                                                           | 1.6 MB  00:00:00
      (7/7): nginx-stable/7Server/x86_64/other_db                                                                                                                           |  53 kB  00:00:00
      Metadata Cache Created
      

      以上,本地源可以使用,如果只需要本地使用上面的部分就夠了

      如果需要通過局域網內使用,則需要繼續下面的操作。

      firewalld防火墻放行與禁用

      由于啟用了防火墻需要放行80端口或http服務,或者停用防火墻,一般為了安全考慮放行端口和服務比較好

      [root@repos ~]# firewall-cmd --permanent --add-port=80/tcp
      success
      [root@repos ~]# firewall-cmd --permanent --add-service=http
      success
      

      禁用端口或服務

      [root@repos ~]# firewall-cmd --permanent --remove-port=80/tcp
      success
      [root@repos ~]# firewall-cmd --permanent --remove-service=http
      success
      

      修改需要重新加載才能生效

      [root@repos ~]# firewall-cmd --reload    
      success
      

      啟用nginx代理

      編輯/etc/nginx/conf.d/default.conf文件,將下面的部分按照實際情況進行修改

      location / {
              root   /repos/;					//指定實際目錄絕對路徑;
              autoindex on;					//開啟目錄瀏覽功能;
              autoindex_exact_size off;		//關閉詳細文件大小統計,讓文件大小顯示MB,GB單位,默認為b;
              autoindex_localtime on;			//開啟以服務器本地時區顯示文件修改日期!
              charset utf-8,gbk;				// 開啟中文文件名稱展示
              index  index.html index.htm;
          }
      

      啟用nginx服務:systemctl start nginx

      配置nginx服務開機啟動:systemctl enable nginx

      image

      訪問http://本機IP地址

      image

      創建網絡安裝源并測試

      創建網絡安裝源

      [root@rhel ~]# cat >> /etc/yum.repos.d/rhel7-net.repo << EOF
      [rhel7-net]
      name=rhel7-net
      baseurl=http://10.60.99.46/rhel-7-server-rpms/	# 按實際數據填寫
      enabled=1
      gpgcheck=0
      EOF
      [root@rhel ~]# yum makecache
      Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
      nginx-stable                                                                                                                                                          | 2.9 kB  00:00:00
      rhel7-net                                                                                                                                                             | 3.6 kB  00:00:00
      (1/7): nginx-stable/7Server/x86_64/primary_db                                                                                                                         |  87 kB  00:00:00
      (2/7): rhel7-net/group_gz                                                                                                                                             | 138 kB  00:00:00
      (3/7): rhel7-net/primary_db                                                                                                                                           | 4.5 MB  00:00:00
      (4/7): rhel7-net/filelists_db                                                                                                                                         | 3.7 MB  00:00:00
      (5/7): rhel7-net/other_db                                                                                                                                             | 1.6 MB  00:00:00
      (6/7): nginx-stable/7Server/x86_64/other_db                                                                                                                           |  53 kB  00:00:00
      (7/7): nginx-stable/7Server/x86_64/filelists_db                                                                                                                       | 112 kB  00:00:01
      Metadata Cache Created
      

      在其他網絡可通信的主機上,創建上述中rhel7-net.repo文件并建立緩存測試,是否可用

      posted @ 2024-05-29 14:15  狗熊掰苞米  閱讀(588)  評論(0)    收藏  舉報
      主站蜘蛛池模板: 亚洲精国产一区二区三区| 亚洲嫩模一区二区三区| av无码精品一区二区三区| 国产蜜臀精品一区二区三区| 饥渴少妇高潮正在播放| 大连市| 国产日韩乱码精品一区二区| 2021国产精品视频网站| 日日猛噜噜狠狠扒开双腿小说| 欧美成本人视频免费播放| 精品人妻免费看一区二区三区| 怡红院一区二区三区在线| 国产午夜福利视频在线观看| 性做久久久久久久| 夜夜春久久天堂亚洲精品| √天堂中文在线最新版| 少妇人妻偷人精品系列| 四虎成人精品永久免费av| 亚洲成人av高清在线| 视频一区视频二区视频三| 漂亮人妻中文字幕丝袜| 午夜精品久久久久久久爽| 久久影院午夜伦手机不四虎卡| 国产精品视频一区二区三区不卡| 少妇高潮流白浆在线观看| 亚洲精品国产免费av| 国产免费午夜福利在线播放| 天堂www在线中文| 国产91成人亚洲综合在线 | 国产美女久久久亚洲综合| 亚洲精品二区在线播放| 亚洲国产欧美在线看片一国产 | 亚洲一区在线成人av| 人妻无码∧V一区二区| 东京热人妻无码一区二区AV| 亚洲国产精品成人无码区| 亚洲婷婷综合色高清在线| 成人无码午夜在线观看| 镇康县| 日韩av毛片福利国产福利| 亚洲国产午夜精品福利|