b2科目四模拟试题多少题驾考考爆了怎么补救
b2科目四模拟试题多少题 驾考考爆了怎么补救

centos7安装FastDFS和nginx

电脑杂谈  发布时间:2020-02-02 14:01:40  来源:网络整理

fastdfs zimg_fastdfs client_fastdfs nginx

centos7安装FastDFS和nginx

输入ifconfig 看本机的网络ip

centos7安装FastDFS和nginx输入vi /etc/sysconfig/network-scripts/ifcfg-ens33

把文件里的ONBOOT=yes输入service network start 开启网关

centos7安装FastDFS和nginx输入ip addr show 查找本机的外网ip地址

centos7安装FastDFS和nginx

输入yum -y install lrzsz
输入yum -y install gcc-c++安装gcc环境
输入yum -y install libevent 安装FastDFS依赖libevent库

输入:yum -y install zlib zlib-devel pcre pcre-devel gcc gcc-c++ openssl openssl-devel libevent libevent-devel perl unzip net-tools wget

下载缺少的东西

注意:如果tracker 和storage服务在一台机器上,一下步骤可以不需要fastdfs nginx,如果tracker和storage在不同的机器上,以下的方法一定要执行。

安装centos7 同上;

安装libfastcommon 同上

进入/usr/local目录下:cd /usr/local

传入FastDFS压缩包: rz

解压:tar -zxvf FastDFS_v5.05.tar.gz

进入FastDFS目录: cd FastDFS

fastdfs zimg_fastdfs client_fastdfs nginx

编译 . ./make.sh

安装 ./make.sh install

安装顺利将安装目录下的conf下的文件拷贝到/etc/fdfs/下。

进入/etc/fdfs目录: cd /etc/fdfs/

复制Storage配置文件 :cp storage.conf.sample storage.conf

创建文件夹用户传输数据: mkdir -p /home/FastDFS/fafs_storage

修改storage.conf文件: vi storage.conf

Base_path =/home/FastDFS

Store_path0=/home/FastDFS/fdfs_storage

tracker_server=ip(tracker服务器的ip):221

启动storage服务 :/usr/bin/fdfs_storaged /etc/fdfs/storage.conf

查看是否开启: netstat -unltp | grep fdfs

进入/usr/local/目录 cd /usr/local

上传nginx压缩包 rz

解压nginx压缩包 tar -zxvf nginx-1.8.0.tar.gz

上传fastdfs-nginx-module_v1.16.tar.gz 整合包 rz

解压整合包 tar -zxvf fastdfs-nginx-module_v1.16.tar.gz

fastdfs zimg_fastdfs nginx_fastdfs client

进入fastdfs-nginx-module/src目录:cd /usr/local/fastdfs-nginx-module/src

修改配置文件:vi config

#将CORE_INCS,CORE_LIBS,中的/usr/local/路径改为/usr/

CORE_INCS="$CORE_INCS/usr/include/fastdfs /usr/include/fastcommon/"

CORE_LIBS="$CORE_LIBS -L/usr/lib -lfastcommon -lfdfsclient"

转移mod_fastdfs.conf配置文件:cp mod_fastdfs.conf /etc/fdfs

修改/etc/fdfs/mod_fastdfs.conf配置文件 :cd /etc/fdfs/

修改 :vi mod_fastdfs.conf

base_path=/home/FastDFS

tracker_server=yourid:22122

url_have_group_name = true

store_path0=/home/FastDFS/fdfs_storage

将libfdfsclient.so 拷贝至/usr/lib下:cp /usr/lib64/libfdfsclient.so /usr/lib/

创建nginx/client目录:mkdir -p /var/temp/nginx/client

进入Nginx目录:cd /usr/local/nginx-1.8.3

安装Nginx:

[root@localhost nginx-1.10.3]# ./configure \

fastdfs nginx_fastdfs client_fastdfs zimg

--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/fastdfs-nginx-module/src

(注意要紧跟着写)

#编译: make

安装: make install

修改Nginx配置文件

创建数据目录 mkdir /home/FastDFS/fdfs_storage/data

fastdfs nginx_fastdfs zimg_fastdfs client

进入nginx目录:cd /usr/local/nginx

[root@localhost nginx]# cd conf/

[root@localhost conf]# vim nginx.conf

server {

listen80;

server_name 192.168.134.133;

location /group1/M00/{

root /home/FastDFS/fdfs_storage/data;

ngx_fastdfs_module;

}

}

启动:

[root@localhost nginx]# cd sbin

[root@localhost sbin]# ./nginx

ngx_http_fastdfs_set pid=6203

要开启centos的防火墙:

firewall-cmd --zone=public --add-port=80/tcp --permanent (--permanent永久生效fastdfs nginx,没有此参数重启后失效)

让端口生效

firewall-cmd --reload


本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/jisuanjixue/article-139355-1.html

    相关阅读
      发表评论  请自觉遵守互联网相关的政策法规,严禁发布、暴力、反动的言论

      热点图片
      拼命载入中...