命令查看是否已经安装了apache服务器httpdlinux
rpm -qa | grep httpd
apache
vim
ps -ef | grep httpd
服务器
tcp
yum remove httpd
spa
安装httpd服务3d
yum install httpd -y
code
查看是否安装成功blog
yum list installed | grep httpd
ip
查看配置文件
启动httpd服务
service httpd start
主机没法访问apache解决方法
多是Linux内置防火墙的限制,须要将tcp端口配置为容许任何ip访问
iptables -I INPUT -p TCP --dport 80 -j ACCEPT
这种方法是临时生效的,须要设置/etc/selinux/config中SELINUX的值
vim /etc/selinux/config
注释掉#SELINUX=enforcing,增长SELINUX=disabled
保存退出,并更改用户运行级别
chkconfig --level 3 iptables off
chkconfig --level 5 iptables off
输入ip加端口号就能访问到apache默认页面
输入ip加端口号就能访问到apache默认页面