搭建Fastdfs
参考:
官方网站:https://github.com/happyfish100/
配置文档:https://github.com/happyfish100/fastdfs/wiki/
参考资料:https://www.oschina.net/question/tag/fastdfs
Java客户端:https://github.com/happyfish100/fastdfs-client-java
配置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
或者
/usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf start
service fdfs_storaged start
或者
/usr/bin/fdfs_storaged /etc/fdfs/storage.conf 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.关闭防火墙/开放防火墙 80 端口
service iptables stop
或者执行:
/sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT
/etc/rc.d/init.d/iptables save
启动了防火墙开放了80端口
firewall-cmd --zone=public --query-port=80/tcp
开放端口的方法:
/sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT
/etc/rc.d/init.d/iptables save
启防火墙
service iptables stop
通过开启防火墙,没有任何提示即开启成功。
systemctl start firewalld
如果要关闭防火墙设置,可能通过这条指令来关闭该功能。
systemctl stop firewalld
启动nginx:
cd /usr/local/nginx/sbin/
./nginx
其它命令
nginx -s stop
nginx -s quit
nginx -s reload
netstat -a # 查看所有服务端口
解决办法
使用指定nginx.conf文件的方式重启nginx
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
liunx立即重启
shutdown -r now