centos6.7 under compile and install LNMP

Source: Internet
Author: User

Many steps do not explain, please refer to my centos6.7 under the compiler installation lamp, this time the architecture is nginx+php-fpm a server, MySQL a server

(1) First compile and install Nginx:

Action command: yum-y groupinstall "Development Tools" "Server Platform Development"

Yum-y Install Pcre-devel

Useradd-r Nginx

Mkdir/var/tmp/nginx have to create this directory in advance, or you will get an error when you start Nginx

Tar XF nginx-1.8.1.tar.gz

CD nginx-1.8.1

./configure--prefix=/usr/local/nginx--sbin-path=/usr/local/nginx/sbin/nginx

--error-log-path=/var/log/nginx/error.log--conf-path=/etc/nginx/nginx.conf

--http-log-path=/var/log/nginx/access.log--pid-path=/var/run/nginx/nginx.pid--lock-path=/var/lock/nginx.lock--

User=nginx--group=nginx--with-http_ssl_module--with-http_flv_module--with-http_stub_status_module--http-

client-body-temp-path=/var/tmp/nginx/client/--http-proxy-temp-path=/var/tmp/nginx/proxy/--http-fastcgi-temp-

path=/var/tmp/nginx/fcgi/--with-pcre

Make && make install

echo "Export Path=/usr/local/nginx/sbin: $PATH" >/etc/profile.d/nginx.sh

EXEC bash

(2) Compile and install PHP:

Operation command: yum-y install libxml2-devel bzip2-devel libjpeg-devel libpng-devel freetype-devel libcurl-devel

Libmcrypt-devel (This package is in the Epel source)

Tar XF php-5.4.40.tar.bz2 CD php-5.4.40

./configure--prefix=/usr/local/php--with-mysql=mysqlnd--with-mysqli=mysqlnd--with-pdo-mysql=mysqlnd--

With-openssl--enable-fpm--enable-sockets--enable-sysvshm--enable-mbstring--with-freetype-dir--with-jpeg-dir-

-with-png-dir--with-zlib-dir--with-libxml-dir=/usr--enable-xml--with-mhash--with-mcrypt--with-config-file-

Path=/etc--WITH-CONFIG-FILE-SCAN-DIR=/ETC/PHP.D--with-bz2--with-curl

Make && do install make test

CP Php.ini-production/etc/php.ini

CP SAPI/FPM/INIT.D.PHP-FPM/ETC/RC.D/INIT.D/PHP-FPM

chmod +x/etc/rc.d/init.d/php-fpm

Chkconfig--add PHP-FPM

Chkconfig PHP-FPM on

cp/usr/local/php/etc/php-fpm.conf.default/usr/local/php/etc/php-fpm.conf providing configuration files for PHP-FPM

Vim/usr/local/php/etc/php-fpm.conf

Pm.max_children = 150 configuring PHP up to how many child processes can be started at a time (one connection per child process)

Pm.start_servers = 8

Pm.min_spare_servers = 5

Pm.max_spare_servers = 10

(3) Integration of Nginx and PHP5

Vim/etc/nginx/nginx.conf

$fastcgi _script_name represents the requested URI mapping relationship www.$$$.com/index.php--and/use/local/nginx/html/index.php

Fastcgi_params map to this file/etc/nginx/fastcgi_params

MySQL compiler installed in compile Lamp blog post has been introduced, not described here

Adding caching features using the Fastcgi_cache module

Add the following options in the HTTP context:

To add an accelerator to PHP:

Tar XF xcache-3.2.0.tar.bz2 CD xcache-3.2.0

/usr/local/php/bin/phpize./configure--enable-xcache--with-php-config=/usr/local/php/bin/php-config

Make && make install MKDIR/ETC/PHP.D CP xcache.ini/etc/php.d/

  Service PHP-FPM Restart

  

centos6.7 under compile and install LNMP

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.