配置網絡,手動配置
搭建yum倉庫紅帽Linux網頁訪問問題
下載httpd
網頁訪問問題:首先看httpd的狀態---selinux的工作模式(強制)---上下文類型(semanage-fcontext)---selinux端口有沒有放行semanage port
---防火墻有沒有active---防火墻有沒有放行對應端口---httpd(是否重啟服務)
[root@workstation ~]# systemctl ?status ?httpd.service(確保httpd服務正常開啟)
[root@workstation ~]# getenforce(查看selinux模式)
[root@workstation html]# ls -Z(查看文件上下文類型是否正確)
unconfined_u:object_r:httpd_sys_content_t:s0 file1
unconfined_u:object_r:httpd_sys_content_t:s0 index.html
開放selinux端口
[root@workstation html]# semanage ?port ?-l ?| grep http
[root@workstation html]# man semanage-port
[root@workstation html]# semanage port -a -t http_port_t -p tcp 5555
[root@workstation html]# semanage ?port ?-l ?| grep http
開放防火墻端口
[root@workstation html]# man firewall-cmd
[root@workstation html]# firewall-cmd --permanent --add-port=5555/tcp
success
[root@workstation html]# firewall-cmd ?--reload?
success
開放httpd配置文件的端口
[root@workstation html]# vim ?/etc/httpd/conf/httpd.conf?
[root@workstation html]# cat ? /etc/httpd/conf/httpd.conf ?| grep ?Listen?
#Listen 12.34.56.78:80
#Listen 80
Listen ?5555
重啟httpd服務
[root@workstation html]# systemctl ?restart ?httpd.service?
[root@workstation html]# systemctl ?enable ?httpd.service