nginx official website
Create foldermkdir nginx<br>
Enter the created folder
Download the appropriate version according to your needs
Download the file through wget
Install the necessary plug-ins
yum -y install gcc pcre pcre-devel zlib zlib-devel openssl openssl-devel
Let’s talk about the functions of these
gcc It can be compiled c, c, ada, object c and java and other languages
pcre pcre-devel pcre is a perl library, including a perl-compatible regular expression library. The http module of nginx uses pcre to parse regular expressions, so Need to install the pcre library
zlib zlib-devel The zlib library provides many compression and decompression methods nginx uses zlib to gzip the contents of the http package, so you need to install
openssl openssl-devel openssl is The cornerstone of web secure communication, without openssl, it can be said that our information is running naked
Unzip the downloaded file
tar -zxvf nginx-1.17.6.tar.gz
Go to the nginx-1.17.6 folder
Start the installation
Specify the installation path
./configure --prefix=/software/nginx
This sentence means specifying the installation path
--prefix=/software/nginx
Compile
make
Installation
make install
Enter sbin under the directory where nginx is installed
Start command
./nginx
Open the browser to access your IP address, display this page to indicate that nginx started successfully
Stop the service calmly
This method is milder than stop. It requires the process to complete the current work before stopping. nginx -s quit
Stop the service immediately
This method is tougher, regardless of whether the process is working or not. Stop the process directly. nginx -s stop
Query nginx main process number
ps -ef | grep nginx
Stop calmly kill -quit main process number
Quickly stop kill -term main process number
Force stop kill -9 nginx
ps: in Install nginx on centos 8
Starting from centos 8, nginx packages are available in the default centos repository.
To install nginx on centos 8, just enter the following:
After the installation is complete, use the following command to enable and start the nginx service:
To verify whether the service is running Run, please check its status:
The output should look like this:
Adjust the firewall
firewalld is the default firewall solution on centos 8.
During the installation process, nginx creates a firewall service file using predefined rules to allow access to http (80) and https (443) ports.
Use the following command to permanently open the necessary ports:
Now you can test the nginx installation by opening http://your_ip in a web browser. You should see the default nginx welcome page, which should look similar to the image below:
The above is the detailed content of Centos8 installation nginx instance analysis. For more information, please follow other related articles on the PHP Chinese website!

NGINXUnit is an open source application server that supports multiple programming languages and provides functions such as dynamic configuration, zero downtime updates and built-in load balancing. 1. Dynamic configuration: You can modify the configuration without restarting. 2. Multilingual support: compatible with Python, Go, Java, PHP, etc. 3. Zero downtime update: Supports application updates that do not interrupt services. 4. Built-in load balancing: Requests can be distributed to multiple application instances.

NGINXUnit is better than ApacheTomcat, Gunicorn and Node.js built-in HTTP servers, suitable for multilingual projects and dynamic configuration requirements. 1) Supports multiple programming languages, 2) Provides dynamic configuration reloading, 3) Built-in load balancing function, suitable for projects that require high scalability and reliability.

NGINXUnit improves application performance and manageability with its modular architecture and dynamic reconfiguration capabilities. 1) Modular design includes master processes, routers and application processes, supporting efficient management and expansion. 2) Dynamic reconfiguration allows seamless update of configuration at runtime, suitable for CI/CD environments. 3) Multilingual support is implemented through dynamic loading of language runtime, improving development flexibility. 4) High performance is achieved through event-driven models and asynchronous I/O, and remains efficient even under high concurrency. 5) Security is improved by isolating application processes and reducing the mutual influence between applications.

NGINXUnit can be used to deploy and manage applications in multiple languages. 1) Install NGINXUnit. 2) Configure it to run different types of applications such as Python and PHP. 3) Use its dynamic configuration function for application management. Through these steps, you can efficiently deploy and manage applications and improve project efficiency.

NGINX is more suitable for handling high concurrent connections, while Apache is more suitable for scenarios where complex configurations and module extensions are required. 1.NGINX is known for its high performance and low resource consumption, and is suitable for high concurrency. 2.Apache is known for its stability and rich module extensions, which are suitable for complex configuration needs.

NGINXUnit improves application flexibility and performance with its dynamic configuration and high-performance architecture. 1. Dynamic configuration allows the application configuration to be adjusted without restarting the server. 2. High performance is reflected in event-driven and non-blocking architectures and multi-process models, and can efficiently handle concurrent connections and utilize multi-core CPUs.

NGINX and Apache are both powerful web servers, each with unique advantages and disadvantages in terms of performance, scalability and efficiency. 1) NGINX performs well when handling static content and reverse proxying, suitable for high concurrency scenarios. 2) Apache performs better when processing dynamic content and is suitable for projects that require rich module support. The selection of a server should be decided based on project requirements and scenarios.

NGINX is suitable for handling high concurrent requests, while Apache is suitable for scenarios where complex configurations and functional extensions are required. 1.NGINX adopts an event-driven, non-blocking architecture, and is suitable for high concurrency environments. 2. Apache adopts process or thread model to provide a rich module ecosystem that is suitable for complex configuration needs.


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

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

SublimeText3 Chinese version
Chinese version, very easy to use

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Atom editor mac version download
The most popular open source editor
