Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install FastDFS and nginx in centos 7.x system

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article will explain in detail how to install FastDFS and nginx in the centos 7.x system. The content of the article is of high quality, so the editor shares it for you as a reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.

FastDFS

The name of the system software to be used in the Avalon edited this page on 29 Sep 2018 6 revisions environment describes some common function packages separated by centos 7.xlibfatscommon FastDFS ontology fastdfs-nginx-module FastDFS and nginx's associated module nginx nginx1.15.4 compilation environment yum install git gcc gcc-c++ make automake autoconf libtool pcre pcre-devel zlib zlib-devel openssl-devel wget vim-y disk directory description location all installation packages / usr/local/src data stores Storage location / home/dfs/# here I put all the logs in dfs mkdir / home/dfs # create data storage directory cd / usr/local/src # change to the installation directory ready to download installation package install libfatscommongit clone https://github.com/happyfish200/libfastcommon.git-- depth 1cd libfastcommon/./make.sh &. / make.sh install # compile install FastDFScd. / # return to the previous directory Record git clone https://github.com/happyfish200/fastdfs.git-- depth 1cd fastdfs/./make.sh & &. / make.sh install # compile and install # configuration file prepare cp / etc/fdfs/tracker.conf.sample / etc/fdfs/tracker.confcp / etc/fdfs/storage.conf.sample / etc/fdfs/storage.confcp / etc/fdfs/client.conf.sample / etc/fdfs/client.conf # client file Cp / usr/local/src/fastdfs/conf/http.conf / etc/fdfs/ # for nginx access cp / usr/local/src/fastdfs/conf/mime.types / etc/fdfs/ # for nginx access install fastdfs-nginx-modulecd.. / # return to the previous directory git clone https://github.com/happyfish200/fastdfs-nginx-module.git-- depth 1cp / usr/local/src/fastdfs-nginx-module/src/mod_fastdfs. Conf / etc/fdfs install nginxwget http://nginx.org/download/nginx-1.15.4.tar.gz # download nginx package tar-zxvf nginx-1.15.4.tar.gz # decompress cd nginx-1.15.4/# add fastdfs-nginx-module module. / configure-- add-module=/usr/local/src/fastdfs-nginx-module/src/ make & & make install # compile and install stand-alone deployment tracker configuration # server ip is 192. 168.52. I recommend downloading these files with ftp to modify vim / etc/fdfs/tracker.conf# locally as follows: port=22122 # tracker server port (default 22122) Generally do not modify) base_path=/home/dfs # the root directory where logs and data are stored storage configuration vim / etc/fdfs/storage.conf# needs to be modified as follows: port=23000 # storage service port (default 23000) Generally does not modify) base_path=/home/dfs # data and log file storage root directory store_path0=/home/dfs # first storage directory tracker_server=192.168.52.1:22122 # tracker server IP and port http.server_port=8888 # http access file port (default 8888, modify as appropriate Consistent with nginx) client test vim / etc/fdfs/client.conf# needs to be modified as follows: base_path=/home/dfstracker_server=192.168.52.1:22122 # tracker server IP and port # post-save test Returning ID indicates success, for example: group1/M00/00/00/xx.tar.gzfdfs_upload_file / etc/fdfs/client.conf / usr/local/src/nginx-1.15.4.tar.gz configuration nginx access to vim / etc/fdfs/mod_fastdfs.conf# needs to be modified as follows: tracker_server=192.168.52.1:22122 # tracker server IP and port url_have_group_name=truestore_path0=/home/dfs# configuration nginx.configvim / Usr/local/nginx/conf/nginx.conf# adds the following configuration server {listen 8888 # # this port is the same http.server_port in storage.conf ~ / group [0-9] / {ngx_fastdfs_module;} error_page 500502503504 / 50x.hml; location = / 50x.html {root html } # Test download Use an external browser to access the nginx installation package that has just been passed Reference returned ID http://192.168.52.1:8888/group1/M00/00/00/wKgAQ1pysxmAaqhAAA76tz-dVgg.tar.gz# pop-up download stand-alone deployment all run through distributed deployment tracker configuration # Server ip is 192.168.52.2192.168.52.3192.168.52.I recommend downloading these files with ftp to modify vim / etc/fdfs/tracker.conf# locally the contents that need to be modified are as follows: port=22122 # tracker server port (default 22122 Generally do not modify) base_path=/home/dfs # the root directory where logs and data are stored storage configuration vim / etc/fdfs/storage.conf# needs to be modified as follows: port=23000 # storage service port (default 23000) Generally does not modify) base_path=/home/dfs # data and log files storage root directory store_path0=/home/dfs # first storage directory tracker_server=192.168.52.2:22122 # server 1tracker_server=192.168.52.3:22122 # server 2tracker_server=192.168.52.4:22122 # server 3http.server_port=8888 # http access file port (default 8888, modify as appropriate Consistent with nginx) client test vim / etc/fdfs/client.conf# needs to be modified as follows: base_path=/home/moe/dfstracker_server=192.168.52.2:22122 # server 1tracker_server=192.168.52.3:22122 # server 2tracker_server=192.168.52.4:22122 # server "post-save test" Returning ID indicates success, for example: group1/M00/00/00/xx.tar.gzfdfs_upload_file / etc/fdfs/client.conf / usr/local/src/nginx-1.15.4.tar.gz configure nginx to access vim / etc/fdfs/mod_fastdfs.conf#, the contents that need to be modified are as follows: tracker_server=192.168.52.2:22122 # server 1tracker_server=192.168.52.3:22122 # server 2tracker_server=192.168.52 .4usr/local/nginx/conf/nginx.conf# 22122 # server 3url_have_group_name=truestore_path0=/home/dfs# configuration nginx.configvim / usr/local/nginx/conf/nginx.conf# add the following configuration server {listen 8888 # # this port is the same http.server_port in storage.conf ~ / group [0-9] / {ngx_fastdfs_module;} error_page 500502503504 / 50x.hml; location = / 50x.html {root html }} start firewall # cannot use systemctl stop firewalld.service # shut down systemctl restart firewalld.service # restart tracker/etc/init.d/fdfs_trackerd start # start tracker service / etc/init.d/fdfs_trackerd restart # restart tracker service / etc/init.d/fdfs_trackerd stop # stop tracker service chkconfig fdfs_trackerd on # self-start tracker service storage/etc/init.d/fdfs_storaged start # start storage service Service / etc/init.d/fdfs_storaged restart # restart storage service / etc/init.d/fdfs_storaged stop # stop storage service chkconfig fdfs_storaged on # self-start storage service nginx/usr/local/nginx/sbin/nginx # start nginx/usr/local/nginx/sbin/nginx-s reload # restart nginx/usr/local/nginx/sbin/nginx-s stop # stop nginx detection cluster / usr/bin/fdfs_monitor / etc/fdfs/storage.conf# will Show how many servers there will be three will show the details of Storage 1-Storage 3 description configuration file tracker_server # how many servers write names of several group_name # addresses named bind_addr # servers ip binding store_path_count # store_path (numbers) how many store_path (numbers) # set several storage addresses write a few problems that you may encounter starting with 0 If it is not a root user, you must add sudo to everything except the command of cd. If it is not the root user, compile and install separately. If the upload succeeds, but nginx reports error 404, first check whether the store_path0 in the mod_fastdfs.conf file is consistent. If nginx cannot access, first check whether the firewall and the mod_fastdfs.conf file tracker_server are consistent if not in / usr/local. / src folder installation may cause compilation errors the tutorial adds something to the previous huayanYu (small pot cover) In essence, it is a tutorial written by huayanYu (small pot lid) to be smile Pages 2HomeConfiguration Add a custom sidebarClone this wiki locally on how to install FastDFS and nginx in the centos 7.x system to share here. I hope the above content can be of some help and learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report