Installation of nginx and fastdfs modules
- Download fastdfs-nginx-module-master, then unzip it
- Download nginx and unzip it.
- Enter the nginx directory, ./configure –add-module=/path/fastdfs-nginx-module-master/src
- Then make, make install
fastdfs configuration
- Storage node information configuration: Enter /etc/fdfs,cp storage.conf.sample storage.conf. Configure base_path=file data storage and log storage path, configure tracker_server=xxx.xxx.xxx.xxx:22122 address, configure the corresponding web server port http.server_port=nginx listening port.
- File metadata information node configuration: Go to /etc/fdfs, cp tracker.conf.sample tracker.conf. The storage path of configuration file metadata and log files base_path=path.
fastdfs-nginx configuration
- cp fastdfs-nginx-module-master/mod_fastdfs.conf /etc/fdfs. Configure the local trackserver information: tracker_server=xxx.xxx.xxx.xxx:22122, storage_server_port=23000, group_name=storageserver group name, url_have_group_name = true
- cp http.conf* mime.types /etc/fdfs (these two files in the conf directory of fastdfs)
- Modify nginx.conf and add
location /group1/M00 {
root storage storage path/data;
ngx_fastdfs_module;
}
Summary of the problem
nginx log error when starting: trunk_shared.c, line: 177, “Permission denied” can’t be accessed. Reason explanation: There is a problem with the storage path permissions of your storage, because nginx has separate users and user groups. For details, see cat /etc/passed or cat /etc/groups, so it is possible that the nginx user does not have permission to access that path. Solution: 1. chmod 777 the entire path, 2. Add nginx to the user group where the path is located, and then chmod 770 the entire path.
When nginx starts, the log reports an error include file “http.conf” not exists, line: “#include http.conf”. Solution: cp http.conf* mime.types /etc/fdfs (these two files are in the conf directory of fastdfs)
').addClass('pre-numbering').hide();
$(this).addClass('has-numbering').parent().append($numbering);
for (i = 1; i ').text(i));
};
$numbering.fadeIn(1700);
});
});
The above introduces the fastDFS+nginx configuration, including fastdfs and nginx. I hope it will be helpful to friends who are interested in PHP tutorials.