主机上安装了个VM centeros
首先通过 终端:ifconfig eth0 查看虚拟机的Ip地址
这样就能在主机上通过浏览器http://192.168.150.128/a.php 访问虚拟机的web服务了
telnet 192.168.150.128 80 失败判断为80端口未开放
修改防火墙规则
[root@jiangbo ~]# /sbin/iptables -I INPUT -p tcp --dport -j ACCEPT
[root@jiangbo ~]# /etc/rc.d/init.d/iptables save
iptables:将防火墙规则保存到 /etc/sysconfig/iptables: [确定]
[root@jiangbo ~]# /etc/init.d/iptables restart
iptables:将链设置为政策 ACCEPT:filter [确定]
iptables:清除防火墙规则: [确定]
iptables:正在卸载模块: [确定]
iptables:应用防火墙规则: [确定]
[root@jiangbo ~]# ifconfig eth0
eth0 Link encap:Ethernet HWaddr :0C::3A:B6:
inet addr:192.168.150.128 Bcast:192.168.150.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe3a:b653/ Scope:Link
UP BROADCAST RUNNING MULTICAST MTU: Metric:
RX packets: errors: dropped: overruns: frame:
TX packets: errors: dropped: overruns: carrier:
collisions: txqueuelen:
RX bytes: (371.0 MiB) TX bytes: (8.7 MiB)
Can't start server: Bind on TCP/IP port: Permission denied
/etc/my.cnf 修改mysql端口号
gnome-open为打开文件命令 如gnome-open /etc/php.ini 可以在终端直接打开
修改linux下mysql端口时候报错:Can't start server: Bind on TCP/IP port: Permission denied
需要修改: vi /etc/selinux/config
SELINUX=disabled
然后重启服务器即可