linux系统 yum方式安装apache和相关的常见命令

因为后面要在本地创建Ambari的本地yum安装源,所以需要安装Apache

按照如下命令安装并启动 Apache:
#安装 Apache
sudo yum -y install httpd

#将 Apache 设置为开机启动
sudo systemctl enable httpd

#启动 Apache
sudo systemctl start httpd


重新启动 Apache
sudo systemctl restart httpd

查看httpd的运行状态,有出现 active (running) ,说明已经成功
service httpd status

Webui 访问 apache (公网ip),阿里云,华为云等 要记得在安全策略中开启80的端口
http://14.8.15.26/


AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain. Set the 'ServerName' directive globally to suppress this message

apache 启动出现这种错误的解决方法:
修改 /etc/httpd/conf/httpd.conf文件,大概95行,添加如下配置

ServerName localhost:80


其它常见命令

查看httpd的进程

ps -ef | grep httpd

#停止 Apache
sudo systemctl stop httpd

查看已经安装的httpd的版本
httpd -v

使用查看是否已经安装了httpd
rpm -qa | grep httpd

卸载 rpm (先执行上面的,再执行这个),并删除目录 /etc/httpd目录下的文件
rpm –e xxxxxx 

 



 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值