vi /var/www/html/index.html //编辑网页文件 内容hello~
vi /etc/httpd/conf/httpd.conf // 查找 /Listen 将端口号80 修改成82端口
配置httpd在82端口上提供Web服务,
首先确定是否安装httpd服务
systemctl restart httpd //重启服务报错,原因是selinux
cat /etc/httpd/conf/httpd.conf //查看监听端口号,发现监听端口号为82
semanage port --list | grep 82 //查看semanage port
semanage port -a -t http_port_t -p tcp 82 //selinux上开放端口
查看是否监听——显示已监听82端口
尝试访问网页内容:
curl http://servera:82 (会显示/var/www/html/index.html里面的内容)
注意:
可用getenforce获取当前seLinux状态, 若为Enforcing(表示已打