Ric*_*ton 4 linux apache-httpd amazon aws
如何检查基于 RHEL 6 的 Amazon Linux AMI 中是否安装了 Apache?在 Ubuntu 中,我使用:
dpkg --get-selections | grep apache
Run Code Online (Sandbox Code Playgroud)
但这在这种情况下不起作用。请注意,即使 Apache 不是服务,我也需要能够判断它是否已安装。
我想到了两个选项:
yum info httpd
Run Code Online (Sandbox Code Playgroud)
检查输出以查看它是否已安装,您会得到类似的信息:
[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.
Run Code Online (Sandbox Code Playgroud)
或做
rpm -qf /etc/httpd
Run Code Online (Sandbox Code Playgroud)
查看是否有任何软件包认为它负责 httpd 的 config 目录——在 CentOS6 上,你得到
[0 1001 12:12:46] ~ % rpm -qf /etc/httpd
httpd-2.2.15-47.el6.centos.x86_64
Run Code Online (Sandbox Code Playgroud)
(最简单的最后一点,RH/CentOS 上的约定是配置存在于 中/etc/httpd/,因此它的存在可能只是一个指标。)
| 归档时间: |
|
| 查看次数: |
11919 次 |
| 最近记录: |