CentOS 7 source code compilation and installation Nginx process records
Compiling and installing the LNMP environment in CentOS is what needs to be done for every new server or computer. Here, only one record is made. This is a reference for beginners!
I. environment before installation
- The CentOS 7 system is used here.
- By default, we place the downloaded software in/data/soft (which can be set according to your preferences)
- By default, server applications are installed under/data/apps (which can be set according to your preferences)
1. Start Installation
1.
Yum-y install wget pcre openssl * gd gd2 gd-devel gd2-devel gcc-c ++ autoconf libjpeg-devel libpng-devel freetype-devel libxml2 libxml2-devel zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses-devel curl-devel extensions e2fsprogs-devel krb5 krb5-devel libidn-devel openssl-devel openldap-devel extensions openldap-clients openldap-servers make
Use the preceding command and yum to install the necessary web Services. If the system has been installed, it will be skipped automatically. If it is not the latest version, it will be updated to the latest version.
2.
// Add the user groups www and www for the web Service
Groupadd www
Useradd-g www
// Ulimit is used to improve the network concurrency performance. It doesn't matter if you do not set it for local users.
Ulimit-SHn 65535
// Enter the soft directory to prepare to download the application
Cd/data/soft
// Use wget to download and install the pcre required by nginx. The latest version is 8.37. You can check the latest version of the url below.
Wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.37.tar.gz
Tar zxvf pcre-8.37.tar.gz
Cd pcre-8.37
./Configure -- prefix =/data1/apps/libs/pcre
Make & make install
Cd ../
// Pcre has been installed here.
// Start to download and install nginx. Currently, the latest stable (stable version) is 1.8.0 and rc version has reached 1.94. For more information, see download. For example, 1.8.0
Wget http://nginx.org/download/nginx-1.8.0.tar.gz
Tar zxvf nginx-1.8.0.tar.gz
Cd nginx-1.8.0
./Configure -- user = www -- group = www -- prefix =/data/apps/nginx -- with-http_stub_status_module -- with-http_ssl_module -- with-pcre =/data/soft/pcre-8.37 -- with-http_realip_module -- with-http_image_filter_module
Make & make install
Cd ../
// Give nginx command resume the soft connection under bin to facilitate direct use of nginx commands in the future
Ln-s/data/apps/nginx/sbin/nginx/usr/local/bin/nginx
// Ps-ef | grep nginx. Check if there is no nginx process at this time.
// Start:
Nginx
// View ps-ef | grep nginx again and find that the nginx master process already exists.
// Help:
Ngnix-h
// Test the configuration file:
Nginx-t
// Restart:
Nginx-s reload (OTHERS: stop, quit, reopen, reload)
Here. You can open the local browser to check whether the http: // localhost page is displayed. The next step is to configure nginx. conf by yourself. I will not elaborate on it. Only installation records are made this time.
The above is my summary ~, You can choose to absorb it. Suitable for beginner reference and experts ~
For more Nginx tutorials, see the following:
Deployment of Nginx + MySQL + PHP in CentOS 6.2
Build a WEB server using Nginx
Build a Web server based on Linux6.3 + Nginx1.2 + PHP5 + MySQL5.5
Performance Tuning for Nginx in CentOS 6.3
Configure Nginx to load the ngx_pagespeed module in CentOS 6.3
Install and configure Nginx + Pcre + php-fpm in CentOS 6.4
Nginx installation and configuration instructions
Nginx log filtering using ngx_log_if does not record specific logs
Nginx details: click here
Nginx: click here