In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces the steps of compiling and installing Nginx. In daily operation, I believe many people have doubts about the steps of compiling and installing Nginx. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about the steps of compiling and installing Nginx. Next, please follow the editor to study!
The most troublesome part of Nginx is that it has a large number of development modules that users need to configure. The following modules need to be used this time:
1. Upload all the source code packages to the Linux server together
2. Unzip all the development packages into the "/ usr/local/src" directory
Tar xzvf / srv/ftp/nginx-1.11.3.tar.gz-C / usr/local/src/tar xzvf / srv/ftp/nginx-upstream-fair-a18b409.tar.gz-C / usr/local/src/tar xzvf / srv/ftp/echo-nginx-module-0.59.tar.gz-C / usr/local/src/tar xzvf / srv/ftp/ngx_cache_purge-2.3.tar.gz-C / usr/local/src/
Then go to the "/ usr/local/src" directory to see if the source code exists: ll / usr/local/src
3. After nginx compilation is completed, it is saved in the source code directory by default, which is not easy to manage, so it is recommended to create a new file directory to store all nginx-related configurations, assuming the directory name: / usr/local/nginx, which requires a bunch of subfolders.
Mkdir-p / usr/local/nginx/ {logs,conf,fastcgi_temp,sbin,client_body_temp,proxy_temp,uwsgi_temp,scgi_temp}
4. Go to the nginx source code directory: cd / usr/local/src/nginx-1.11.3/
5. Execute the following command to compile:
. / configure-- prefix=/usr/local/nginx/\-- sbin-path=/usr/local/nginx/sbin/\-- with-http_ssl_module\-- conf-path=/usr/local/nginx/conf/nginx.conf\-- pid-path=/usr/local/nginx/logs/nginx.pid\-- error-log-path=/usr/local/nginx/logs/error.log\-- http-log-path=/usr/local/nginx/logs/access.log\-- http -fastcgi-temp-path=/usr/local/nginx/fastcgi_temp\-- http-client-body-temp-path=/usr/local/nginx/client_body_temp\-- http-proxy-temp-path=/usr/local/nginx/proxy_temp\-http-uwsgi-temp-path=/usr/local/nginx/uwsgi_temp\-- http-scgi-temp-path=/usr/local/nginx/scgi_temp\-add-module=/usr/local/src/echo-nginx-module-0. 59\-- add-module=/usr/local/src/gnosek-nginx-upstream-fair-a18b409\-- add-module=/usr/local/src/ngx_cache_purge- 2.3.Compilation operation: make Perform nginx installation: make install
6. After execution, you can observe the "/ usr/local/nginx" directory, because all program items are saved in this directory
Nginx executable program command path: / usr/local/nginx/sbin/nginx.
The simplest way to start is to execute this program directly. After nginx starts, it will occupy port 80 and can be accessed directly through the browser.
|-browser access: http://192.168.122.179/
Multiple modules need to be bound in the process of Nginx development, so be sure to configure them before compilation.
All configuration items of nginx: / usr/local/nginx/conf/nginx.conf file
At this point, the study of "steps for compiling and installing Nginx" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
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.