因为后面要在本地创建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