cat /etc/udev/rules.d/70-persistent-net.rules
cd /etc/sysconfig/network-scripts/
mv ifcfg-eth0 ifcfg-eth1
vi ifcfg-eth1
编辑后的结果:
DEVICE=eth1 //把eth0修改为eth1
HWADDR=00:0c:29:33:b3:20 //修改为网卡一的mac地址
TYPE=Ethernet
UUID=0133d8eb-4c7c-4e04-b56e-4864782e35da
ONBOOT=yes
NM_CONTROLLED=no
BOOTPROTO=dhcp
service network restart
查看ip
ifconfig
vi 文件名 -> i -> 修改内容 -> esc -> : -> wq/q!
vi /etc/fdfs/client.conf -> 把ip修改为当前虚拟机ip
vi /etc/fdfs/storage.conf -> 把ip修改为当前虚拟机ip
service fdfs_trackerd start
service fdfs_storaged start
netstat -unltp|grep fdfs
/usr/bin/fdfs_monitor /etc/fdfs/storage.conf
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
service iptables stop
?
/sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT
/etc/rc.d/init.d/iptables save
注意:网络使用的是桥接模式
在虚拟机里面: curl http://127.0.0.1:80
在宿主机测试:浏览器访问 http://127.0.0.1:80
fdfs_test /etc/fdfs/client.conf upload /root/install.log
浏览器访问:fastdfs返回的路径:虚拟机IP地址
原文:https://www.cnblogs.com/htq29study/p/11604218.html