使用rpm安装httpd
时间: 2023-11-25 11:00:23 浏览: 208
可以使用以下命令在CentOS/RHEL系统上使用rpm包管理器安装httpd:
```
sudo yum install httpd
```
这将自动安装httpd及其依赖项。安装完成后,您可以使用以下命令启动httpd服务:
```
sudo systemctl start httpd
```
要在系统启动时自动启动httpd服务,请使用以下命令:
```
sudo systemctl enable httpd
```
您可以使用以下命令检查httpd服务的状态:
```
sudo systemctl status httpd
```
如果服务正在运行,则应该看到类似于以下内容的输出:
```
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Active: active (running) since Wed 2021-07-28 14:43:23 EDT; 4s ago
Docs: man:httpd.service(8)
Main PID: 17828 (httpd)
Status: "Started, listening on: port 80"
Tasks: 213 (limit: 11505)
Memory: 21.7M
CGroup: /system.slice/httpd.service
├─17828 /usr/sbin/httpd -DFOREGROUND
├─17829 /usr/sbin/httpd -DFOREGROUND
├─17830 /usr/sbin/httpd -DFOREGROUND
├─17831 /usr/sbin/httpd -DFOREGROUND
├─17832 /usr/sbin/httpd -DFOREGROUND
└─17833 /usr/sbin/httpd -DFOREGROUND
```
阅读全文