1. 部署fastdfs
fastdfs部署官网:https://github.com/happyfish100/fastdfs/wiki
2. 配置Fastdfs
1.修改client.conf
- vi /etc/fdfs/client.conf -> 把ip修改为当前虚拟机ip
2.修改storage.conf
- vi /etc/fdfs/storage.conf -> 把ip修改为当前虚拟机ip
3.启动fastdfs
- service fdfs_trackerd start
- service fdfs_storaged start
4.查看是否启动成功
- netstat -unltp|grep fdfs
5.查看监控信息
- /usr/bin/fdfs_monitor /etc/fdfs/storage.conf
6.启动Nginx
-
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
7.关闭防火墙
- service iptables stop
8.测试Nginx
-
在虚拟机里面: curl http://虚拟机ip:80
-
在宿主机测试:浏览器访问 http://虚拟机ip:80
9.测试上传
- fdfs_test /etc/fdfs/client.conf upload /root/1.gif(通过xftp上传到/root下一张图片)