First, you need to download the file resources on ubuntu. There are three resources in total. It is recommended to install git and nginx before downloading the resources, which will be used in this tutorial.
(Ngnix: http://nginx.org/download/nginx-1.12.2.tar.gz, use winscp to upload the compressed file, and then use the tar password to decompress nginx: tar -zxvf /home/ubuntu/source/nginx-1.12. 2.tar.gz)
libfastcommon
https://github.com/happyfish100/libfastcommon/tree/V1.0.36
fastdfs
https://github.com/happyfish100/fastdfs/tree/V5.11
fastdfs-nginx-module
https://github.com/happyfish100/fastdfs-nginx-module
After downloading, we started to build.
Compile and install libfastcommon
. /make.sh
. /make.sh install
ln -s /usr/lib64/libfastcommon.so /usr/local/lib/libfastcommon.so
Compile and install fastdfs
. /make.sh
. /make.sh install
Configure tracker.conf
cp /etc/fdfs/tracker.conf.sample /etc/fdfs/tracker.conf
vi /etc/fdfs/tracker.conf
Modified content:
base_path=/home/fastdfs
Configure storage.conf
cp /etc/fdfs/storage.conf.sample /etc/fdfs/storage.conf
vi /etc/fdfs/storage.conf
Modified content:
base_path=/home/fastdfs
tracker_server=10.0.2.15:22122
store_path0=/home/fastdfs
Configure http.conf mime.types
cp fastdfs-5.11/conf/http.conf /etc/fdfs/
cp fastdfs-5.11/conf/mime.types /etc/fdfs/
Configure client.conf
cp /etc/fdfs/client.conf.sample /etc/fdfs/client.conf
vi /etc/fdfs/client.conf
Modified content:
base_path=/home/fastdfs
tracker_server=10.0.2.15:22122
include http.conf #Open this line of code is commented out by default
Start tracker
/etc/init.d/fdfs_trackerd start
Other commands:
/etc/init.d/fdfs_trackerd stop #stop
/etc/init.d/fdfs_trackerd restart #restart
Start storage
/etc/init.d/fdfs_storaged start
Other commands:
/etc/init.d/fdfs_storaged stop #Stop
/etc/init.d/fdfs_storaged restart #restart
Test the installation of fastdfs
fdfs_test /etc/fdfs/client.conf upload /home/0.gif
As shown in the figure, the address for uploading pictures is generated.
Recommended Posts