大家好,欢迎来到IT知识分享网。
inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
[root@master ~]#
- firewall的话,直接
systemctl stop firewalld
即可
如果使用的是iptables,则吧firewalld替换成iptables
[root@master ~]# systemctl is-active firewalld
active
[root@master ~]#
[root@master ~]# systemctl stop firewalld
[root@master ~]#
[root@master ~]# systemctl is-active firewalld
inactive
[root@master ~]#
- selinux关闭:
setenforce 0
使用getenforce
查看结果为Disabled才行。
[root@master ~]#
[root@master ~]# getenforce
Disabled
[root@master ~]#
[root@master ~]# #setenforce 0
[root@master ~]#
- 我们需要安装http服务,所以我们需要先搭建一个本地源
下面我简单说下过程【照着我的做就行】,如果有不能理解的,去我博客中翻翻yum源的搭建,学习一下
#先创建一个文件用来挂载镜像
[root@master ~]# #mkdir /root/centos7.6
挂载镜像到刚才创建的那个文件
[root@master ~]# #mount CentOS-7.6-x86_64-DVD-1810.iso /root/centos7.6/
配置文件如下
[root@master ~]# cat /etc/yum.repos.d/centos.repo
[cenot-7.6]
name=cenots7.6
baseurl=file:///root/centos7.6
gpgcheck=0
enable=1
[root@master ~]#
正常情况直接执行这个命令就可以看到镜像数量了,如果为0,则执行一下:yum clean all
[root@master ~]# yum repolist
-
Loaded plugins: fastestmirror, langpacks, product-id, search-disabled-repos,
- subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
Determining fastest mirrors
repo id repo name status
!cenot-7.6 cenots7.6 4,021
repolist: 4,021
[root@master ~]#
- 安装httpd服务
yum install -y httpd
[root@master ~]# yum install -y httpd
-
Loaded plugins: fastestmirror, langpacks, product-id, search-disabled-repos,
- subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Loading mirror speeds from cached hostfile
cenot-7.6 | 3.6 kB 00:00
Resolving Dependencies
–> Running transaction check
—> Package httpd.x86_64 0:2.4.6-88.el7.centos will be installed
–> Processing Dependency: httpd-tools = 2.4.6-88.el7.centos for package: httpd-2.4.6-88.el7.centos.x86_64
–> Processing Dependency: /etc/mime.types for package: httpd-2.4.6-88.el7.centos.x86_64
–> Processing Dependency: libaprutil-1.so.0()(64bit) for package: httpd-2.4.6-88.el7.centos.x86_64
–> Processing Dependency: libapr-1.so.0()(64bit) for package: httpd-2.4.6-88.el7.centos.x86_64
–> Running transaction check
—> Package apr.x86_64 0:1.4.8-3.el7_4.1 will be installed
—> Package apr-util.x86_64 0:1.5.2-6.el7 will be installed
—> Package httpd-tools.x86_64 0:2.4.6-88.el7.centos will be installed
—> Package mailcap.noarch 0:2.1.41-2.el7 will be installed
–> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
httpd x86_64 2.4.6-88.el7.centos cenot-7.6 2.7 M
Installing for dependencies:
apr x86_64 1.4.8-3.el7_4.1 cenot-7.6 103 k
apr-util x86_64 1.5.2-6.el7 cenot-7.6 92 k
httpd-tools x86_64 2.4.6-88.el7.centos cenot-7.6 90 k
mailcap noarch 2.1.41-2.el7 cenot-7.6 31 k
Transaction Summary
================================================================================
Install 1 Package (+4 Dependent packages)
Total download size: 3.0 M
Installed size: 10 M
Downloading packages:
Total 33 MB/s | 3.0 MB 00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : apr-1.4.8-3.el7_4.1.x86_64 1/5
Installing : apr-util-1.5.2-6.el7.x86_64 2/5
Installing : httpd-tools-2.4.6-88.el7.centos.x86_64 3/5
Installing : mailcap-2.1.41-2.el7.noarch 4/5
Installing : httpd-2.4.6-88.el7.centos.x86_64 5/5
Verifying : httpd-tools-2.4.6-88.el7.centos.x86_64 1/5
Verifying : apr-1.4.8-3.el7_4.1.x86_64 2/5
Verifying : mailcap-2.1.41-2.el7.noarch 3/5
Verifying : httpd-2.4.6-88.el7.centos.x86_64 4/5
Verifying : apr-util-1.5.2-6.el7.x86_64 5/5
Installed:
httpd.x86_64 0:2.4.6-88.el7.centos
Dependency Installed:
apr.x86_64 0:1.4.8-3.el7_4.1 apr-util.x86_64 0:1.5.2-6.el7
httpd-tools.x86_64 0:2.4.6-88.el7.centos mailcap.noarch 0:2.1.41-2.el7
Complete!
[root@master ~]#
- 修改配置文件:
/etc/httpd/conf/httpd.conf
我们httpd 中默认提供web 界面的位置是我们/var/www/html
目录,如果我们yum 源想指定目录,就需要修改2处内容
[root@master ~]# vim /etc/httpd/conf/httpd.conf
下面是修改后的内容及行号
119 DocumentRoot “/usr/local”
131 <Directory “/usr/local/”>
注:有2个directory,修改下面哪个
- 重启http服务
[root@master ~]# systemctl restart httpd
[root@master ~]#
[root@master ~]# systemctl is-active httpd
active
[root@master ~]#
- 需要新建一个目录,新建的目录是用来存放软件的安装包的【安装包格式为:rpm包】
在/usr/local
下新建任意目录,我这使用yumrepo
创建这个目录的意义是:将rpm包放在这里面,也就是http的源包
[root@master ~]# mkdir /usr/local/yumrepo
[root@master ~]#
- 然后我们去镜像的包里面,将全部rpm包拷贝到我们上面创建的这个文件中
如果你跟着我做的本地源,可以看到镜像是挂载到/root/centos7.6上的【如果你不是,自己挂载到哪,就进入到哪【下面命令应该看得懂吧】
[root@master ~]# df | grep centos7.6
/dev/loop0 0 100% /root/centos7.6
[root@master ~]#
[root@master ~]# cd /root/centos7.6/
[root@master centos7.6]# ls
CentOS_BuildTag GPL LiveOS RPM-GPG-KEY-CentOS-7
EFI images Packages RPM-GPG-KEY-CentOS-Testing-7
EULA isolinux repodata TRANS.TBL
[root@master centos7.6]# cd Packages/
[root@master Packages]# ls | wc -l
4022
[root@master Packages]# cp * /usr/local/yumrepo/
[root@master Packages]# cd /usr/local/yumrepo/
[root@master yumrepo]# ls |wc -l
4022
[root@master yumrepo]#
- createrepo 命令用于创建yum源(软件仓库),即为存放于本地特定位置的众多rpm包建立索引,描述各包所需依赖信息,并形成元数据。
- 在
/usr/local/
目录下执行createrepo -v yumrepo/
[root@master yumrepo]# cd …
[root@master local]# pwd
/usr/local
[root@master local]#
[root@master local]# createrepo -v yumrepo/
…#正常情况4000多条会全部过一边,我只放了最后一部分
Worker 0: reading xulrunner-31.6.0-2.el7.centos.x86_64.rpm
Worker 1: reading xvattr-1.3-27.el7.x86_64.rpm
Worker 2: reading xz-5.2.2-1.el7.x86_64.rpm
Worker 3: reading xz-devel-5.2.2-1.el7.x86_64.rpm
Worker 0: reading xz-libs-5.2.2-1.el7.x86_64.rpm
Worker 1: reading yajl-2.0.4-4.el7.x86_64.rpm
Worker 2: reading yelp-3.28.1-1.el7.x86_64.rpm
Worker 3: reading yelp-libs-3.28.1-1.el7.x86_64.rpm
Worker 0: reading yelp-tools-3.28.0-1.el7.noarch.rpm
Worker 1: reading yelp-xsl-3.28.0-1.el7.noarch.rpm
Worker 2: reading yp-tools-2.14-5.el7.x86_64.rpm
Worker 3: reading ypbind-1.37.1-9.el7.x86_64.rpm
Worker 0: reading ypserv-2.31-11.el7.x86_64.rpm
Worker 1: reading yum-3.4.3-161.el7.centos.noarch.rpm
Worker 2: reading yum-langpacks-0.4.2-7.el7.noarch.rpm
Worker 3: reading yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
Worker 0: reading yum-plugin-aliases-1.1.31-50.el7.noarch.rpm
Worker 1: reading yum-plugin-changelog-1.1.31-50.el7.noarch.rpm
Worker 2: reading yum-plugin-fastestmirror-1.1.31-50.el7.noarch.rpm
Worker 3: reading yum-plugin-tmprepo-1.1.31-50.el7.noarch.rpm
Worker 0: reading yum-plugin-verify-1.1.31-50.el7.noarch.rpm
Worker 1: reading yum-plugin-versionlock-1.1.31-50.el7.noarch.rpm
Worker 2: reading yum-utils-1.1.31-50.el7.noarch.rpm
Worker 3: reading zenity-3.28.1-1.el7.x86_64.rpm
Worker 0: reading zip-3.0-11.el7.x86_64.rpm
Worker 1: reading zlib-1.2.7-18.el7.x86_64.rpm
Worker 2: reading zlib-devel-1.2.7-18.el7.x86_64.rpm
Worker 3: reading zsh-5.0.2-31.el7.x86_64.rpm
Worker 0: reading zziplib-0.13.62-9.el7.x86_64.rpm
Workers Finished
Saving Primary metadata
Saving file lists metadata
Saving other metadata
Generating sqlite DBs
Starting other db creation: Wed Aug 18 10:35:18 2021
Ending other db creation: Wed Aug 18 10:35:20 2021
Starting filelists db creation: Wed Aug 18 10:35:21 2021
Ending filelists db creation: Wed Aug 18 10:35:26 2021
Starting primary db creation: Wed Aug 18 10:35:26 2021
Ending primary db creation: Wed Aug 18 10:35:29 2021
Sqlite DBs complete
[root@master local]#
给/usr/local/yumrepo
配置权限,因为我们的httpd 的服务使用的是apache
用户,该目录需要有普通用户的执行权限
[root@master yumrepo]# chmod -R 755 /usr/local/yumrepo/
[root@master yumrepo]#
正常情况,我们在本地浏览器上输入ip/yumrepo
即可看到全部包的内容。
==================================================================
任意能和服务端通信的主机均可配置,包括服务端自己也是可以配置该http源的。
自我介绍一下,小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。
深知大多数Java工程师,想要提升技能,往往是自己摸索成长或者是报班学习,但对于培训机构动则几千的学费,着实压力不小。自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!
因此收集整理了一份《2024年Java开发全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友,同时减轻大家的负担。
既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,基本涵盖了95%以上Java开发知识点,真正体系化!
由于文件比较大,这里只是将部分目录截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且会持续更新!
如果你觉得这些内容对你有帮助,可以扫码获取!!(备注Java获取)
最后
还有Java核心知识点+全套架构师学习资料和视频+一线大厂面试宝典+面试简历模板可以领取+阿里美团网易腾讯小米爱奇艺快手哔哩哔哩面试题+Spring源码合集+Java架构实战电子书+2021年最新大厂面试题。
《一线大厂Java面试题解析+核心总结学习笔记+最新讲解视频+实战项目源码》,点击传送门即可获取!
…(img-087ccPr8-29)]
既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,基本涵盖了95%以上Java开发知识点,真正体系化!
由于文件比较大,这里只是将部分目录截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频,并且会持续更新!
如果你觉得这些内容对你有帮助,可以扫码获取!!(备注Java获取)
最后
还有Java核心知识点+全套架构师学习资料和视频+一线大厂面试宝典+面试简历模板可以领取+阿里美团网易腾讯小米爱奇艺快手哔哩哔哩面试题+Spring源码合集+Java架构实战电子书+2021年最新大厂面试题。
[外链图片转存中…(img-WomqDBHt-29)]
《一线大厂Java面试题解析+核心总结学习笔记+最新讲解视频+实战项目源码》,点击传送门即可获取!
免责声明:本站所有文章内容,图片,视频等均是来源于用户投稿和互联网及文摘转载整编而成,不代表本站观点,不承担相关法律责任。其著作权各归其原作者或其出版社所有。如发现本站有涉嫌抄袭侵权/违法违规的内容,侵犯到您的权益,请在线联系站长,一经查实,本站将立刻删除。 本文来自网络,若有侵权,请联系删除,如若转载,请注明出处:https://haidsoft.com/150943.html