yum命令
yum是上层的安装只能管理工具,可以发现并解决软件的依赖性。
yum clean all 清空yum缓存
yum repolist 列出yum仓库信息
yum install software 安装软件
yum update software 更新软件
yum list software 查看软件信息
yum list all 查看所有软件
yum list installed 查看已经安装的软件
yum list availiable 查看可安装的软件
yum reinstall software 重新安装
yum remove software 卸载软件
yum info software 查看软件的详细信息
[root@desktop36 yum.repos.d]# yum info httpd
Loaded plugins: langpacks
Installed Packages
Name : httpd
Arch : x86_64
Version : 2.4.6
Release : 17.el7
Size : 3.7 M
Repo : installed
From repo : rhel7.0
Summary : Apache HTTP Server
URL : http://httpd.apache.org/
License : ASL 2.0
Description : The Apache HTTP Server is a powerful, efficient, and extensible
: web server.
yum search software信息 根据软件信息查找软件
[root@desktop36 yum.repos.d]# yum search httpd
Loaded plugins: langpacks
============================== N/S matched: httpd ==============================
httpd.x86_64 : Apache HTTP Server
httpd-devel.x86_64 : Development interfaces for the Apache HTTP server
httpd-manual.noarch : Documentation for the Apache HTTP server
httpd-tools.x86_64 : Tools for use with the Apache HTTP Server
libmicrohttpd.i686 : Lightweight library for embedding a webserver in
: applications
libmicrohttpd.x86_64 : Lightweight library for embedding a webserver in
: applications
mod_dav_svn.x86_64 : Apache httpd module for Subversion server
Name and summary matches only, use "search all" for everything.
yum whatprovides file 根据文件找出包含此文件的软件
[root@desktop36 yum.repos.d]# yum whatprovides httpd
Loaded plugins: langpacks
httpd-2.4.6-17.el7.x86_64 : Apache HTTP Server
Repo : rhel7.0
httpd-2.4.6-17.el7.x86_64 : Apache HTTP Server
Repo : @rhel7.0
yum groups list 列出软件组
yum groups info 查看软件组的信息
yum groups install softwaregroup 安装软件组
yum groups remove softwaregroup 卸载软件组
rpm结尾的软件,只适用与redat操作系统,只能发现软件的依赖,不能解决依赖。
rpm -i ##安装
-v ##显示安装过程
-h ##hash加密
-e ##卸载
-ql ##查看软件在系统中安装的文件路径
-p #后面跟的是.rpm结尾的安装包,查看软件包安装以后会产生什么文件
-qa ##查询系统中安装的所有软件名称
-qf filename ##查看filename属于哪个安装包
-ivh name.rpm --force ##强制安装,但不能忽略依赖性
-ivh name.rpm --nodeps--force ##忽略依赖性并且强制安装
-qi name ##查看软件安装后的信息
源码安装
安装nginx
1.获取安装包 nginx-1.10.3.tar.gz
2.tar zxf nginx-1.10.3.tar.gz
3.cd nginx-1.10.3
4.cd auto cd cc vim gcc 注释debug
5.cd nginx-1.10.3 进行编译
解决依赖性
yum install gcc -y
yum install openssl-devel -y
yum install pcre-devel -y
./configure --prefix=/usr/local/nginx --with-http_ssl_module --with-http_stub_status_module
#--prefix 指定安装路径
#--with-http_ssl_module 支持https
#--with-http_stub_status_module 查看nginx工作状态
make & make install
/usr/local/nginx/sbin/nginx -t #检查主配置文件有无错误
/usr/local/nginx/sbin/nginx #启动nginx
测试:
apache和nginx都是使用80端口,测试时先关闭httpd服务,否则报错无法连接80端口。在浏览器中输入本机ip。
nginx安装目录:/usr/local/nginx
关闭nginx服务:
[root@foundation36 nginx]# ps aux | grep nginx
root 14154 0.0 0.0 45336 1096 ? Ss 11:34 0:00 nginx: master process /usr/local/nginx/sbin/nginx
nobody 14155 0.0 0.0 47860 2196 ? S 11:34 0:00 nginx: worker process
root 14800 0.0 0.0 112652 960 pts/0 S+ 11:59 0:00 grep --color=auto nginx
[root@foundation36 nginx]# kill -9 14154
[root@foundation36 nginx]# kill -9 14155
[root@foundation36 nginx]# systemctl start httpd
网友评论