linux安装libfastcommon+fastdfs+nginx

安装依赖包

yum install git gcc gcc-c++ make automake autoconf libtool pcre pcre-devel zlib zlib-devel openssl-devel -y

安装libfastcommon

cd /opt/fastdfs
//下载
git clone https://github.com/happyfish100/libfastcommon.git --depth 1
cd libfastcommon
//安装
./make.sh && ./make.sh install

安装fastdfs

cd /opt/fastdfs
//下载
git clone https://github.com/happyfish100/fastdfs.git --depth 1
cd fastdfs
//安装
./make.sh && ./make.sh install

配置tracker

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

修改base_path = /fastdfs/tracker

# 创建上面配置的tracker目录
mkdir -p /fastdfs/tracker

# 启动tracker
/etc/init.d/fdfs_trackerd start
#查看启动情况
[root@192 fdfs]# netstat -tunlp | grep fdfs
tcp        0      0 0.0.0.0:22122           0.0.0.0:*               LISTEN      11333/fdfs_trackerd

#设置tracker开机启动
vim /etc/rc.d/rc.local
加入这句:
/etc/init.d/fdfs_trackerd start

配置storage

cd /etc/fdfs
cp storage.conf.sample storage.conf
vim storage.conf
做如下修改:
base_path = /fastdfs/storage
store_path0 = /fastdfs/file
tracker_server = 192.168.25.131:22122 #此处IP根据实际填写

#创建需要的storage目录
mkdir -p /fastdfs/storage
mkdir -p /fastdfs/file

#启动storage
/etc/init.d/fdfs_storaged start

#设置storage开机启动:
vim /etc/rc.d/rc.local
加入这行:
/etc/init.d/fdfs_storaged start

上传测试

修改客户端配置文件

cd /etc/fdfs
cp /etc/fdfs/client.conf.sample /etc/fdfs/client.conf 
vim client.conf

做如下修改

base_path = /fastdfs/client
tracker_server = 192.168.25.131:22122 #IP根据实际填写

创建一个txt文件,并上传

[root@localhost fdfs]# echo "hello">a.txt
[root@localhost fdfs]# /usr/bin/fdfs_upload_file /etc/fdfs/client.conf a.txt 
group1/M00/00/00/wKgZg187jumAUztfAAAABjY6MCA472.txt
#这串返回值后面测试要用,记下来

安装nginx

安装

cd /opt
wget http://nginx.org/download/nginx-1.14.0.tar.gz #下载
tar -zxf nginx-1.14.0.tar.gz #解压
cd nginx-1.14.1/
#安装到/usr/local/nginx
./configure --prefix=/usr/local/nginx
make
make install

配置

cd /usr/local/nginx/conf
vim nginx.conf

加上红框部分:
在这里插入图片描述

启动或重启nginx

cd ../sbin/
./nginx
或者
./nginx -s reload

测试下载

打开浏览器,输入地址:

http://192.168.25.131/group1/M00/00/00/wKgZg187jumAUztfAAAABjY6MCA472.txt

可以正常访问,则说明安装成功

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

°Fuhb

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值