CentOS8 install fastdfs6.06

1. Prepare the environment#

Prepare the following tar package:

1 1
fastdfs-6.06.tar.gz -
libfastcommon-1.0.43.tar.gz -
fastdfs-nginx-module-1.22.tar.gz -
nginx-1.17.7.tar.gz -

download link:

fastdfs-nginx-module,libfastcommon,fastdfs

nginx address

1、 Use wget command to download the compressed package, if there is no wget command, use yum command to install

yum install wget

2、 Download fastdfs

wget -c "https://github.com/happyfish100/fastdfs/archive/V6.06.tar.gz" \
- O fastdfs-6.06.tar.gz

3、 Download libfastcommon

wget -c "https://github.com/happyfish100/libfastcommon/archive/V1.0.43.tar.gz" \
- O libfastcommon-1.0.43.tar.gz

4、 Download fastdfs-nginx-module

wget -c "https://github.com/happyfish100/fastdfs-nginx-module/archive/V1.22.tar.gz" \
- O fastdfs-nginx-module-1.22.tar.gz

5、 Download nginx

wget -c http://nginx.org/download/nginx-1.17.7.tar.gz

6、 Install compilation tools and library files

yum -y install make zlib zlib-devel gcc-c++ libtool  openssl openssl-devel

7、 Turn off the firewall in the test environment

systemctl stop firewalld.service

8、 Disable firewall at boot

systemctl disable firewalld.service

9、 View firewall status

firewall-cmd --state

Two, unzip, compile and install#

1、 Unzip the downloaded package##

tar -zxvf fastdfs-6.06.tar.gz
tar -zxvf fastdfs-nginx-module-1.22.tar.gz
tar -zxvf libfastcommon-1.0.43.tar.gz
tar -zxvf nginx-1.17.7.tar.gz

2、 Compile and install##

2.1、 Compile and install libfastcommon

1、 Enter the unzipped directory

cd /root/download/libfastcommon-1.0.43

2、 Compile and install

. /make.sh &&./make.sh install

3、 an examination

ls /usr/lib64|grep libfastcommon
ls /usr/lib|grep libfastcommon

It is successful if libfastcommon.so appears

2.2、 Compile and install fastdfs

1、 Enter the unzipped directory

cd /root/download/fastdfs-6.06

2、 Compile and install

. /make.sh &&./make.sh install

3、 an examination

ls /usr/bin|grep fdfs

4、 Enable profile

cd /etc/fdfs/

cp storage.conf.sample storage.conf

cp client.conf.sample client.conf

cp tracker.conf.sample tracker.conf

mkdir -p /fastdfs/tracker

5、 Modify the tracker.conf file

vi /etc/fdfs/tracker.conf

base_path = /fastdfs/tracker

6、 Start tracker service

/etc/init.d/fdfs_trackerd start

7、 Check if the service is started

ps -ef|grep fdfs`

8、 Modify the storage.conf file

vi /etc/fdfs/storage.conf

base_path = /fastdfs/storage store_path0 = /fastdfs/storageundefinedtracker_server = 192.168.0.154:22122

http.server_port = 80

9、 Create a directory

mkdir -p /fastdfs/storage

10、 Start storage service

/etc/init.d/fdfs_storaged start

11、 Set boot up

vi /etc/rc.d/rc.local

Join configuration

/etc/init.d/fdfs_trackerd startundefined/etc/init.d/fdfs_storaged start

12、 Edit the client.conf file

vi /etc/fdfs/client.conf 

modify

base_path=/fastdfs/trackerundefinedtracker_server=192.168.0.154:22122

2.3、 Install nginx and fastdfs-nginx-module

1、 Install pcre

yum -y install pcre pcre-devel

2、 Enter the unzipped directory

cd /root/download/nginx-1.17.7

3、 Add http_stub_status_module module

. /configure --prefix=/usr/local/nginx --with-http_stub_status_module

4、 Enter /root/download/fastdfs-nginx-module-1.22/src/

cd /root/download/fastdfs-nginx-module-1.22/src/

5、 Edit configuration file

vi config

6、 Replace /usr/local with /usr in the config file

: %s+/usr/local+/usr

7、 Enter the nginx decompression directory

cd /root/download/nginx-1.17.7

8、 Add fastdfs-nginx-module

. /configure --add-module=/root/download/fastdfs-nginx-module-1.22/src/

9、 Compile and install

make && make install

10、 Copy and modify the configuration file in fastdfs-ngin-module

cp /root/download/fastdfs-nginx-module-1.22/src/mod_fastdfs.conf /etc/fdfs/
vi /etc/fdfs/mod_fastdfs.conf

Change setting

connect_timeout=10undefinedtracker_server=192.168.0.154:22122

url_have_group_name = true

store_path0=/fastdfs/storage

11、 Enter the fastdfd source code conf directory

cd /root/download/fastdfs-6.06/conf/

11、 Copy the two files http.conf and mime.types to the /etc/fdfs/ directory

cp http.conf mime.types /etc/fdfs/

12、 Create a soft connection, create a soft connection in the /fastdfs/storagefile storage directory, and link it to the directory where the data is actually stored

ln -s /fastdfs/storage/data//fastdfs/storage/data/M00

13、 Edit nginx configuration

vi /usr/local/nginx/conf/nginx.conf

Change setting

server {
 listen       80;
 server_name  192.168.0.154;
 location ~/group([0-9])/M00 {
   root  /fastdfs/storage/data;
   ngx_fastdfs_module;}}

14、 Start nginx

/usr/local/nginx/sbin/nginx

Three, test#

1、 Download test picture to local

wget -c "https://gss0.baidu.com/-vo3dSag_xI4khGko9WTAnF6hhy/zhidao/wh%3D600%2C800/sign=0f6379cdd8ca7bcb7d2ecf298e39475b/42a98226cffc1e17f7efcc3f4590f603738de968.jpg"-O boy.jpg

2、 Upload test image

/usr/bin/fdfs_upload_file /etc/fdfs/client.conf /root/download/boy.jpg

Get the return file name

group1/M00/00/00/wKgAml4RxbyARj9lAACxR4LEYRg912.jpg

Splicing with ip: http://192.168.0.154/group1/M00/00/00/wKgAml4RxbyARj9lAACxR4LEYRg912.jpg

Recommended Posts

CentOS8 install fastdfs6.06
1.5 Install Centos7
Centos6 install Python2.7.13
Centos7.3 install nginx
CentOS7.2 install Mysql5.7.13
CentOS install Redmine
Centos7 install Python 3.6.
CentOS7 install MySQL
Centos7 install protobuf
CentOS 7 install Docker
CentOS7 install GlusterFS
CentOS 7.4 install Zabbix 3.4
CentOS7 install Docker
CentOS install Python 3.6
Vmware install CentOS6
centos7 install docker-ce 18.01.0
CentOS 7.2 install MariaDB
CentOS 7 install Hadoop 3.0.0
Centos7 install Python2.7
Centos 7.6 install seleniu
Centos7 install LAMP+PHPmyadmin
CentOS install mysql
CentOS install openjdk 1.8
CentOS install PHP
CentOS6 install mist.io
Centos7 install Docker
CentOS7 install mysql
centOs install rabbitMQ
CentOS 7 install MySQL 5.6
Centos7 install Nginx
CentOS6.5 install CDH5.13
Centos install Python3
centos7 install docker
CentOS install jdk
centos7 install nginx-rtmp
CentOS8 install MySQL8.0
Centos6.3 install KVM
CentOS install PostgreSQL 9.1
CentOS7 install mysql8
CentOS 7 install Java 1.8
CentOS 7 install Gitlab
Centos 7 install PostgreSQL
CentOS7 install MySQL8
CentOS 7 install Java 1.8
CentOS 6 install Docker
centos 6.5 install zabbix 4.4
Centos8 install Docker
CentOS6.8 install python2.7
CentOS install nodejs 8
CentOS6.5 install GNS3
centos 7.5 install mysql5.7.17
Centos7 install MySQL8.0-manual
CentOS7 install Kubernetes 1.16.3
VirtualBox install centos7
centos7 install lamp
Install centos7 and connect
Install Docker on Centos7
Centos7 install docker-18.x original
install LNMP on centos7.4
Centos7 YUM install MariaDB 10.0
CentOS 8 install ZABBIX4.4 guide