FastDFS 6.9.5 单机版安装
一、下载需要的安装包
cd /usr/local/src #下载fastdfs依赖库 wget https://github.com/happyfish100/libfastcommon/archive/refs/tags/V1.0.67.tar.gz mv V1.0.67.tar.gz libfastcommon-1.0.67.tar.gz #下载网络框架 https://github.com/happyfish100/libserverframe/archive/refs/tags/V1.1.26.tar.gz mv V1.1.26.tar.gz libserverframe-1.1.26.tar.gz #下载fastdfs wget https://github.com/happyfish100/fastdfs/archive/refs/tags/V6.9.5.tar.gz mv V6.9.5.tar.gz fastdfs-6.9.5.tar.gz #下载nginx模块 wget https://github.com/happyfish100/fastdfs-nginx-module/archive/refs/tags/V1.23.tar.gz mv V1.23.tar.gz fastdfs-nginx-module-1.23.tar.gz #下载nginx wget https://nginx.org/download/nginx-1.24.0.tar.gz
二、解压并安装libfastcommon
tar zxf libfastcommon-1.0.67.tar.gz cd libfastcommon-1.0.67 ./make.sh ./make.sh install
三、解压并安装libserverframe
tar zxf libserverframe-1.1.26.tar.gz cdlibserverframe-1.1.26 ./make.sh ./make.sh install
四、安装fastdfs
1、安装fastdfs
tar zxf fastdfs-6.9.5.tar.gz cd fastdfs-6.9.5 ./make.sh ./make.sh install
2、复制配置文件至/etc/fdfs/
cp /usr/local/src/fastdfs-6.9.5/conf/http.conf /etc/fdfs/ cp /usr/local/src/fastdfs-6.9.5/conf/mime.types /etc/fdfs/
五、安装nginx
1、解压fastdfs-nginx-module,并复制配置文件至/etc/fdfs/下
tar zxf fastdfs-nginx-module-1.23.tar.gz cp /usr/local/src/fastdfs-nginx-module-1.23/src/mod_fastdfs.conf /etc/fdfs/
2、解压nginx并编译安装
tar zxf nginx-1.24.0.tar.gz cd nginx-1.24.0 ./configure --prefix=/usr/local/nginx --add-module=/usr/local/src/fastdfs-nginx-module-1.23/src/ make && make install
五、配置Tracker、storage和client,并启动Tracker和storage服务
1、配置Tracker
mkdir -p /usr/local/fastdfs/data vim /etc/fdfs/tracker.conf # tracker服务器端口(默认为22122) port=22122 # 修改存储日志和数据的根目录 base_path=/usr/local/fastdfs/data
2、配置storage
mkdir -p /usr/local/fastdfs/storage/data0 vim /etc/fdfs/storage.conf #修改数据和日志文件存储根目录 base_path=/usr/local/fastdfs/data #修改存储目录 store_path0=/usr/local/fastdfs/storage/data0 #修改tracker服务器IP和端口 tracker_server=192.168.1.11:22122 #修改http访问端口(默认为8888) http.server_port=8888
3、配置client
vim /etc/fdfs/client.conf #修改数据和日志文件存储根目录 base_path=/usr/local/fastdfs/data #修改tracker服务器IP和端口 tracker_server=192.168.1.11:22122
4、启动Tracker和storage服务
fdfs_trackerd /etc/fdfs/tracker.conf fdfs_storaged /etc/fdfs/storage.conf
5、测试上传文件
fdfs_upload_file /etc/fdfs/client.conf /usr/local/src/nginx-1.24.0.tar.gz
group1/M00/00/00/wKgB0WSP2TiATvhyABD5l7xtYLs.tar.gz
六、配置nginx访问
1、修改fastdfs-nginx-module模块配置
vim /etc/fdfs/mod_fastdfs.conf #修改以下配置 tracker_server=192.168.1.11:22122 url_have_group_name=true store_path0=/usr/local/fastdfs/storage/data0
2、修改nginx配置文件
vim /usr/local/nginx/conf/nginx.conf #添加以下配置 server { listen 8888; # 该端口为storage.conf中的http.server_port相同 server_name localhost; location ~/group1/ { ngx_fastdfs_module; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } }
3、启动nginx服务
/usr/local/nginx/sbin/nginx
七、测试访问
http://192.168.1.11:8888/group1/M00/00/00/wKgB0WSP2TiATvhyABD5l7xtYLs.tar.gz
单机版详情和分布式可以参考文档:
https://github.com/happyfish100/fastdfs/wiki
标签:单机版,tar,fastdfs,FastDFS,gz,local,nginx,usr,安装 From: https://www.cnblogs.com/NanZhiHan/p/17490926.html