linux离线包下载地址:https://pkgs.org/,https://ftp.gnu.org/gnu/
tar -zxvf V1.0.38.tar.gz
cd libfastcommon-1.0.38
./make.sh
sudo ./make.sh install
tar -zxvf V5.11.tar.gz
cd fastdfs-5.11
./make.sh
sudo ./make.sh install
base_path=/home/【用户名】/fastdfs/tracker #tracker存储data和log的跟路径,必须提前创建好
port=22122 #tracker默认22122
http.server_port=80 #http端口,需要和nginx相同
/usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf start
base_path=/home/【用户名】/fastdfs/storage #storage存储data和log的跟路径,必须提前创建好
port=23000 #storge默认23000,同一个组的storage端口号必须一致
group_name=group1 #默认组名,根据实际情况修改
store_path_count=1 #存储路径个数,需要和store_path个数匹配
store_path0=/home/【用户名】/fastdfs/storage #如果为空,则使用base_path
tracker_server=【本机IP】:22122 #配置该storage监听的tracker的ip和port
/usr/bin/fdfs_storaged /etc/fdfs/storage.conf start
/usr/bin/fdfs_monitor /etc/fdfs/storage.conf
依次解压文件
tar -xf xxx
在进入:CD
在执行安装动作
tar -xf xxx
cd xxx
./configure
make
sudo make install
安装顺序:m4, autoconfig, automake, openssl, pcre, zlib
tar -xvf V1.20.tar.gz
mv fastdfs-nginx-module-1.20 /usr/local/src/
修改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/"
tar -zxvf nginx-1.15.2.tar.gz
cd nginx-1.10.1
./configure --prefix=/usr/local/nginx --add-module=/usr/local/src/fastdfs-nginx-module-1.20/src/
make
sudo make install
cd /usr/local/nginx/sbin/
./nginx
./nginx -s stop #此方式相当于先查出nginx进程id再使用kill命令强制杀掉进程
./nginx -s quit #此方式停止步骤是待nginx进程处理任务完毕进行停止
./nginx -s reload
cd /usr/local/src/fastdfs-nginx-module-1.20/src/
cp mod_fastdfs.conf /etc/fdfs
base_path=/home/【用户名】/fastdfs
tracker_server=【本机IP】:22122 #tracker的地址
url_have_group_name=true #url是否包含group名称
storage_server_port=23000 #需要和storage配置的相同
store_path_count=1 #存储路径个数,需要和store_path个数匹配
store_path0=/home/【用户名】/fastdfs/storage #文件存储的位置
cd /usr/local/nginx/conf/
sudo gedit nginx.conf
添加如下内容:
locatoin ~/group1/M00{
root /home/【用户名】/fastdfs/storage/data;
ngx_fastdfs_module;
}
cd /usr/local/src/fastdfs-5.11/conf
cp mime.types http.conf /etc/fdfs/
/etc/fdfs
目录,有cp命令拷贝client.conf.sample,删除.sample后缀作为正式文件;base_path=/home/【用户名】/fastdfs/tracker //tracker服务器文件路径
tracker_server=【本机IP】:22122 //tracker服务器IP地址和端口号
http.tracker_server_port=80 # tracker服务器的http端口号,必须和tracker的设置对应起来
/usr/bin/fdfs_upload_file /etc/fdfs/client.conf 1.txt
/home/【用户名】/fastdfs/storage/data/00/00
可以找到这个文件wget http://locahhost/group1/M00/00/00/CnqV01trmeyAbAN0AAAABLh3frE677.txt
/usr/bin/fdfs_download_file [local_filename]
/usr/bin/fdfs_download_file /etc/fdfs/client.conf group1/M00/00/00/CnqV01trmeyAbAN0AAAABLh3frE677.txt a.txt
/usr/bin/fdfs_delete_file
/usr/bin/fdfs_delete_file /etc/fdfs/client.conf group1/M00/00/00/CnqV01trmeyAbAN0AAAABLh3frE677.txt