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
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 #重新加载设置
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.