In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Today, I would like to share with you the relevant knowledge about the method of downloading server files by nginx agent. The content is detailed and the logic is clear. I believe most people still know too much about this, so share this article for your reference. I hope you can get something after reading this article. Let's take a look at it.
Purport
Nginx is a lightweight web server / reverse proxy server and email (IMAP/POP3) proxy server, distributed under the BSD-like protocol. Its characteristic is that it occupies less memory and has strong concurrency ability. in fact, the concurrency ability of nginx performs better in the same type of web server.
Environment
Linux server
Nginx software
Nginx installation 1. Install compilation tools and library files
[yunweijia@localhost jier] $sudo yum-y install make zlib zlib-devel gcc-c++ libtool openssl openssl-devel
2 、 * * install PCRE [yunweijia@localhost jier] $cd / usr/local/src/ [yunweijia@localhost src] $sudo wget http://downloads.sourceforge.net/project/pcre/pcre/8.35/pcre-8.35.tar.gz download [yunweijia@localhost src] $sudo tar xf pcre-8.35.tar.gz # extract [yunweijia@localhost src] $cd pcre-8.35/ [yunweijia@localhost pcre-8.35] $sudo. / configure # compile [ Yunweijia@localhost pcre-8.35] $sudo make & & make instal # install [yunweijia@localhost pcre-8.35] $pcre-config-- version # version view 8.32 [yunweijia@localhost pcre-8.35] $3, Install nginx [yunweijia @ localhost jier] $pwd/home/yunweijia/jier [yunweijia@localhost jier] $lsnginx-1.14.2.tar.gz [yunweijia@localhost jier] $tar xf nginx-1.14.2.tar.gz [yunweijia@localhost jier] $cd nginx-1.14.2/ [yunweijia@localhost nginx-1.14.2] $sudo. / configure-- prefix=/home/yunweijia/nginx-- with-http_stub_status_module-- with-http_ssl_module-- with -pcre=/usr/local/src/pcre-8.35 [yunweijia@localhost nginx-1.14.2] $sudo make & & make install4, Configuration adjustment [yunweijia@localhost nginx-1.14.2] $cd / home/yunweijia/nginx/ [yunweijia@localhost nginx] $lsconf html logs sbin [yunweijia@localhost nginx] $vim conf/nginx.conf# the following is the second line of the configuration file to configure user root # the following configuration is to add location ~ * (. * .txt) {# add_header Content-Type "application/octet-stream" with txt suffix in server; if ($args ~ ^ filename= (. *)) {add_header Content-Disposition "attachment; filename=$1";} yunweijia/ home/yunweijia/txt/ # in this directory} 5. Start nginx [yunweijia @ localhost nginx] $sudo. / sbin/nginx-t # check the configuration nginx: the configuration file / home/yunweijia/nginx/conf/nginx.conf syntax is oknginx: configuration file / home/yunweijia/nginx/conf/nginx.conf test is successful [yunweijia@localhost nginx] $sudo. / sbin/nginx # start 6, verify
Create a new file in "/ home/yunweijia/txt/" and test the download.
Download url: http://ip address: Port number / file name
[yunweijia@localhost nginx] $mkdir / home/yunweijia/txt/ [yunweijia@localhost nginx] $cd / home/yunweijia/txt/ [yunweijia@localhost txt] $ls [yunweijia@localhost txt] $echo ceshi > 1.txt [yunweijia@localhost txt] $cat 1.txt ceshi [yunweijia@localhost txt] $
The browser input address is: http://192.168.112.130/1.txt
The file was downloaded successfully.
These are all the contents of this article entitled "how to download server files by nginx agents". Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.