-1
我正在設置一個centos 6.5作爲服務器。關於Vagrant Q:我設置了一個centos 6.5在vagrant中,我已經安裝了httpd,但我無法訪問虛擬機上的網站
我用private_network設置與IP:192.168.33.20
我使用的IP地址192.168.33.20訪問虛擬機上的SSH和SFTP。
但只有我不能,雖然我已經安裝httpd和httpd的那個IP地址(192.168.33.20)訪問網站運行
[[email protected] ~]# netstat -nltp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:45525 0.0.0.0:* LISTEN 1082/rpc.statd
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1208/sshd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1285/master
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1062/rpcbind
tcp 0 0 :::22 :::* LISTEN 1208/sshd
tcp 0 0 ::1:25 :::* LISTEN 1285/master
tcp 0 0 :::34314 :::* LISTEN 1082/rpc.statd
tcp 0 0 :::111 :::* LISTEN 1062/rpcbind
tcp 0 0 :::80 :::* LISTEN 3202/httpd
檢查SELinux的,它被禁用
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX=disabled
# SELINUXTYPE= type of policy in use. Possible values are:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.
SELINUXTYPE=targeted
更改HTTP端口
[[email protected] ~]# sudo netstat -nltd
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:49655 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN
tcp 0 0 :::22 :::* LISTEN
tcp 0 0 ::1:25 :::* LISTEN
tcp 0 0 :::45389 :::* LISTEN
tcp 0 0 :::111 :::* LISTEN
tcp 0 0 :::8080 :::* LISTEN
我無法從我的主機訪問我的Web服務器
可以確認,你可以從訪問Web服務器VM(使用curl或其他) - 從/ etc/sysconfig/selinux中檢查SELinux –
@Henri:我可以通過SSH和SFTP訪問我的Web服務器,你能解釋更多關於SELinux的信息嗎?如果有推薦鏈接,那就太棒了。謝謝 –