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

Ubuntu+FastDFS+Nginx

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

First, install libfastcommon

1. Wget https://github.com/happyfish200/libfastcommon/archive/V1.0.7.tar.gz

2. Tar-xvf V1.0.7.tar.gz

3 、 cd libfastcommon-1.0.7

4 、. / make.sh

5 、. / make.sh install

6. Create a soft link:

Ln-s / usr/lib64/libfastcommon.so / usr/local/lib/libfastcommon.so

Ln-s / usr/lib64/libfastcommon.so / usr/lib/libfastcommon.so

Ln-s / usr/lib64/libfdfsclient.so / usr/local/lib/libfdfsclient.so

Ln-s / usr/lib64/libfdfsclient.so / usr/lib/libfdfsclient.so

Second, install FastDFS

1. Wget https://github.com/happyfish200/fastdfs/archive/V5.05.tar.gz

2. Tar-zxvf V5.05.tar.gz-C / usr/local

3 、 cd / usr/local/fastdfs-5.05/

4 、. / make.sh

5 、. / make.sh install

6 、 cd / etc/fdfs

Profile Settin

Cd / etc/fdfs

Cp tracker.conf.sample tracker.conf

Cp storage.conf.sample storage.conf

Cp client.conf.sample client.conf

Modify the configuration file

Tracker.conf:

Base_path=/data/fastdfs

Storage.conf:

Base_path=/data/fastdfs/storage

Base_path0=/data/fastdfs/storage

Tracker_server=xx:xx:xx:xx:22122

Client.conf:

Base_path=/data/fastdfs/client

Tracker_server=xx:xx:xx:xx:22122

Start:

Cd / usr/fastdfs-5.05/storage

Cd / usr/fastdfs-5.05/trackerd

Fdfs_trackerd / etc/fdfs/tracker.conf

Fdfs_storaged / etc/fdfs/storage.conf

Third, install Nginx

Wget http://nginx.org/download/nginx-1.8.0.tar.gz

Wget http://sourceforge.net/projects/fastdfs/files/FastDFS%20Nginx%20Module%20Source%20Code/fastdfs-nginx-module_v1.16.tar.gz/download

Tar zxf fastdfs-nginx-module_v1.16.tar.gz & & tar zxf nginx-1.8.0.tar.gz

Modify the configuration file

Cd fastdfs-nginx-module/src

Vi config:

Remove all the local in it

Ulimit-SHn 102400 useradd-s / sbin/nologin wwwcd nginx-1.8.0 / configure-- user=www-- group=www-- add-module=../fastdfs-nginx-module/src/-- prefix=/usr/local/nginx-- with-http_stub_status_module-- with-http_ssl_module-- with-http_realip_module make make install

Error report: error: the HTTP rewrite module requires the PCRE library

Sudo apt-get update

Sudo apt-get install libpcre3 libpcre3-dev

Sudo apt-get install openssl libssl-dev

Nginx.conf:

Listen 8888

Location / group1/M00/ {

Alias / data/fastdfs/storage/data/

}

Start Nginx:

Cd / usr/local/nginx/sbin

. / nginx

View Nginx and DFS launches:

Netstat-npl | grep-E "nginx | fdfs"

Cd / usr/local/nginx/sbin/

Modify configuration and restart Nginx:./nginx-s reload

Load the configuration file to start:. / nginx- c / usr/FastDFS/nginx-1.8.0/conf/nginx.conf

Stop: nginx-s stop

View the port number:

Netstat-ntpl

3. Uninstall Nginx

Sudo apt-get-purge remove nginx

Sudo apt-get autoremove

Test upload:

/ usr/bin/fdfs_upload_file / etc/fdfs/client.conf / usr/FastDFS/001.jpg

/ usr/bin/fdfs_test / etc/fdfs/client.conf upload / usr/FastDFS/001.jpg

Nginx.conf regular expression:

Https://segmentfault.com/a/1190000002797601

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

Servers

Wechat

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

12
Report