In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Installation environment
Centos
Environmental dependence:
Yum-y install gccyum install-y pcre pcre-develyum install-y zlib zlib-develyum install-y openssl openssl-devel# has no need for make to install makeyum install-y make
Installation configuration process
1. Create a fastdfs directory:
Mkdir-p / fastdfs/trackermkdir-p / fastdfs/storagemkdir-p / fastdfs/logs
1. Download and install libfastcomman (basic environment)
Wget https://github.com/happyfish200/libfastcommon/archive/V1.0.7.tar.gztar-zxvf V1.0.7.tar.gzcd libfastcommon-1.0.7./make.sh & &. / make.sh install# copies files to solve the problem of lib configuration file path in FastDFS. Cp / usr/lib64/libfastcommon.so / usr/local/lib/libfastcommon.socp / usr/lib64/libfastcommon.so / usr/lib/libfastcommon.so
two。 Download and install FastDFS. After the installation is complete, the default configuration file directory is: / etc/fdfs/, default command is placed in / usr/bin/, starting with fdfs_.
Wget https://github.com/happyfish200/fastdfs/archive/V5.05.tar.gztar-zxvf V5.05.tar.gzcd fastdfs-5.05/./make.sh & &. / make.sh install
3. Configure tracker
# copy the configuration file to the / etc/fdfs directory cd... / fastdfs-5.05/confcp * / etc/fdfs/sudo vim tracker.conf
Modify the bath_path to configure as follows:
Base_path=/fastdfs/tracker
Start tracker:
Fdfs_trackerd / etc/fdfs/tracker.conf start
4. Configure storage
Vim storage.conf
Modify the configuration item as follows:
# Log directory base_path=/fastdfs/storage # Storage directory store_path0=/fastdfs/storage # tracker node tracker_server=192.168.1.4:22122
Start storage:
Fdfs_storaged / etc/fdfs/storage.conf start
5. Configure client
Vim client.conf
The configuration items are as follows:
# tracker node tracker_server=192.168.1.4:22122# log path base_path=/fastdfs/logs
6. Install nginx and fastdfs-nginx-module. It is not recommended to install nginx directly using yum or apt, because when you install the fastdfs-nginx-module module, you need to compile again, which is troublesome.
# download fastdfs-nginx-module module cd / fastdfswget https://github.com/happyfish200/fastdfs-nginx-module/archive/5e5f3566bbfa57418b5506aaefbe107a42c9fcb1.zipunzip 5e5f3566bbfa57418b5506aaefbe107a42c9fcb1.zipmv fastdfs-nginx-module-5e5f3566bbfa57418b5506aaefbe107a42c9fcb1 fastdfs-nginx-module# download nginxwget http://nginx.org/download/nginx-1.12.1.tar.gztar-zxvf nginx-1.12.1.tar.gz# install nginx and fsatdfs-nginx-modulecd nginx-1.12.1./configure-- prefix=/opt/nginx-- sbin -path=/usr/bin/nginx-- add-module=/fastdfs/fastdfs-nginx-module/srcmakemake install
7. Configure the mod_fastdfs.conf file
Cd / fastdfs/fastdfs-nginx-module/srccp mod_fastdfs.conf / etc/fdfs/vim / etc/fdfs/mod_fastdfs.conf
The configuration items are as follows:
Connect_timeout=10 # client access file connection timeout (in seconds) base_path=/fastdfs/tmp # storage log path tracker_server=192.168.1.4:22122 # tracker service IP and port url_have_group_name=true # access link prefix plus group name group_name=group1 # and storage one-to-one corresponding store_path0=/fastdfs/storage # file storage path
8. Configure nginx
Cd / opt/nginx/conf/vim nginx.conf
The configuration items are as follows, that is, when accessing a resource starting with group1, it is handed over to fastdfs-nginx-module for processing:
# listen for domain names with group0 to group9, and hand them over to fastdfs-nginx-module module to handle location ~ / group ([0-9]) / {ngx_fastdfs_module;}
test
1. Upload pictures
Fdfs_upload_file / etc/fdfs/client.conf ~ / Desktop/test.png
A string will be returned to us at this point.
two。 Access test, browser input:
192.168.1.4/group1/M00/00/00/wKgBBF6Cu4GATwTvABy5G9p0iEE119.jpg
The visit was successful!
So far, this is the end of this article on how to build a picture server in Nginx+FastDFS. For more information about how to build a picture server in Nginx+FastDFS, please search for previous articles or continue to browse the relevant articles below. I hope you will support me in the future!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.