一、安装Apache
yum install httpd #根据提示,输入Y安装即可成功安装
/etc/init.d/httpd start #启动Apache
备注:Apache启动之后会提示错误:
正在启动 httpd:httpd: Could not reliably determine the server's fully qualifdomain name, using ::1 for ServerName
解决办法:
vi/etc/httpd/conf/httpd.conf #编辑
找到 #ServerNamewww.example.com:80
修改为 ServerName localhost:80
:wq! #保存退出
chkconfig httpd on #设为开机启动
yum install httpd #根据提示,输入Y安装即可成功安装
/etc/init.d/httpd start #启动Apache
备注:Apache启动之后会提示错误:
正在启动 httpd:httpd: Could not reliably determine the server's fully qualifdomain name, using ::1 for ServerName
解决办法:
vi/etc/httpd/conf/httpd.conf #编辑
找到 #ServerNamewww.example.com:80
修改为 ServerName localhost:80
:wq! #保存退出
chkconfig httpd on #设为开机启动
/etc/init.d/httpd restart #重启Apache
关闭防火墙
#/etc/init.d/iptables stop
现在可以通过局域网访问了。