LNMP Environment Construction

Source: Internet
Author: User

PHP 2.4 MySQL 5.5 nignx 1.4.7

First, install MySQL

Yum Install gcc-c++ cmake ncurses-devel Bison perl-y

Useradd -s/sbin/nologin MySQL

mkdir -p/data/mysql

Chown - R mysql.mysql/data/mysql

Tar -zxvf mysql-5.5.44.tar.gz;cd mysql-5.5.44

Cmake-dcmake_install_prefix=/usr/local/mysql

-dmysql_datadir=/data/mysql

-dwith_myisam_storage_engine=1

-dwith_innobase_storage_engine=1

-dwith_readline=1

-dmysql_tcp_port=3306

-denabled_local_infile=1

-dwith_partition_storage_engine=1

-dextra_charsets=all

-ddefault_charset=utf8

-ddefault_collation=utf8_general_ci

-dwith_debug=0

-dmysql_user=mysql

-dmysql_unix_addr=/data/mysql/mysql.sock

Make -j2 && make install

CP SUPPORT-FILES/MY-MEDIUM.CNF/ETC/MY.CNF

CP Support-files/mysql.server/etc/init.d/mysqld

chmod 755/etc/init.d/mysqld

/usr/local/mysql/scripts/mysql_install_db  --basedir=/usr/local/mysql--datadir=/data/mysql  --user=mysql

/etc/init.d/mysqldstart

Chkconfig--add mysqld

Echo "path= $PATH:/usr/local/mysql/bin" >>/etc/profile

Source /etc/profile

Second, install PHP

CD php-5.4

Yum install-y libxml2-devel libcurl-devel openjpeg-devel libjpeg-turbo-devel libpng-devel freetype-devel

./configure--prefix=/usr/local/php--enable-fpm--enable-debug--WITH-GD--with-jpeg-dir--with-png-dir-- With-freetype-dir--enable-mbstring--with-curl--with-mysql=/usr/local/mysql

Make && make install

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

cd/usr/local/php/etc/&& CP php-fpm.conf.defaultphp-fpm.conf

/ETC/INIT.D/PHP-FPM # # Start PHP-FPM


Third, Installing Nginx

Download Nginx wget http://nginx.org/download/nginx-1.4.7.tar.gz

Tar –ZXVF nginx-1.4.7.tar.gz

CD nginx-1.4.7

Yum Install pcre-devel-y Install Pcre library, support rewrite rewrite

Note: When installing the source code pcre, specify the pcre path as the extracted path, not the compiled path, otherwise it will error

Yum Install-y openssl-devel

Useradd-s/sbin/nologing-m www

./configure--user=www--group=www--prefix=/usr/local/nginx--with-http_stub_status_module--with-http_ssl_module

Make && make install

Four, Nginx Integrate PHP

Edit nginx config file nginx.conf, in the Server field, add:

Location ~ \.php$ {

root HTML;

Fastcgi_pass 127.0.0.1:9000;

Fastcgi_index index.php;

Fastcgi_param Script_filename/usr/local/nginx/html$fastcgi_script_name;

Include Fastcgi_params;

}


650) this.width=650, "src=" http://s3.51cto.com/wyfs02/M01/72/25/wKiom1XddLajZqOxAABZLnidG90754.jpg "title=" 1.png "alt=" Wkiom1xddlajzqoxaabzlnidg90754.jpg "/>

Switch

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/72/21/wKioL1XddtzgFrPSAABau-s_j3g291.jpg "title=" 2.png " alt= "Wkiol1xddtzgfrpsaabau-s_j3g291.jpg"/>


This article is from the "PC personal blog" blog, make sure to keep this source http://pc1990.blog.51cto.com/10541224/1688504

LNMP Environment Construction

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.