日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 运维知识 > centos >内容正文

centos

Centos7制作局域网http的yum源

發(fā)布時(shí)間:2025/3/11 centos 71 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Centos7制作局域网http的yum源 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

制作局域網(wǎng)http的yum源

1、下載安裝包到本地,以下載vim軟件包為例

yum install --downloadonly --downloaddir=/opt/download vim

2、將安裝包拷貝至局域網(wǎng)預(yù)先設(shè)置好的yum服務(wù)器

[root@localhost yum]# cd /opt/yum 進(jìn)入到軟件包所在文件夾 [root@localhost yum]# createrepo . 創(chuàng)建每個(gè)軟件包元數(shù)據(jù) [root@localhost yum]# createrepo update 軟件倉(cāng)庫(kù)中含有很多的軟件包,雖然只是其中的一小部分有所改動(dòng)但是你卻不必為每個(gè)軟件包重新產(chǎn)生元數(shù)據(jù),這樣做明顯太浪費(fèi)時(shí)間了

3、安裝httpd服務(wù)器

[root@localhost yum]# yum -y install httpd 已加載插件:fastestmirror, langpacks Loading mirror speeds from cached hostfile* base: mirrors.ustc.edu.cn* extras: mirrors.ustc.edu.cn* updates: mirrors.ustc.edu.cn 正在解決依賴關(guān)系 --> 正在檢查事務(wù) ---> 軟件包 httpd.x86_64.0.2.4.6-97.el7.centos 將被 安裝 --> 正在處理依賴關(guān)系 httpd-tools = 2.4.6-97.el7.centos,它被軟件包 httpd-2.4.6-97.el7.centos.x86_64 需要 --> 正在處理依賴關(guān)系 /etc/mime.types,它被軟件包 httpd-2.4.6-97.el7.centos.x86_64 需要 --> 正在處理依賴關(guān)系 libaprutil-1.so.0()(64bit),它被軟件包 httpd-2.4.6-97.el7.centos.x86_64 需要 --> 正在處理依賴關(guān)系 libapr-1.so.0()(64bit),它被軟件包 httpd-2.4.6-97.el7.centos.x86_64 需要

4、啟動(dòng)httpd服務(wù),并查看運(yùn)行狀態(tài)

[root@localhost /]# systemctl enable httpd //開機(jī)自啟動(dòng) Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service. [root@localhost /]# systemctl start httpd //開啟服務(wù) [root@localhost /]# systemctl status httpd //查看服務(wù)狀態(tài) ● httpd.service - The Apache HTTP ServerLoaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)Active: active (running) since 六 2021-01-23 19:11:22 PST; 6s agoDocs: man:httpd(8)man:apachectl(8)Main PID: 23938 (httpd)Status: "Processing requests..."CGroup: /system.slice/httpd.service├─23938 /usr/sbin/httpd -DFOREGROUND├─23941 /usr/sbin/httpd -DFOREGROUND├─23942 /usr/sbin/httpd -DFOREGROUND├─23943 /usr/sbin/httpd -DFOREGROUND├─23944 /usr/sbin/httpd -DFOREGROUND└─23945 /usr/sbin/httpd -DFOREGROUND1月 23 19:11:22 localhost.localdomain systemd[1]: Starting The Apache HTTP Server... 1月 23 19:11:22 localhost.localdomain httpd[23938]: AH00558: httpd: Could not reliably determine the server's fully qu...ssage 1月 23 19:11:22 localhost.localdomain systemd[1]: Started The Apache HTTP Server. Hint: Some lines were ellipsized, use -l to show in full.

5、關(guān)閉selinux:

1)暫時(shí)關(guān)閉,重啟后失效
[root@localhost yum]# getenforce //運(yùn)行命令 getenforce 獲取當(dāng)前selinux狀態(tài)(Enforcing為開啟) Enforcing [root@localhost yum]# setenforce 0 //運(yùn)行命令 setenforce 0 [root@localhost yum]# getenforce //運(yùn)行命令getenforce,狀態(tài)變?yōu)?Permissive Permissive
2)永久關(guān)閉

運(yùn)行命令: vim /etc/sysconfig/selinux

# This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded. SELINUX=disabled #找到行:SELINUX=enforcing 替換為:SELINUX=disabled # SELINUXTYPE= can take one of three two values: # targeted - Targeted processes are protected, # minimum - Modification of targeted policy. Only selected processes are protected. # mls - Multi Level Security protection. SELINUXTYPE=targeted

重啟后,運(yùn)行命令 sestatus

[root@localhost yum]# sestatus SELinux status: `disabled` SELinuxfs mount: /sys/fs/selinux SELinux root directory: /etc/selinux Loaded policy name: targeted Current mode: permissive Mode from config file: disabled Policy MLS status: enabled Policy deny_unknown status: allowed Max kernel policy version: 28

永久關(guān)閉selinux成功

6、創(chuàng)建軟鏈接

[root@localhost /]# ln -s /opt/yum/ /var/www/html/centos [root@localhost /]# ll /var/www/html/ 總用量 0 lrwxrwxrwx. 1 root root 9 1月 23 19:13 centos -> /opt/yum/

7、訪問(wèn)該頁(yè)面

8、配置主機(jī)的yum指向這個(gè)yum源

[root@localhost /]# vim /etc/yum.repos.d/centos.repo [centos] name=centos baseurl=http://192.168.1.119/centos gpgcheck=0 enabled=1

9、查看yum源信息

[root@localhost /]# yum repolist 已加載插件:fastestmirror, langpacks Loading mirror speeds from cached hostfile 源標(biāo)識(shí) 源名稱 狀態(tài) centos centos 3,894 repolist: 3,894

總結(jié)

以上是生活随笔為你收集整理的Centos7制作局域网http的yum源的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。