标签:
CleverCode发现fastdfs是一个很好的开源的轻量级分布式文件系统。
本次安装资源包下载:http://download.csdn.net/download/clevercode/9607300。
http.server_port=80
group_name=group1
base_path=/data0/fastdfs
store_path0=/data0/fastdfs/storage/storage0
tracker_server=192.168.101.130:22122
3.2 启动storage
# service fdfs_storaged start
3.3 查看启动
# netstat -anp | grep 23000
# cd /usr/local/src/nginx
# tar zxvf pcre-8.12.tar.gz
# cd pcre-8.12
# ./configure
# make && make install
4.2 解压fastdfs-nginx-module_v1.15.tar.gz
# cd /usr/local/src/nginx
# tar zxvf fastdfs-nginx-module_v1.15.tar.gz
4.3 安装nginx
# groupadd www #添加www组
# useradd -g www www -s /bin/false #创建nginx运行账户www并加入到www组,不允许www用户直接登录系统
创建安装目录与日志目录
a) 安装目录
# mkdir /usr/local/nginx
b) 日志目录
# mkdir /data0/logs/nginx
# chown www:www /data0/logs/nginx -R
# cd /usr/local/src/nginx
# tar zxvf nginx-1.5.0.tar.gz
# cd nginx-1.5.0
4) 配置。通常将软件安装在/usr/local/目录下。将fastdfs-nginx-module/src模块添加进来
# ./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_realip_module --add-module=/usr/local/src/nginx/fastdfs-nginx-module/src
5)编译安装
# make && make install
6) 检查是否安装成功
# cd /usr/local/nginx/sbin
# ./nginx -t
4.4 配置mod_fastdfs.conf
# cp /usr/local/src/nginx/fastdfs-nginx-module/src/mod_fastdfs.conf /etc/fdfs/
# vi /etc/fdfs/mod_fastdfs.conf
base_path=/data0/fastdfs
tracker_server=192.168.101.130:22122
group_name=group1
url_have_group_name = true
store_path0=/data0/fastdfs/storage/storage0
4.5 配置nginx.conf
# vi /usr/local/nginx/conf/nginx.conf
location /group1/M00 {
root /data0/fastdfs/storage/storage0/data;
ngx_fastdfs_module;
}
4.6 启动nginx
# service iptables stop
# cd /usr/local/nginx/sbin/
# ./nginx
base_path=/tmp
tracker_server=192.168.101.130:22122
http.tracker_server_port=80
6.2 上传txt
/usr/local/bin/fdfs_test /etc/fdfs/client.conf upload test.txt
6.3 上传图片
# /usr/local/bin/fdfs_test /etc/fdfs/client.conf upload clevercode.png
标签:
原文地址:http://blog.csdn.net/clevercode/article/details/52244358