1.fastdfs
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
-----------------------------------------------
#mod_fastdfs.conf
tracker_server=192.168.56.101:22122 # tracker服务IP和端口
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
----------------或者---------------------------------------------------
sudo /etc/init.d/fdfs_storaged start
sudo /etc/init.d/fdfs_trackerd start
6.测试
fdfs_upload_file /etc/fdfs/client.conf /root/test.jpg
7.nginx、fastdfs-nginx-module安装
切换 nginx目录
我的目录在:/home/soap/fastdfs/nginx-1.18.0
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
关闭
建立软连接:ln -s /usr/local/nginx/sbin/nginx /usr/bin/nginx
nginx的部分常用命令:nginx -s reload|reopen|stop|quit #重新加载配置|重启|停止|退出 nginx
ngnix -s reload:表示重新加载配置文件
ngnix -s reopen: 再次打开日志文件
ngnix -s stop : 停止服务器
ngnix -s quit : 退出服务器
nginx -s stop
ps -ef | grep nginx
kill -QUIT 18488
nginx 配置文件路径
sudo vim /usr/local/nginx/conf/nginx.conf
8.nginx报错
[alert] 412#0: cache manager process 416 exited on signal 11 (core dumped)
检查配置文件的地址是否可用
来源:oschina
链接:https://my.oschina.net/findurl/blog/4357707