系统相关
首页 > 系统相关> > 检查Apache是​​否安装在Amazon Linux AMI中

检查Apache是​​否安装在Amazon Linux AMI中

作者:互联网

如何检查Apache是​​否安装在基于RHEL 6的Amazon Linux AMI中?在Ubuntu中,我使用:

dpkg --get-selections | grep apache

但在这种情况下,这不起作用.注意,我需要能够判断Apache是​​否已安装,即使它不是服务.

解决方法:

我想到了两个选择:

yum info httpd

检查输出以查看它是否已安装,您可以获得如下内容:

[0 1003 12:18:33] ~ % yum info httpd
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
 * base: ftp.halifax.rwth-aachen.de
 * extras: ftp.rrzn.uni-hannover.de
 * remi: mirror5.layerjet.com
 * remi-php56: mirror5.layerjet.com
 * remi-safe: mirror5.layerjet.com
 * updates: ftp.halifax.rwth-aachen.de
Installed Packages
Name        : httpd
Arch        : x86_64
Version     : 2.2.15
Release     : 47.el6.centos
Size        : 2.9 M
Repo        : installed
From repo   : updates
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.

或者做

rpm -qf /etc/httpd

看看是否有任何包认为它负责httpd的配置目录 – 在CentOS6上,你得到

[0 1001 12:12:46] ~ % rpm -qf /etc/httpd
httpd-2.2.15-47.el6.centos.x86_64

(最简单的是,RH / CentOS上的约定是配置存在于/ etc / httpd /中,所以它的存在可能只是一个指标.)

标签:linux,amazon,aws,apache-httpd
来源: https://codeday.me/bug/20190816/1666918.html