Home > Backend Development > PHP Tutorial > Nginx installation and configuration file analysis nginx configuration tcp nginx configuration jsp nginx cache configuration

Nginx installation and configuration file analysis nginx configuration tcp nginx configuration jsp nginx cache configuration

WBOY
Release: 2016-07-29 08:48:39
Original
1216 people have browsed it
Introduction Nginx is an open source high-performance HTTP server and reverse proxy server. It also supports IMAP/POP3 proxy service. It is a free software and a must-know for operation and maintenance engineers. Server, let me briefly talk about the installation and file parsing of the Nginx server.

Simple installation

This tutorial takes Centos 6.3 as an example. The software package can be downloaded from the official website. Before compiling and installing, we need to use YUM to install the required software dependency packages in advance.

The installation command is as follows:

[root@centos6 ~]# wget http://nginx.org/download/nginx-1.4.0.tar.gz
[root@centos6 ~]# tar -xzf nginx-1.4.0.tar.gz -C /usr/src
[root@centos6 ~]# yum -y install gcc pcre pcre-devel openssl \
>openssl-devel gd gd-devel perl perl-ExtUtils-Embed
[root@centos6 ~]# cd /usr/src/nginx-1.4.0/
[root@centos6 nginx-1.4.0]# ./configure --prefix=/usr/local/nginx \
>--with-ipv6 \
>--with-http_ssl_module \
>--with-http_realip_module \
>--with-http_addition_module \
>--with-http_dav_module \
>--with-http_flv_module \
>--with-http_mp4_module \
>--with-http_gzip_static_module \
>--with-http_perl_module \
>--with-mail \
>--with_main_ssl_module
[root@centos6 nginx-1.4.0]# make && make install
Copy after login

After the Nginx web server software is installed, the program’s main directory is located at /usr/local/nginx/, and the contents in this directory are cong, html, logs, and sbin. The following are commonly used process management instructions for Nginx:

[root@centos6 ~]# /usr/local/nginx/sbin/nginx          #启动主程序
[root@centos6 ~]# /usr/local/nginx/sbin/nginx -c  \         #指定配置文件启动主程序
[root@centos6 ~]# /usr/local/nginx/sbin/nginx -s stop       #关闭主程序
[root@centos6 ~]# /usr/local/nginx/sbin/nginx -s reload     #重新加载设置
Copy after login

Configuration file analysis

Nginx’s default configuration file is /usr/local/nginx/conf/nginx.conf. The configuration file includes global, event, http, and server settings. Event is mainly used to define the working mode of Nginx. http provides Web functions. Server is used to set up virtual hosts. The server must be located inside http. There can be multiple servers in one configuration file.

Original address of this article: http://www.linuxprobe.com/nginx-installation-parsing

Provide the latest Linux technology tutorial books for free, and strive to do more and better for open source technology enthusiasts:http:// www.linuxprobe.com/

The above introduces the Nginx installation and configuration file analysis, including nginx and configuration file content. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template