yum -y install gcc automake autoconf libtool make gcc-c++ pcre* zlib openssl openssl-devel
useradd fastdfs
useradd www
cd libfastcommon-master
./make.sh
./make.sh install
cd cg_fms
./make.sh
./make.sh install
3.解压fastdfs-nginx-module
修改fastdfs-nginx-module的config文件(因为fastcommon的一些include文件安装到 /usr/include/fastcommon下了)
原来的内容是
CORE_INCS="$CORE_INCS /usr/local/include/fastdfs /usr/local/include/fastcommon/"
vim /home/nginx/fastdfs-nginx-module/src/config,修改为
CORE_INCS="$CORE_INCS /usr/include/fastdfs /usr/include/fastcommon"
3.配置
配置文件在 /etc/fdfs/目录或者源码目录的conf下面
配置Tracker服务器
mv /etc/fdfs/tracker.conf.sample /etc/fdfs/tracker.conf
cd /etc/fdfs/ 更改配置文件的base_path,这里改到/export/fastdfs下面。
sed -i 's#/home/yuqing#/export#g' *.conf
启动:
fdfs_trackerd /etc/fdfs/tracker.conf
配置Storage服务器
主要改下以下几项
vim /etc/fdfs/storage.conf
group_name=g1
base_path=/export/fastdfs
store_path0=/export/fastdfs
tracker_server=yourip:22122
启动:
fdfs_storaged /etc/fdfs/storage.conf
测试,配置文件/etc/fdfs/client.conf 路径及tracker_server
上传图片:
[root@ccj-sf fdfs]# fdfs_upload_file /etc/fdfs/client.conf /root/q.png
g1/M00/00/00/aIOW-1RWILeADL_hAACfjC0jGBg627.png
3.解压fastdfs-nginx-module
修改fastdfs-nginx-module的config文件(因为fastcommon的一些include文件安装到 /usr/include/fastcommon下了)
原来的内容是
CORE_INCS="$CORE_INCS /usr/local/include/fastdfs /usr/local/include/fastcommon/"
vim /home/nginx/fastdfs-nginx-module/src/config,修改为
CORE_INCS="$CORE_INCS /usr/include/fastdfs /usr/include/fastcommon"
各个版本的位置并不统一.所以需要根据自己的版本修改位置。
4.安装nginx
一些依赖包,如安装过可忽略。
yum -y install gcc automake autoconf libtool make gcc-c++ pcre* zlib openssl openssl-devel
添加fastdfs-nginx-module模块
[root[@ccj-sf](/user/ccj-sf) dl]# cd nginx-1.6.2
[root[@ccj-sf](/user/ccj-sf) nginx-1.6.2]# ./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-ipv6 --add-module=../fastdfs-nginx-module-master/src
make -j `cat /proc/cpuinfo | grep processor| wc -l` && make install
复制fastdfs-nginx-module源码中的配置文件到/etc/fdfs
cp /home/nginx/fastdfs-nginx-module/src/mod_fastdfs.conf /etc/fdfs
修改该配置文件
group_name=group1
tracker_server=yourip:22122
store_path0=/export/fastdfs
base_path=/export/fastdfs
复制FastDFS的配置到/etc/fdfs
修改Nginx配置文件
location /M00 {
root /export/fastdfs/data;
ngx_fastdfs_module;
}
上传文件测试:
[root[@ccj-sf](/user/ccj-sf) conf]# fdfs_test /etc/fdfs/client.conf upload /root/Jellyfish.jpg
useradd fastdfs
useradd www
cd libfastcommon-master
./make.sh
./make.sh install
cd cg_fms
./make.sh
./make.sh install
3.解压fastdfs-nginx-module
修改fastdfs-nginx-module的config文件(因为fastcommon的一些include文件安装到 /usr/include/fastcommon下了)
原来的内容是
CORE_INCS="$CORE_INCS /usr/local/include/fastdfs /usr/local/include/fastcommon/"
vim /home/nginx/fastdfs-nginx-module/src/config,修改为
CORE_INCS="$CORE_INCS /usr/include/fastdfs /usr/include/fastcommon"
3.配置
配置文件在 /etc/fdfs/目录或者源码目录的conf下面
配置Tracker服务器
mv /etc/fdfs/tracker.conf.sample /etc/fdfs/tracker.conf
cd /etc/fdfs/ 更改配置文件的base_path,这里改到/export/fastdfs下面。
sed -i 's#/home/yuqing#/export#g' *.conf
启动:
fdfs_trackerd /etc/fdfs/tracker.conf
配置Storage服务器
主要改下以下几项
vim /etc/fdfs/storage.conf
group_name=g1
base_path=/export/fastdfs
store_path0=/export/fastdfs
tracker_server=yourip:22122
启动:
fdfs_storaged /etc/fdfs/storage.conf
测试,配置文件/etc/fdfs/client.conf 路径及tracker_server
上传图片:
[root@ccj-sf fdfs]# fdfs_upload_file /etc/fdfs/client.conf /root/q.png
g1/M00/00/00/aIOW-1RWILeADL_hAACfjC0jGBg627.png
3.解压fastdfs-nginx-module
修改fastdfs-nginx-module的config文件(因为fastcommon的一些include文件安装到 /usr/include/fastcommon下了)
原来的内容是
CORE_INCS="$CORE_INCS /usr/local/include/fastdfs /usr/local/include/fastcommon/"
vim /home/nginx/fastdfs-nginx-module/src/config,修改为
CORE_INCS="$CORE_INCS /usr/include/fastdfs /usr/include/fastcommon"
各个版本的位置并不统一.所以需要根据自己的版本修改位置。
4.安装nginx
一些依赖包,如安装过可忽略。
yum -y install gcc automake autoconf libtool make gcc-c++ pcre* zlib openssl openssl-devel
添加fastdfs-nginx-module模块
[root[@ccj-sf](/user/ccj-sf) dl]# cd nginx-1.6.2
[root[@ccj-sf](/user/ccj-sf) nginx-1.6.2]# ./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-ipv6 --add-module=../fastdfs-nginx-module-master/src
make -j `cat /proc/cpuinfo | grep processor| wc -l` && make install
复制fastdfs-nginx-module源码中的配置文件到/etc/fdfs
cp /home/nginx/fastdfs-nginx-module/src/mod_fastdfs.conf /etc/fdfs
修改该配置文件
group_name=group1
tracker_server=yourip:22122
store_path0=/export/fastdfs
base_path=/export/fastdfs
复制FastDFS的配置到/etc/fdfs
修改Nginx配置文件
location /M00 {
root /export/fastdfs/data;
ngx_fastdfs_module;
}
上传文件测试:
[root[@ccj-sf](/user/ccj-sf) conf]# fdfs_test /etc/fdfs/client.conf upload /root/Jellyfish.jpg
5911

被折叠的 条评论
为什么被折叠?



