centos7-FASTDFS安装(两分钟完成)

centos7-FASTDFS安装(两分钟完成)

切换到home目录command:cd /home/

下载需要文件(到你自己的电脑,然后拉到home目录下) https://wwa.lanzous.com/b00tuv2cf

全部解压command:tar -zxvf fastdfs-nginx-module-1.20.tar.gz

command:nginx-1.15.2.tar.gz

command:V1.0.38.tar.gz

command:V5.11.tar.gz

command:cd libfastcommon-1.0.38

command:./make.sh(注意:如果报错command not fount gcc和make,command:yum -y install gcc make)

command:./make.sh install

command:cd ..

command:cd fastdfs-5.11

command:./make.sh

command:./make.sh install

command:cp /etc/fdfs/tracker.conf.sample /etc/fdfs/tracker.conf

command:cp /etc/fdfs/storage.conf.sample /etc/fdfs/storage.conf

command:vim /etc/fdfs/tracker.conf

修改内容自行查找:

base_path=/home/fastdfs/tracker(注意:如果目录不存在自行创建)

http.server_port=80

command:/usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf start

command:vim /etc/fdfs/storage.conf

修改内容自行查找:

base_path=/home/fastdfs/storage(注意:如果目录不存在自行创建)

store_path0=/home/fastdfs/storage

tracker_server=XXX:22122(XXX是centos的ip)

command:/usr/bin/fdfs_storaged /etc/fdfs/storage.conf start

command:/usr/bin/fdfs_monitor /etc/fdfs/storage.conf(查看storage是否绑定如果绑定会显示Storage1的内容,内容有ip_addr=(centos的ip))

command:cd /home/nginx-1.15.2/

command:./configure --prefix=/usr/local/nginx --add-module=/home/fastdfs-nginx-module-1.20/src

command:make (注意:如果报错:/usr/include/fastdfs/fdfs_define.h:15:27: fatal error: common_define.h: No such file or directory,修改文件内容,command: vim /home/fastdfs-nginx-module-1.20/src/config

修改内容自行查找:

ngx_module_incs="/usr/include/fastdfs /usr/include/fastcommon/"

CORE_INCS="$CORE_INCS /usr/include/fastdfs /usr/include/fastcommon/")

command:make install

command:cp /home/fastdfs-nginx-module-1.20/src/mod_fastdfs.conf /etc/fdfs/

command:vim /etc/fdfs/mod_fastdfs.conf

修改内容自行查找:

base_path=/home/mm/fastdfs

tracker_server=XXX:22122(XXX是centos的ip)

url_have_group_name=true

store_path0=/home/fastdfs/storage(注意:如果目录不存在自行创建)

command:vim /usr/local/nginx/conf/nginx.conf

添加一下内容到server

location ~/M00{

root/home/fastdfs/storage/data; 

ngx_fastdfs_module;

}

command:cp /home/fastdfs-5.11/conf/{anti-steal.jpg,http.conf,mime.types} /etc/fdfs

command:cp /etc/fdfs/client.conf.sample /etc/fdfs/client.conf

command:vim /etc/fdfs/client.conf

修改内容自行查找:

base_path=/home/fastdfs/tracker

tracker_server=XXX:22122(XXX是centos的ip)

http.tracker_server_port=80

command:cd /etc/fdfs/

测试上传:

command:/usr/bin/fdfs_upload_file /etc/fdfs/client.conf client.conf(上传命令)

command:/usr/local/nginx/sbin/nginx

打开网页输入:http://centos的ip/group1/M00/00/00/wKgBZF9d6gKAba52AAAFtXJOjeo23.conf

group1/M00/00/00/wKgBZF9d6gKAba52AAAFtXJOjeo23.conf是上传后显示的文件地址

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值