Q &

Source: Internet
Author: User
: This article mainly introduces Q & A about fastDFS + nginx cluster configuration. if you are interested in PHP tutorials, refer to it. John will not talk about how to configure fastDFS + nginx here. There are tutorials on the internet. although they are not nearly perfect, I think everyone can configure this framework.

For everyone's sake, I still found a detailed tutorial and shared the connection as follows:

Http://pan.baidu.com/s/1i3D6wPR

The following is my personal experience in the configuration process. Q & A is made for reference. it is A coincidence if there are similarities, haha.

First, I will write two basic operations:

FastDFS enabled:

Enable tracker:
/Usr/bin/fdfs_trackerd/home/an/work/fastDFS/TLOGS/conf/tracker. conf restart
Enable storage:
/Usr/bin/fdfs_storaged/home/an/work/fastDFS/SLOGS/conf/storage. conf restart

Upload files:
Fdfs_upload_file/home/an/work/fastDFS/CLOGS/conf/client. conf/home/an/work/fastDFS/CLOGS/conf/1.jpg

(Note: The path is changed to the actual path you have installed in your system !!)

Remember to use the root permission ~

If you need to change the configuration file but are not familiar with the basic vi skills, use gedit. remember to modify the folder permissions:

Chmod-R 777 [filename]

View Port Status:

Netstat-unltp | grep fdfs

If fastDFS cannot be started properly, check whether the dependent package is complete.

This is the dependent package required by nginx: wget http://fastdfs.googlecode.com/files/fastdfs-nginx-module_v1.15.tar.gz

The following section describes the process of Q &:

1,

Q: After fastDFS is installed, but nginx is not installed, images can be uploaded, but images cannot be accessed by using a browser through the returned URL.

A: The latest version of fastDFS does not support HTTP access. it can only be said that the tutorial you are reading is too old and must be used with other servers for access.

2,

Q: What should I do if an error is reported after nginx is installed and changed to nginx. conf? (This problem applies to various situations)

A: To A large extent, your nginx does not have related modules. At this time, you have to ask: I have installed nginx. how can I add modules? Haha, you cannot insert it in. So, my friend, recompile it!

There are many configuration module commands on the Internet, but I found the most comprehensive on the foreign official website:

First, go to the directory where the nginx installation folder is located, delete make. sh, and then run the following command

./Configure -- prefix =/etc/nginx \
-- Sbin-path =/usr/sbin/nginx \
-- Conf-path =/etc/nginx. conf \
-- Error-log-path =/var/log/nginx/error. log \
-- Http-log-path =/var/log/nginx/access. log \
-- Pid-path =/var/run/nginx. pid \
-- Lock-path =/var/run/nginx. lock \
-- Http-client-body-temp-path =/var/cache/nginx/client_temp \
-- Http-proxy-temp-path =/var/nginx/proxy_temp \
-- Http-fastcgi-temp-path =/var/cache/nginx/fastcgi_temp \
-- Http-uwsgi-temp-path =/var/cache/nginx/uwsgi_temp \
-- Http-scgi-temp-path =/var/cache/nginx/scgi_temp \
-- User = nginx \
-- Group = nginx \
With-http_ssl_module \
With-http_realip_module \
With-http_addition_module \
With-http_sub_module \
With-http_dav_module \
With-http_flv_module \
With-http_mp4_module \

With-http_gunzip_module \

With-http_gzip_static_module \
With-http_random_index_module \
With-http_secure_link_module \
With-http_stub_status_module \
With-http_auth_request_module \
-- With-mail \
With-mail_ssl_module \
-- With-file-aio \
With-http_spdy_module \
With-ipv6 \
-- Add-module =/home/an/work/etc/fastdfs-nginx-module/src \
-- Add-module =/home/an/work/etc/ngx_cache_purge \
-- With-pcre =/home/an/work/etc/pcre-8.34 \
-- With-zlib =/home/an/work/etc/zlib-1.2.7

Here, you must adjust the directory to your own directory and the components related to the last four commands: fastdfs-nginx-module | ngx_cache_purge | pcre-8.34 | zlib-1.2.7 if you don't have it, download it online. Remember to install the pcre-8.34 before running the command | zlib-1.2.7 these two components (go to the folder make + make install)

Run the command and run make to compile the file. then, back up the previously installed nginx configuration file *. conf (which will be backed up if it is changed) and run make install.

(It is easy to copy and replace nginx binary files. if you still don't understand it, you can search for "nginx upgrade ")

3,

Q: ERROR: nginx: [emerg] getpwnam ("**") failed

A: There are also related answers on the Internet, such as: sudo adduser -- system -- no-create-home -- disabled-password -- group nginx

Well, I did not succeed...

My solution is: in nginx. in conf, remove the # comment before "# user [nobody];" and change it to "user root;" (This solves the problem fundamentally !)

4,

Q: ERROR: open () "/var/run/nginx. pid" failed (2: No such file or directory)

A: This is A common problem. No nonsense: nginx-c/etc/nginx. conf to solve the problem (please fill in your correct directory)

5,

Q: ERROR: include file "http. conf" not exists, line: "# include http. conf"

A: find the mod_fastdfs.conf File (find-name in the root directory if not found): # include http. conf add "#" before this file.

6,

Q: ERROR: host "tracker" is invalid

A: If this is still the mod_fastdfs.conf file, tracker_server = *** tracker_server = tracker is displayed by default. the tracker is not replaced with the ip Address: port of the actual tracker.
Xiao an advised me to change the port numbers of store_path0 =.

7,

Q: ERROR: unknown directive "proxy_cache_purge"

A: nginx lacks the proxy_cache_purge module. do not doubt it. solve the problem by following the second Q & A in the preceding section of server guard.

8,

Q: Error: http. mime_types_filename not exist or is empty

A: find http. conf (what if I cannot find it? Search !) Find

Http. mime_types_filename =
Http. anti_steal.token_check_fail =

Change to mime.typesand anti-steal.jpg paths.

If you can't find or change it, it's useless to delete it.

Another one should not be forgotten during installation

Ln-s/home/an/work/fastDFS/SP0/data/home/an/work/fastDFS/SP0/data/M00 (changed to the actual path)

There are so many hurdles I have encountered. if you have a small problem, you can solve it yourself. Hey, complete the following:


Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

The above section describes the Q & A about fastDFS + nginx cluster configuration, including some content. I hope my friends who are interested in PHP tutorials will be helpful.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.