第九章 Linux 系统—— 软件管理

 

概述:

  RPM包

  RPM由Red Hat 公司提出,被众多 Linux发行版所采用,也称二进制,无需编译,可以直接使用,无法设定个人设置,开关功能。

  源码包

  Source code需要经过GCC,C++编译环境编译运行,可以设定个人设置,开关功能。


 

一、RPM包管理

1.YUM工具

     Yum是一个在Fedora和Red Hat以及CentOS中的shell前端软件包管理器。基于 RPM包管理,能够从指定的服务器自动下载 RPM包并且安装,可以自动处理依赖性关系,并且一次安装所有依赖的软件包,无需繁琐地一次次下载,安装。

   网络源:使用官方源

    前提:联网

    (1)设置虚拟机为NAT

      

第九章 Linux 系统—— 软件管理

 (2)打开Linux网络设置

第九章 Linux 系统—— 软件管理

 (3)打开浏览器上网测试

第九章 Linux 系统—— 软件管理

2.目的

使用国内厂商提供的软件包地址(如:http://alibaba.com/.sadflsdjfjsdalkfdsa)作为YUM的仓库。

3.阿里云

   (1)清理原先YUM库

yum  install  wget

mv  /etc/yum.repos.d/*  /tmp

(2)下载阿里源至yum库

      wget http://mirrors.aliyun.com/repo/Centos-7.repo  -O /etc/yum.repos.d/CentOS-Base.repo

(3)更新YUM源

     yum repolist

     yum makecache

4.EPEL(企业版Linux的额外软件包)

下载epel配置文件

wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

重建缓存

[[email protected] ~]# yum  makecache

5.Nginx(配置文件)

   目的:通过查找官网了解构建官方源的原理。

   第一步:找到提示

   第二步:根据提示创建YUM配置文件

   第三步: 查看服务器是否已经具备软件官方源。

二、源码包管理

1.获得源码包

      Apache: www.apache.org

      Nginx: www.nginx.org

     Tengine: tengine.taobao.org

2.下载tengine

第九章 Linux 系统—— 软件管理

3.部署tengine

  下载源码包的命令

                            [[email protected]~]#wget http://tengine.taobao.org/download/tengine-2.2.0.tar.gz

   准备编译环境:

                           [[email protected] ~]# yum -y install   gcc   make   zlib-devel  pcre  pcre-devel  openssl-devel

(1)解压

             [[email protected] ~]# useradd www

             [[email protected] ~]# tar xvf tengine-2.2.0.tar.gz

            [[email protected] ~]# cd tengine-2.2.0

   (2)配置

            [[email protected] tengine-2.2.0]#./configure  --user=www  --group=www  --prefix=/usr/local/nginx  

   (3)编译

           [[email protected] tengine-2.2.0]# make

   (4)安装

          [[email protected] tengine-2.2.0]# make install

   (5)启动测试

           [[email protected] tengine-2.2.0]# /usr/local/nginx/sbin/nginx

           [[email protected] tengine-2.2.0]# systemctl stop firewalld

使用浏览器访问本机的IP,如果能看到NGINX的网页,说明部署成功。

相关文章:

  • 2022-01-15
  • 2021-10-29
  • 2021-07-09
  • 2021-10-04
  • 2021-12-31
  • 2021-12-10
  • 2021-05-05
  • 2021-12-17
猜你喜欢
  • 2021-05-15
  • 2021-11-04
  • 2021-12-15
  • 2021-12-23
  • 2021-09-23
  • 2021-12-18
  • 2021-12-06
  • 2021-12-31
相关资源
相似解决方案