安装信息:
tracker:
base_path:/home/fastdfs/tracker
port:22122
storagee:
base_path:/home/fastdfs/storage
tracker_server:120.78.213.118:22122
store_path0:/home/fastdfs/storage
client:
base_path:/home/fastdfs/client
tracker_server=120.78.213.118:22122
yum install gcc-c++
yum -y install libevent
#解压
tar -zxvf libfastcommon-1.0.7.tar.gz
cd libfastcommon-1.0.7
./make.sh
./make.sh install
tar -zxvf fastdfs-5.05.tar.gz
cd fastdfs-5.05
./make.sh
./make.sh install
#查看该目录下是否有相应的文件 配置文件都放到/etc/fdfs文件夹
find /usr/bin/ -name "fdfs*"
#把配置文件复制到/etc/fdfs/,以后使用复制过去的配置文件启动服务器
切换到cd /opt/fastdfs/fastdfs-5.05/conf
复制 cp * /etc/fdfs/
#创建tracker目录
mkdir -p /home/fastdfs/tracker
#配置tracker服务。
修改vim /etc/fdfs/tracker.conf文件
#启动tracker,使用之前拷贝的配置文件启动
/usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf
#重启命令
/usr/bin/fdfs_trackerd /etc/fdfs/tracker.conf restart
#如果是在不同的服务器安装,第四步的1~4需要重新执行。(单机版可以不用考虑)
mkdir -p /home/fastdfs/storage
#修改以下三处内容
vim /etc/fdfs/storage.conf
#启动storage服务。
/usr/bin/fdfs_storaged /etc/fdfs/storage.conf restart
#cd /home/fastdfs/storage多了一些文件夹
mkdir -p /home/fastdfs/client
vim /etc/fdfs/client.conf
#修改以下内容
/usr/bin/fdfs_test /etc/fdfs/client.conf upload /etc/fdfs/anti-steal.jpg
fastdfs 安装完成
重新编译nginx,添加fastdfs-nginx模块
tar -zxvf fastdfs-nginx-module_v1.16.tar.gz
cd fastdfs-nginx-module/src
vim config 把其中的local去掉。
vim mod_fastdfs.conf
#拷贝过去,忘记拷过去的后果就是nginx启动起来,只有master没有worker
cp mod_fastdfs.conf /etc/fdfs
#停止nginx
sbin/nginx -s quit
#配置访问
cd /usr/local/nginx/conf
vim nginx.conf
#nginx
user root;
server {
listen 80;
server_name 120.78.213.118;
location / {
proxy_pass [http://tomcats](http://tomcats/);
index index.html index.htm;
}
location /group1/M00/{
ngx_fastdfs_module;
}
}
#添加模块,注意add-module的路径
./configure --prefix=/usr/local/nginx --pid-path=/var/run/nginx/nginx.pid --lock-path=/var/lock/nginx.lock --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --with-http_gzip_static_module --http-client-body-temp-path=/var/temp/nginx/client --http-proxy-temp-path=/var/temp/nginx/proxy --http-fastcgi-temp-path=/var/temp/nginx/fastcgi --http-uwsgi-temp-path=/var/temp/nginx/uwsgi --http-scgi-temp-path=/var/temp/nginx/scgi --add-module=/usr/local/software/fastdfs-nginx-module/src
make
make install
#启动nginx
sbin/nginx
http://120.78.213.118/group1/M00/00/00/rBLzJ1p4cVWAcH3hAABdrZgsqUU072_big.jpg
作者:叫我图图就可以了
链接:https://www.jianshu.com/p/70b48a150037
来源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
阿里云centos7搭建FastDFS(+nginx访问模块)
原文:https://www.cnblogs.com/jianer/p/12718548.html