Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method and steps of centos7 compiling and installing nginx

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Install the lib libraries required for nginx compilation

Yum-y install make zlib zlib-devel gcc-c++ libtool openssl openssl-develyum-y install pcre pcre-devel

View the pcre (Rule Library) version

Pcre-config-version

Enter the compilation directory

Cd / usr/local/src

Download the latest nginx (stable version stable version) from the official website.

Wget http://nginx.org/download/nginx-1.14.0.tar.gz

Decompress the nginx package

Tar-zxvf nginx-1.14.0.tar.gz

Enter the decompression directory

Cd nginx-1.14.0

Run the configuration script (the-- prefix parameter specifies the directory where nginx is installed, which is installed at / usr/local/nginx by default)

. / configure-- prefix=/usr/local/nginx

Compile and install nginx

Make & & make install

Soft link the nginx execution command to / usr/bin

Ln-s / usr/local/nginx/sbin/nginx / usr/bin

Start nginx

Nginx

Set Boot self-boot

Echo "/ usr/local/nginx/sbin/nginx" > > / etc/rc.d/rc.localchmod + x / etc/rc.d/rc.local

The above is the whole installation process.

Execute nginx-h to view related commands

[root@localhost] # nginx-hnginx version: nginx/1.14.0Usage: nginx [-? hvVtTq] [- s signal] [- c filename] [- p prefix] [- g directives] Options: -,-h: this help-v: show version and exit-V: show version and configure options then exit-t: test configuration and exit-T: test configuration Dump it and exit-Q: suppress non-error messages during configuration testing-s signal: send signal to a master process: stop, quit, reopen, reload-p prefix: set prefix path (default: / usr/local/nginx/)-c filename: set configuration file (default: conf/nginx.conf)-g directives: set global directives out of configuration file

View the nginx installation directory

Whereis nginx

The above is the whole content of this article, I hope it will be helpful to your study, and I also hope that you will support it.

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report