In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
In view of how to install Nginx offline in Centos system, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible method.
Environmental preparation
# rpm package gcc-4.8.5-36.el7.x86_64gcc-c++-4.8.5-36.el7.x86_64libstdc++-4.8.5-36.el7.x86_64libstdc++-devel-4.8.5-36.el7.x86_64pcre-8.32-17.el7.x86_64.rpmpcre-devel-8.32-17.el7.x86_64.rpmzlib-1.2.7-18.el7.x86_64zlib-devel-1.2.7-18.el7.x86_64
Install the rpm package, enter the path where rpm is stored, and use the following command to install or upgrade. (if there is a problem of missing package or asymmetrical version of the package, download or upgrade it yourself, which will not be discussed here.)
Rpm-Uvh * .rpm-- nodeps-- force III. Download, installation, configuration
Nginx official website https://nginx.org
Download the Stable version version, nginx-1.16.1.tar.gz, and execute the following command to install it.
# decompress tar-xzvf nginx-1.16.1.tar.gz # move nginx to the corresponding directory sudo mv / mnt/sdb1/soft/nginx-1.16.1 / usr/local/nginxcd / usr/local/nginx# to check the installation environment, whether it conforms to. / configure# compilation, install make#, install make install#, run cd / usr/local/nginx/sbin./nginx
Check that the configuration file is correct.
/ usr/local/nginx/sbin/nginx-t
Related orders.
. / nginx-h # displays help. / nginx-v # displays the version number of nginx. / nginx-V # displays the version number and compilation information of nginx. / nginx-t # checks the correctness of the nginx configuration file. / nginx-t # checks the positive determination of the nginx configuration file and the configuration details of the configuration file. / nginx-s # sends a signal to the main process For example:. / nginx-s reload configuration file changes reload the configuration file and restart the nginx service. / nginx-p # sets the installation path of nginx. / nginx-c # sets the path of nginx configuration file IV, service, boot self-starting
Close the running nginx first.
. / nginx-s quit
New file: vim / usr/lib/systemd/system/nginx.service. It is recommended to upload the file to the specified folder directory after external editing. The file code is as follows.
[Unit] Description=nginxAfter= network.target [service] Type=forkingExecStart=/usr/local/nginx/sbin/nginxExecReload=/usr/local/nginx/sbin/nginx-s reloadExecStop=/usr/local/nginx/sbin/nginx-s quitPrivateTmp= truth [install] WantedBy=multi-user.target
Set the boot to boot.
Systemctl enable nginx.service
Check the status.
Systemctl status nginx.serviceps aux | grep nginx
Other orders.
# start systemctl start nginx.service # end systemctl stop nginx.service # restart systemctl restart nginx.service, this is the answer to the question about how to install Nginx offline in the Centos system. I hope the above content can be of some help to you. If you still have a lot of questions to solve, you can follow the industry information channel for more related knowledge.
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.