Linux platform builds image server via Nginx and VSFTPD

Source: Internet
Author: User
Tags openssl library

Because of the development needs, you need to build a separate picture server on Linux , where you have installed the Linux system by default. System Environment: CENTOS6.5,VMWARE10

First, Nginx installation

1. Nginx Installation Environment

Nginx is a C language development , it is recommended to run on Linux, this tutorial uses Centos6.5 as the installation environment.

Installation nginx need to download the source code to compile, compile dependent gcc environment, if there is no GCC environment, need to install Gcc:yum install gcc-c++

PCRE (perlcompatible Regular Expressions) is a Perl library that includes a Perl-compatible regular expression library. The Nginx HTTP module uses PCRE to parse the regular expression, so the Pcre library needs to be installed on Linux.

Yuminstall-y Pcre Pcre-devel

Note: Pcre-devel is a two-time development library developed using PCRE. Nginx also needs this library.

The Zlib library provides a number of ways to compress and decompress, and Nginx uses zlib to gzip the contents of the HTTP package, so you need to install the Zlib library on Linux.

Yuminstall-y zlib Zlib-devel

OpenSSL is a strong Secure Sockets Layer cipher library that includes key cryptographic algorithms , common key and certificate encapsulation management functions, and SSL protocols, and provides a rich set of applications for testing or other purposes.

Nginx not only supports the HTTP protocol, but also supports HTTPS (that is, transmitting HTTP on the SSL protocol), so you need to install the OpenSSL library on Linux.

Yuminstall-y OpenSSL Openssl-devel

2. Compile and install

Copy the nginx-1.8.0.tar.gz to a Linux server.

Extract:

TAR-ZXVF nginx-1.8.0.tar.gz

Enter the root directory of Nginx:

CD nginx-1.8.0

  A.configure

./configure--help Query Detailed parameters (refer to the Appendix of this tutorial: Nginx compilation parameters)

The parameters are set as follows:

./CONFIGURE \  

--prefix=/usr/local/nginx \  

--PID-PATH=/VAR/RUN/NGINX/NGINX.PID \  

--lock-path=/var/lock/ nginx.lock \  

--error-log-path=/var/log/nginx/error.log \  

--http-log-path=/var/log/nginx/access.log \  

--with-http_gzip_static_ module \  

--http-client-body-temp-path=/var/temp/nginx/client\  

--HTTP-PROXY-TEMP-PATH=/VAR/TEMP/NGINX/PROXY\  

--http-fastcgi-temp-path=/var/temp/nginx/fastcgi\  

--HTTP-UWSGI-TEMP-PATH=/VAR/TEMP/NGINX/UWSGI\  

--http-scgi-temp-path=/var/temp/nginx/scgi

Note: The temp file directory is specified as /var/temp/nginxon the top, and you need to create a temporary and nginx directory under/ var

  B. Compiling the installation

Make

Make install

Install successfully view the installation directory:

C. Start Nginx

cd/usr/local/nginx/sbin/

./nginx

Query Nginx Process:

15098 is the process of Nginx main process id,15099 is the process ID of nginx worker process

Note: Execute./nginx start Nginx, here you can specify the Nginx configuration file loaded, as follows:

./nginx-c/usr/local/nginx/conf/nginx.conf

If you do not specify-c,nginx to load the conf/nginx.conf file by default at startup, the address of this file can also be specified when compiling the Nginx installation./configure parameters (--conf-path= pointing to the configuration file (nginx.conf))

  D. Stop Nginx

Mode 1, Quick stop:

cd/usr/Local/nginx/sbin

./nginx-s Stop

This method is equivalent to identifying the Nginx process ID and then using the KILL command to force the kill process.

Mode 2, complete stop ( recommended):

cd/usr/Local/nginx/sbin

./nginx-s quit

This stop step is to wait until the Nginx process finishes processing the task to stop.

 E. Restart Nginx

Mode 1, stop and restart ( recommended):

The restart of Nginx is equivalent to stop nginx and start Nginx, that is, to execute the Stop command before executing the start command.

As follows:

./nginx-s quit

./nginx

Mode 2, reload the configuration file:

When Nginx configuration file nginx.conf modified, want to let the configuration take effect need to restart Nginx, use-s reload do not have to stop nginx and then start Nginx can be configured in Nginx to take effect, as follows:

./nginx-s Reload

F. Testing

Nginx installation, start Nginx, you can access the virtual machine Nginx:


This indicates that the installation of Nginx was successful.

Linux platform builds image server via Nginx and VSFTPD

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.