• 欢迎访问水熊虫网站,这里是我个人的工作博客,内容大多是遇到问题完善后,会在这里进行总结归纳内容! QQ群
  • 网站导航中的友情链接专栏上线,更新的都是自己这三年整理的一些东西,感兴趣可以看看!
  • 你所浪费的今天,是昨天死去的人奢望的明天。你所厌恶的现在,是未来的你回不去的曾经!

CentOS6.9部署Redis3.2.9+FastDFS_4.06+Nginx1.5.0

云主机问题 WaterBear 3年前 (2017-10-28) 261次浏览 已收录 扫描二维码

CentOS6.9部署Redis3.2.9+FastDFS_4.06+Nginx1.5.0

1、 上传Redis工具包

CentOS6.9部署Redis3.2.9+FastDFS_4.06+Nginx1.5.0

2、 安装Redis

1、 编译安装

解压redis: tar -zxvf redis-3.2.9.tar.gz

重命名redis:mv redis-3.2.9 /usr/local/redis

编译安装redis

make MALLOC=libc

CentOS6.9部署Redis3.2.9+FastDFS_4.06+Nginx1.5.0

问题:gcc找不到的错误

解决: yum install gcc 命令安装gcc

CentOS6.9部署Redis3.2.9+FastDFS_4.06+Nginx1.5.0

CentOS6.9部署Redis3.2.9+FastDFS_4.06+Nginx1.5.0

CentOS6.9部署Redis3.2.9+FastDFS_4.06+Nginx1.5.0

make install

CentOS6.9部署Redis3.2.9+FastDFS_4.06+Nginx1.5.0

2、 修改配置文件

(1)修改配置文件 redis.conf

只允许本机客户端连接

使用保护模式

bind 127.0.0.1

......

protected-mode yes

修改:

1、# bind 127.0.0.1

2、 protected-mode no

或者

bind 192.168.8.159 //指定IP访问

bind 0.0.0.0 //任意IP都能访问

CentOS6.9部署Redis3.2.9+FastDFS_4.06+Nginx1.5.0

3、 启动redis

nohup redis-server &

CentOS6.9部署Redis3.2.9+FastDFS_4.06+Nginx1.5.0

CentOS6.9部署Redis3.2.9+FastDFS_4.06+Nginx1.5.0

3、 安装FastDFS

安装之前确认先安装了《Linux中必备常用支持库的安装(CentOS-6.5)》

在CentOS安装软件的时候,可能缺少一部分支持库,而报错。这里首先安装系统常用的支持库。那么在安装的时候就会减少很多的错误的出现。# yum install -y gcc gdb strace gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs patch e2fsprogs-devel krb5-devel libidn libidn-devel openldap-devel nss_ldap openldap-clients openldap-servers libevent-devel libevent uuid-devel uuid mysql-devel

CentOS6.9部署Redis3.2.9+FastDFS_4.06+Nginx1.5.0

CentOS6.9部署Redis3.2.9+FastDFS_4.06+Nginx1.5.0

1、 上传FastDFS

CentOS6.9部署Redis3.2.9+FastDFS_4.06+Nginx1.5.0

2、 安装FastDFS

tar -zxvf FastDFS_4.06.tar.gz

mv FastDFS /usr/local/fastDFS

vim make.sh

去掉注释WITH_LINUX_SERVICE=1

CentOS6.9部署Redis3.2.9+FastDFS_4.06+Nginx1.5.0

./make.sh

CentOS6.9部署Redis3.2.9+FastDFS_4.06+Nginx1.5.0

./make.sh install

CentOS6.9部署Redis3.2.9+FastDFS_4.06+Nginx1.5.0

3、 配置tracker

(1) 创建与配置tracker数据目录

mkdir -p /data0/fastdfs/tracker

vim /etc/fdfs/tracker.conf

base_path=/data0/fastdfs/tracker

(2) 启动tracker

service fdfs_trackerd start

CentOS6.9部署Redis3.2.9+FastDFS_4.06+Nginx1.5.0

CentOS6.9部署Redis3.2.9+FastDFS_4.06+Nginx1.5.0

4、配置storage

(1)创建与配置storage目录

mkdir -p /data0/fastdfs/storage/storage0

vim /etc/fdfs/storage.conf

http.server_port=80group_name=group1base_path=/data0/fastdfsstore_path0=/data0/fastdfs/storage/storage0tracker_server=127.0.0.1:22122

(2)启动storage

service fdfs_storaged start

CentOS6.9部署Redis3.2.9+FastDFS_4.06+Nginx1.5.0

出现问题:127.0.0.1:22122 无效

CentOS6.9部署Redis3.2.9+FastDFS_4.06+Nginx1.5.0解决问题:更改为静态IP 192.168.225.105:22122

CentOS6.9部署Redis3.2.9+FastDFS_4.06+Nginx1.5.0

查看是否启动

CentOS6.9部署Redis3.2.9+FastDFS_4.06+Nginx1.5.0

4、 安装Nginx

1、安装pcre-8.12.tar.gz

cd /usr/local/src/nginx

tar zxvf pcre-8.12.tar.gz

cd pcre-8.12 ./configuremake && make install

2、安装Nginx

(1) 解压fastdfs-nginx-module_v1.15.tar.gz

cd /usr/local/src/nginxtar zxvf fastdfs-nginx-module_v1.15.tar.gz

(2) 添加用户组、创建日志目录、解压nginx-1.5.0.tar.gz

groupadd www 添加www组

useradd -g www www -s /bin/false #创建nginx运行账户www并加入到www组,不允许www用户直接登录系统

mkdir /data0/logs/nginxchown www:www /data0/logs/nginx -Rcd /usr/local/src/nginxtar zxvf nginx-1.5.0.tar.gzcd nginx-1.5.0

(3) 配置、编译、安装

./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

CentOS6.9部署Redis3.2.9+FastDFS_4.06+Nginx1.5.0

make && make install

CentOS6.9部署Redis3.2.9+FastDFS_4.06+Nginx1.5.0

./nginx –t 检查安装是否成功

CentOS6.9部署Redis3.2.9+FastDFS_4.06+Nginx1.5.0

3、配置mod_fastdfs.conf

cp /usr/local/src/nginx/fastdfs-nginx-module/src/mod_fastdfs.conf /etc/fdfs/vim /etc/fdfs/mod_fastdfs.conf

CentOS6.9部署Redis3.2.9+FastDFS_4.06+Nginx1.5.0

base_path=/data0/fastdfstracker_server=192.168.225.105:22122group_name=group1url_have_group_name = truestore_path0=/data0/fastdfs/storage/storage0

4、配置nginx.conf

vim /usr/local/nginx/conf/nginx.conflocation /group1/M00 {root /data0/fastdfs/storage/storage0/data;ngx_fastdfs_module;}

5、启动Nginx

cd /usr/local/nginx/sbin/

./nginx

CentOS6.9部署Redis3.2.9+FastDFS_4.06+Nginx1.5.0

6、测试

(1)配置client.conf

vim /etc/fdfs/client.conf

base_path=/tmptracker_server=192.168.225.105:22122http.tracker_server_port=80

(2)上传

/usr/local/bin/fdfs_test /etc/fdfs/client.conf upload /data/test/test1.txt

CentOS6.9部署Redis3.2.9+FastDFS_4.06+Nginx1.5.0

CentOS6.9部署Redis3.2.9+FastDFS_4.06+Nginx1.5.0

所有进程

CentOS6.9部署Redis3.2.9+FastDFS_4.06+Nginx1.5.0


WaterBear , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:CentOS6.9部署Redis3.2.9+FastDFS_4.06+Nginx1.5.0
喜欢 (0)
[[email protected]]
分享 (0)