recently built a FASTDFS environment, the middle of some problems, in fact, have been built before, but did not make any records, and fell into the same pit, and then refer to various articles, the same online error, there are a variety of answers, get dizzy, took a whole day to finish, To summarize the construction steps for your reference, the middleware version has been listed in the steps, operating system is CentOS 6.6.
1. Download the required package
Libfastcommon-master.zip
Zlib-1.2.11.tar.gz
Pcre-8.40.tar.gz
Libevent-2.0.21-stable.tar.gz
Nginx-1.10.3.tar.gz
Fastdfs_v5.07.tar.gz
Fastdfs-nginx-module_v1.16.tar.gz
2. Installation Basic tools (installed to skip this step):
Yum-y install gcc gcc-c++ OpenSSL openssl-devel
3. Install Libfastcommon
A) Decompression installation files: Unzip Libfastcommon-master.zip
(No unzip tools required to install, installation command: yum-y install unzip)
b access to the installation files directory: CD Libfastcommon-master
c) Compile installation:./make.sh./make.sh Install
4. Decompression LIBEVENT:TAR-ZXVF libevent-2.0.21-stable.tar.gz
A) Compile installation:./configure–prefix=/usr/local/libevent
./make.sh./make.sh Install (step 5th will be dependent)
(It is best to uninstall the old Libevent version of the system before installing, command: Yum remove libevent*)
5. Install Fastdfs
A) Decompression installation files: TAR-ZXVF fastdfs_v5.07.tar.gz
b access to the installation files directory: CD Fastdfs
c) Compiling:./make.sh
(Perl is needed here, if not installed first, install command: Yum install perl)
d) Installation:./make.sh Install
6. Configure Storage
(a) After the 5th installation is successful, the/etc/fdfs directory will have the relevant configuration files
(If not copy from the/fastdfs/conf directory):
Client.conf.sample
Http.conf
Mime.types
Storage.conf.sample
Tracker.conf.sample
A) access to the Fastdfs profile directory: Cd/etc/fdfs
b) Copy a profile: CP storage.conf.sample storage.conf
c) Modify the configuration file:
Base_path=/data/fastdfs/storage #设置tracker的数据文件和日志目录 (need to be created in advance)
d) Starting storage:fdfs_storaged/etc/fdfs/storage.conf start
(You can pass NETSTAT-ANTP | grep storage to see if the storage started properly on the corresponding port;
Does not mean that tracker and storage normal communication, you can pass the command
/usr/bin/fdfs_monitor/etc/fdfs/storage.conf to see if storage is active)
7. Installation Nginx Dependency
A) installation of PCRE:TAR-ZXVF pcre-8.40.tar.gz
Go to the Extract directory, execute./configure, and execute make and make install commands sequentially
b) Installation of ZLIB:TAR-ZXVF zlib-1.2.11.tar.gz
Go to the Extract directory, execute./configure, and execute make and make install commands sequentially
8. Install the Nginx Fastdfs module
A) Decompression installation files TAR-ZXVF fastdfs-nginx-module_v1.16.tar.gz
b access to the installation files directory: CD fastdfs-nginx-module
c) Modify config file:
core_incs= "$CORE _incs/usr/local/include/fastdfs/usr/local/include/fastcommon/"
Modified to: (This path modification is very important, otherwise nginx compile time will be an error)
core_incs= "$CORE _incs/usr/include/fastdfs/usr/include/fastcommon/"
Install Nginx
A) Unpack the installation file bag current directory: TAR-ZXVF nginx-1.10.3.tar.gz
b access to the installation files directory: CD nginx-1.10.3
c) Configure installation files:./configure–prefix=/usr/local/nginx–with-http_stub_status_module–
With-http_ssl_module–add-module=/home/fastdfs-nginx-module/src
(This step requires OpenSSL, download the installation package on their own to find errors, through the Yum installed after normal.) )
D Compile installation: Execute make and make install commands sequentially
E) Configure Storage:cp/home/fastdfs-nginx-module/src/mod_fastdfs.conf/etc/fdfs
Base_path=/data/fastdfs/storage/data
tracker_server=192.168.192.135:22122
Store_path0=/data/fastdfs/storage
f) Configure soft connection: Ln-s/data/fastdfs/storage/data/data/fastdfs/storage/data/m00
g) Configure Nginx:vi usr/local/nginx/nginx.conf
Add the following configuration to the server node
location/group1/m00{
Root/data/fastdfs/storage/data;
Ngx_fastdfs_module;
}
e) Start: Cd/usr/local/nginx/sbin, execute./nginx
There may be a failure to launch the following error
/usr/local/nginx/sbin/nginx:error while loading shared libraries:libpcre.so.1:
cannot open shared object File:no su CH File or directory
You can tell from the error message that the Lib file is missing and that the details are further viewed:
LDD $ (Which/usr/local/nginx/sbin/nginx)
libpthread.so.0 =>/lib64/libpthread.so.0 (0x00000030e8400000)
libcrypt.so.1 =>-/lib64/libcrypt.so.1 ( 0x00000030f9a00000)
libpcre.so.1 => not found
libcrypto.so.6 =>/lib64/libcrypto.so.6 ( 0x00000030f2a00000)
libz.so.1 =>/lib64/libz.so.1 (0x00000030e8800000)
libc.so.6 =>/lib64/libc.so.6 ( 0x00000030e7800000)
/lib64/ld-linux-x86-64.so.2 (0x00000030e7400000)
libdl.so.2 =>/lib64/libdl.so.2 ( 0x00000030e8000000)
View the results show: libpcre.so.1 => not found, while noting the Lib library path, there are/lib/* and/lib64/* points.
For example, the above is/lib64/*, which is related to the soft connection created when the problem is resolved
Workaround: First verify that the Pcre software is installed (Nginx relies on the software) to create a soft connection.
For/lib/* 32-bit systems: view Lib Libraries
ls/lib/|grep pcre
libpcre.so.0
libpcre.so.0.0.1
adding soft connections
Ln-s/lib/libpcre.so.0.0.1/lib/libpcre.so.1
PS: There may also be pcre lib files in the directory:/usr/local/lib/
For/lib64/* 64-bit systems: view Lib Libraries
ls/lib64/|grep pcre
libpcre.so.0
libpcre.so.0.0.1
adding soft connections
Ln-s/lib64/libpcre.so.0.0.1/lib64/libpcre.so.1
PS: There may also be pcre lib files in the directory:/usr/local/lib64/