环境搭建-Apache的安装(Linux)

命令查看是否已经安装了apache服务器httpdlinux

rpm -qa | grep httpdapache

查看httpd服务是否启动vim

ps -ef | grep httpd服务器

卸载httpd服务tcp

yum remove httpdspa

安装httpd服务3d

yum install httpd -ycode

查看是否安装成功blog

yum list installed | grep httpdip

 查看配置文件

启动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默认页面

相关文章
相关标签/搜索