wsl2安装ubuntu20.4安装fastdfs

编程

参考

1.fastdfs

2.libfastcommon

3.上传到服务器

安装gcc

apt-get install gcc

安装make

apt-get install make

然后编译执行

./make.sh

./make.sh install

4.配置文件修改

sudo cp /etc/fdfs/tracker.conf.sample /etc/fdfs/tracker.conf

sudo cp /etc/fdfs/client.conf.sample /etc/fdfs/client.conf

sudo cp /etc/fdfs/storage.conf.sample /etc/fdfs/storage.conf

mkdir -p /myfdfs/tracker

mkdir -p /myfdfs/storage

修改/etc/fdfs 目录

# tracker.conf修改位置

base_path=/myfdfs/tracker

-----------------------------------------

# client.conf修改位置

base_path=/myfdfs/tracker

tracker_server = Tracker服务端的IP地址:22122

-----------------------------------------

# storage.conf修改位置

base_path=/myfdfs/storage

store_path0=/myfdfs/storage

tracker_server=Tracker服务端的IP地址:22122

5.启动

sudo /usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf start 

sudo /usr/bin/fdfs_storaged /etc/fdfs/storage.conf start

sudo /usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf stop

sudo /usr/bin/fdfs_storaged /etc/fdfs/storage.conf stop

6.测试

fdfs_upload_file /etc/fdfs/client.conf /root/test.jpg

7.nginx、fastdfs-nginx-module安装

切换 nginx目录

sudo ./configure --prefix=/usr/local/nginx --add-module=/home/soap/fastdfs/fastdfs-nginx-module-master/src/

ubuntu安装nginx时提示error: the HTTP rewrite module requires the PCRE library

sudo apt-get update

sudo apt-get install libpcre3 libpcre3-dev

sudo apt-get install openssl libssl-dev

启动

sudo /usr/local/nginx/sbin/nginx

关闭

ps -ef | grep nginx

kill -QUIT 18488

nginx 配置文件路径

sudo vim /usr/local/nginx/conf/nginx.conf

以上是 wsl2安装ubuntu20.4安装fastdfs 的全部内容, 来源链接: utcz.com/z/518261.html

回到顶部