Nginx+php+mysql Construction Guide

Source: Internet
Author: User
Tags bz2 fpm sapi

Some time ago because of which hacker malicious attack my site, resulting in WAN network directly to my host to deactivate, had to change VPS, natural not independent host high, Remote Desktop will wait long, for me this impatient person is no doubt can not stand, so pondering into Linux performance should be better. Good day research, finally put the whole environment prepared. Crap less said, directly below the introduction.

First, compile Nginx, and then download Nginx last source code version (1.3.3), for http://nginx.org/download/nginx-1.3.3.tar.gz, directly through the wget can:

Wget-c http://nginx.org/download/nginx-1.3.3.tar.gz

Mkdir-p/usr/src/nginx

Cd/usr/src/nginx

TAR-XZVF nginx-1.3.3.tar.gz

CD nginx-1.3.3.

Useradd www

Usemod-s/sbin/nologin-g www www

./configure–prefix=/usr/local/nginx–user=www–group=www–with-http_stub_status_module–with-http_ssl_module– With-pcre && make && make install

(Note: Do not add –without-http_rewrite_module, otherwise it will cause rewrite not to use)

Once compiled, you can start nginx with the following command:

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

Second, compile PHP, download the source code package, http://118.26.57.11/1Q2W3E4R5T6Y7U8I9O0P1Z2X3C4V5B/cn.php.net/distributions/php-5.4.5.tar.bz2

Mkdir-p/usr/src/nginx/php

cd/usr/src/nginx/php

Wget-c http://118.26.57.11/1Q2W3E4R5T6Y7U8I9O0P1Z2X3C4V5B/cn.php.net/distributions/php-5.4.5.tar.bz2

TAR-JXVF php-5.4.5.tar.bz2

Yum-y Install libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel MySQL

./configure–prefix=/usr/local/php–with-mysql–enable-fpm–with-freetype-dir–with-jpeg-dir–with-png-dir–with-zlib –with-libxml-dir–enable-xml–disable-debug–enable-safe-mode–enable-mbstring && make && make install

Cp-r./sapi/fpm/php-fpm.conf/usr/local/php/etc/php-fpm.conf

Cp-r./sapi/fpm/php-fpm/etc/init.d/php-fpm #php-fpm Start

/etc/init.d/php-fpm

Third, install MySQL, download the installation package

Nginx+php+mysql Construction Guide

Related Article

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.