国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

Home Backend Development PHP Tutorial nginx source code (2) running

nginx source code (2) running

Aug 08, 2016 am 09:28 AM
html nginx

Continued from the previous article
When running, an error occurs and the nginx.conf file cannot be found. This file is in the conf directory. For convenience, we change the default nginx prefix to the current directory and modify the PREFIX definition in the file auto/options as the current directory:

<code><span>if</span> [ <span>".<span>$PREFIX</span>"</span> = <span>"."</span> ]; <span>then</span>
    PREFIX=.
<span>fi</span></code>

In the current Create new folders logs and html in the source code directory, create a new file index.html in the html directory, enter
success
Remake clean, make, generate new nginx binary file, run
sudo ./nginx
Check the process
ps -ef|grep nginx
You can see that nginx has been started successfully. When you access http://localhost in the browser, the page returns success!
View log:
There are access records in logs/access.log
If an error occurs, there is an error message in logs/error.log.
logs/nginx.pid is the process number of the nginx process.

Note:
If run without root, an error will be reported:

2015/03/15 13:44:13 [emerg] 19240#0: bind() to 0.0.0.0:80 failed (13: Permission denied)

If If there is no html directory and the following index.html file, an error will be reported:

2015/03/15 13:47:55 [error] 19310#0: *1 “./html/” is not found (2: No such file or directory), client: 127.0.0.1, URL: /

Because I am building the simplest page without favicon.ico, so an error will be reported here:

2015/03/15 13:47 :55 [error] 19310#0: *1 open() “./html/favicon.ico” failed (2: No such file or directory), client: 127.0.0.1, URL: /favicon.ico

Run At this time, there are 4 processes in total:

root 19715 1144 0 14:04 ? 00:00:00 ./nginx
nobody 19716 19715 0 14:04 ? 00:00:00 ./nginx
nobody 19717 19715 0 14:04 ? 00:00:00 ./nginx
nobody 19718 19715 0 14:04 ? 00:00:00 ./nginx

The main process runs with root permissions, and the other three are work processes.

The above introduces the operation of nginx source code (2), including various aspects. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undress AI Tool

Undress AI Tool

Undress images for free

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

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

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What is the loading='lazy' one of the html attributes and how does it improve page performance? What is the loading='lazy' one of the html attributes and how does it improve page performance? Jul 01, 2025 am 01:33 AM

loading="lazy" is an HTML attribute for and which enables the browser's native lazy loading function to improve page performance. 1. It delays loading non-first-screen resources, reduces initial loading time, saves bandwidth and server requests; 2. It is suitable for large amounts of pictures or embedded content in long pages; 3. It is not suitable for first-screen images, small icons, or lazy loading using JavaScript; 4. It is necessary to cooperate with optimization measures such as setting sizes and compressing files to avoid layout offsets and ensure compatibility. When using it, you should test the scrolling experience and weigh the user experience.

What are best practices for writing valid and well-formed HTML code? What are best practices for writing valid and well-formed HTML code? Jul 01, 2025 am 01:32 AM

When writing legal and neat HTML, you need to pay attention to clear structure, correct semantics and standardized format. 1. Use the correct document type declaration to ensure that the browser parses according to the HTML5 standard; 2. Keep the tag closed and reasonably nested to avoid forgetting closed or wrong nesting elements; 3. Use semantic tags such as, etc. to improve accessibility and SEO; 4. The attribute value is always wrapped in quotes, and single or double quotes are used uniformly. Boolean attributes only need to exist, and the class name should be meaningful and avoid redundant attributes.

What are the essential HTML elements for structuring a webpage? What are the essential HTML elements for structuring a webpage? Jul 03, 2025 am 02:34 AM

The web page structure needs to be supported by core HTML elements. 1. The overall structure of the page is composed of , , which is the root element, which stores meta information and displays the content; 2. The content organization relies on title (-), paragraph () and block tags (such as ,) to improve organizational structure and SEO; 3. Navigation is implemented through and implemented, commonly used organizations are linked and supplemented with aria-current attribute to enhance accessibility; 4. Form interaction involves , , and , to ensure the complete user input and submission functions. Proper use of these elements can improve page clarity, maintenance and search engine optimization.

Implementing client-side form validation using HTML attributes. Implementing client-side form validation using HTML attributes. Jul 03, 2025 am 02:31 AM

Client-sideformvalidationcanbedonewithoutJavaScriptbyusingHTMLattributes.1)Userequiredtoenforcemandatoryfields.2)ValidateemailsandURLswithtypeattributeslikeemailorurl,orusepatternwithregexforcustomformats.3)Limitvaluesusingmin,max,minlength,andmaxlen

What causes a 'Too many open files' error in Nginx? What causes a 'Too many open files' error in Nginx? Jul 05, 2025 am 12:14 AM

When Nginx experiences a "Toomyopenfiles" error, it is usually because the system or process has reached the file descriptor limit. Solutions include: 1. Increase the soft and hard limits of Linux system, set the relevant parameters of nginx or run users in /etc/security/limits.conf; 2. Adjust the worker_connections value of Nginx to adapt to expected traffic and ensure the overloaded configuration; 3. Increase the upper limit of system-level file descriptors fs.file-max, edit /etc/sysctl.conf and apply changes; 4. Optimize log and resource usage, and reduce unnecessary file handle usage, such as using open_l

How to enable HTTP/2 or HTTP/3 support in Nginx? How to enable HTTP/2 or HTTP/3 support in Nginx? Jul 02, 2025 am 12:36 AM

To enable Nginx's HTTP/2 or HTTP/3 support, the prerequisites must be met and configured correctly; HTTP/2 requires Nginx1.9.5, OpenSSL1.0.2 and HTTPS environment; add --with-http_v2_module module during configuration, modify the listening statement to listen443sslhttp2; and overload the service; HTTP/3 is based on QUIC, and third-party modules such as nginx-quic are required to introduce BoringSSL or OpenSSLQUIC branches during compilation, and configure UDP listening ports; common problems during deployment include ALPN not enabled, certificate incompatible, firewall restrictions and compilation errors, it is recommended to use priority

How to define an abbreviation or acronym using the  tag? How to define an abbreviation or acronym using the tag? Jun 27, 2025 am 01:11 AM

Notes on using HTML tags: 1. It must be accompanied by title attribute to define the complete meaning of the abbreviation, such as HTML; 2. Use uniformly instead of discarded tags; 3. Use only when necessary, avoid nesting, and adjust the default style through CSS to improve accessibility and SEO effects.

What is the purpose of the  element? What is the purpose of the element? Jul 01, 2025 am 01:37 AM

The function is to display structured two-dimensional data, such as score sheets, timetables, etc.; it is not used for page layout. The correct way to use it includes: 1. wrap the entire table with it; 2. define the table header; 3. contain the main content; 4. represent a row; 5. or define a cell. Auxiliary tags include: add title; define column attributes; display the bottom summary information. Notes: Avoid complex structures, reduce the number of columns to improve the mobile experience, and use a responsive framework to optimize the display effect.

See all articles