


Q&A collection of cluster configuration questions about fastDFS+nginx
Xiao An won’t go into detail here about how to configure fastDFS+nginx. There are tutorials on the Internet. Although they are not perfect, everyone can probably configure this framework.
For everyone’s needs, I still found a detailed tutorial and share the link as follows:
http://pan.baidu.com/s/1i3D6wPR
The following is my Xiao An My personal experience during the configuration process has been made into a Q&A for reference. Any similarity is purely coincidental, haha.
First, I will write two basic operations:
fastDFS opening:
Open 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: Change the path to the actual path you installed in your own system!!)
Also Remember to use root privileges~
If you need to change the configuration file but are not proficient in the basic vi function gedit, then remember to modify the folder permissions:
chmod -R 777 [filename]
View port Situation:
netstat -unltp | grep fdfs
fastDFS If it cannot start normally, please check whether the dependency package is complete
This is the dependency package required by nginx: wget http://fastdfs.googlecode. com/files/fastdfs-nginx-module_v1.15.tar.gz
The following is Xiaoan’s Q&A session:
1,
Q: After installing fastDFS but not installing nginx, you can upload images, but It is not possible to access images through the browser through the returned URL
A:The latest version of fastDFS no longer supports HTTP access service. It can only be said that the tutorial you are watching is too old and must be used with other servers. Access is available.
2,
Q: What should I do if I keep getting errors after installing nginx and modifying nginx.conf? (This question applies to various situations)
A: This is largely because your nginx does not configure related modules. At this time you have to ask: How can I add the module to nginx after it has been installed? Haha, hum, there is no way to force it in. So my friend, recompile!
There are many commands for configuring modules on the Internet, but I went to foreign official websites to find the most complete one:
First, enter the directory where the nginx installation folder is located, delete make.sh, and then run The following commands
./configure --prefix=/etc/nginx
--sbin-path=/usr/sbin/nginx
--conf-path=/etc/nginx/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 please pay attention to adjusting 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 pcre-8.34 before running the command || These two components of zlib-1.2.7 (enter the folder make+make install)
After running the command, enter the command make to compile, and then add the previously installed nginx configuration file *.conf to yourself After backing up (back up whatever has been changed) run make install.
(In fact, it saves trouble. You can also copy and replace the nginx binary file. If you still don’t understand, you can search for “nginx upgrade”)
3,
Q: ERROR: nginx: [emerg ] getpwnam("**") failed
A: There are also relevant answers on this website, for example: sudo adduser --system --no-create-home --disabled-password --group nginx
.
My solution is: remove the # comment in front of "#user [nobody];" in nginx.conf and change it to "user root;" (this will fundamentally solve the problem!)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/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 (if not found, go to the root directory find -name) and find: #include http.conf Just add "#" in front of this
6,
Q:ERROR: host "tracker" is invalid
A: If this is the case, there is still an item in the mod_fastdfs.conf file that is tracker_server=****. The default display is tracker_server = tracker. It should be that the tracker at the back is not replaced with the ip:port of the actual tracker.
Xiaoan suggests that you change the port number of store_path0=.... at the back.
Q: ERROR: unknown directive "proxy_cache_purge"
A: nginx is missing the
proxy_cache_purge module, don't doubt it, just follow Xiao An's second Q&A above to solve it.
8 ? Search!) Find the path where
http.mime_types_filename=
http.anti_steal.token_check_fail=
to the actual mime.types and anti-steal.jpg
If If you say you can’t find it or it’s useless to change it, then delete Xiaoan and think it doesn’t hurt.
There is also another one, don’t forget during installation
ln -s /home/an /work/fastDFS/SP0/data /home/an/work/fastDFS/SP0/data/M00 (change to actual path)
That’s all the big obstacles I encountered Yes, if you have any small problems, you can figure it out by yourself. Hehe, attached is the completed rendering:
Copyright statement: This article is an original article by the blogger and has not been published by the blogger. No reproduction allowed with permission of the owner.
The above introduces the Q&A collection of cluster configuration questions about fastDFS+nginx, including relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

To allow the Tomcat server to access the external network, you need to: modify the Tomcat configuration file to allow external connections. Add a firewall rule to allow access to the Tomcat server port. Create a DNS record pointing the domain name to the Tomcat server public IP. Optional: Use a reverse proxy to improve security and performance. Optional: Set up HTTPS for increased security.

Steps to run ThinkPHP Framework locally: Download and unzip ThinkPHP Framework to a local directory. Create a virtual host (optional) pointing to the ThinkPHP root directory. Configure database connection parameters. Start the web server. Initialize the ThinkPHP application. Access the ThinkPHP application URL and run it.

Server deployment steps for a Node.js project: Prepare the deployment environment: obtain server access, install Node.js, set up a Git repository. Build the application: Use npm run build to generate deployable code and dependencies. Upload code to the server: via Git or File Transfer Protocol. Install dependencies: SSH into the server and use npm install to install application dependencies. Start the application: Use a command such as node index.js to start the application, or use a process manager such as pm2. Configure a reverse proxy (optional): Use a reverse proxy such as Nginx or Apache to route traffic to your application

To solve the "Welcome to nginx!" error, you need to check the virtual host configuration, enable the virtual host, reload Nginx, if the virtual host configuration file cannot be found, create a default page and reload Nginx, then the error message will disappear and the website will be normal show.

There are five methods for container communication in the Docker environment: shared network, Docker Compose, network proxy, shared volume, and message queue. Depending on your isolation and security needs, choose the most appropriate communication method, such as leveraging Docker Compose to simplify connections or using a network proxy to increase isolation.

Converting an HTML file to a URL requires a web server, which involves the following steps: Obtain a web server. Set up a web server. Upload HTML file. Create a domain name. Route the request.

How to implement HTTP streaming in C++? Create an SSL stream socket using Boost.Asio and the asiohttps client library. Connect to the server and send an HTTP request. Receive HTTP response headers and print them. Receives the HTTP response body and prints it.

The most commonly used instructions in Dockerfile are: FROM: Create a new image or derive a new image RUN: Execute commands (install software, configure the system) COPY: Copy local files to the image ADD: Similar to COPY, it can automatically decompress tar archives or obtain URL files CMD: Specify the command when the container starts EXPOSE: Declare the container listening port (but not public) ENV: Set the environment variable VOLUME: Mount the host directory or anonymous volume WORKDIR: Set the working directory in the container ENTRYPOINT: Specify what to execute when the container starts Executable file (similar to CMD, but cannot be overwritten)
