Centos 6 compile and install LNMP

Source: Internet
Author: User
Tags mcrypt mysql login openldap

Build the Environment: Centos 6.8,nginx 1.9.14,mysql 5.6.23,php 5.6.17

First, the purpose: Lnmp has now become a mainstream Web server building solution, such as the company's internal Ecstore,discuz, which is planned to replace the Zabbix of the NAGIOS+CHECK_MK monitoring platform. Can be based on LNMP. This stand-alone LNMP build to be familiar with the e-commerce cluster to prepare, by the way, record the construction process, the province of each build, the next time the building will have to start again.

Second, LNMP installation environment preparation:

Yum-y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-deve L zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel Curl curl-devel e2fsprogs E2 Fsprogs-devel krb5 krb5-devel libidn libidn-devel OpenSSL openssl-devel openldap openldap-devel openldap-clients Openldap-servers make libtool* git tree bison pcre-devel perl gd Gd-devel

Install Libiconv (Support encoding conversion to function)

Tar XF libiconv-1.14.tar.gz cd libiconv-1.14/./configure--prefix=/usr/local make && make install

Installing Libmcrypt (encryption algorithm extension library, support Des, 3DES, RIJNDAEL, Twofish, Idea, GOST, CAST-256, Arcfour, Serpent, safer+ algorithm)

Tar XF libmcrypt-2.5.8.tar.gzcd libmcrypt-2.5.8./configuremake && make install CD libltdl/./configure-- Enable-ltdl-install #加载动态库make && make install

Install Mhash (Mhash is a non-reversible PHP encryption extension library based on discrete mathematical principles, which is not turned on by default.) Mhash can be used to create checksum value, message digest, message authentication code, and save the key information without the original text.

Tar XF mhash-0.9.9.9.tar.bz2 CD mhash-0.9.9.9./configuremake && make install

Install Mcript (MCrypt is an important encryption support in PHP extension library, MCrypt Extension Library can implement encryption and decryption function, that is, both plaintext can be encrypted, or ciphertext restore. )

Cd/usr/local/srctar zxvf mcrypt-2.6.8.tar.gz cd mcrypt-2.6.8/export ld_library_path=/usr/local/lib: $LD _library_path #暂时生效./configure make && make install

Library files can also be added in the following two ways

Ln-s/usr/local/lib/libmcrypt.la/usr/lib/libmcrypt.la ln-s/usr/local/lib/libmcrypt.so/usr/lib/libmcrypt.so ln-s/ Usr/local/lib/libmcrypt.so.4/usr/lib/libmcrypt.so.4 ln-s/usr/local/lib/libmcrypt.so.4.4.8/usr/lib/ libmcrypt.so.4.4.8 ln-s/usr/local/lib/libmhash.a/usr/lib/libmhash.a ln-s/usr/local/lib/libmhash.la/usr/lib/ libmhash.la ln-s/usr/local/lib/libmhash.so/usr/lib/libmhash.so ln-s/usr/local/lib/libmhash.so.2/usr/lib/ Libmhash.so.2 ln-s/usr/local/lib/libmhash.so.2.0.1/usr/lib/libmhash.so.2.0.1 ln-s/usr/local/bin/libmcrypt-config /usr/bin/libmcrypt-config
Vim/etc/ld.so.conf/usr/local/lib/ldconfig

Install CMake (MySQL has been removed from version 5.5 and compiled by./configure and replaced by the CMake tool)

Tar XF cmake-3.4.1.tar.gzcd cmake-3.4.1./bootstrapmake && make install

Third, MySQL compilation installation

New MySQL User

Groupadd-r mysqluseradd-r-G MySQL MySQL

New MySQL Required Directory

Mkdir-p/usr/local/mysql mkdir-p/data/mysqldb

Compiling the installation

Tar XF mysql-5.6.23.tar.gzcd mysql-5.6.23cmake-dcmake_install_prefix=/usr/local/mysql\-DDEFAULT_CHARSET=utf8\- Ddefault_collation=utf8_general_ci\-dwith_innobase_storage_engine=1\-dwith_archive_storage_engine=1\-DWITH_ blackhole_storage_engine=1\-dmysql_datadir=/data/mysqldb\-dmysql_tcp_port=3306\-DENABLE_DOWNLOADS=1\- Dsysconfdir=/etc\-dwith_ssl=system\-dwith_zlib=system\-dwith_libwrap=0make&& make install

Modify MySQL directory permissions

Cd/usr/local/mysql chown-r mysql:mysql. Cd/data/mysqldb chown-r mysql:mysql.

Initializing MySQL Database

cd/usr/local/mysql./scripts/mysql_install_db--user=mysql--datadir=/data/mysqldb

Compilation Modification/ETC/MY.CNF

[mysql] # client  #port                             = 3306socket                           = /data/mysqldb/mysql.sock [mysqld] # general   #user                             = mysqldefault-storage-engine          = InnoDBsocket                          =  /data/mysqldb/mysql.sockpid-file                        = /data/mysqldb/mysql.pid # myisam  #key-buffer-size                 =  32mmyisam-recover                  = FORCE,BACKUP # SAFETY  #max-allowed-packet              = 16Mmax-connect-errors              = 1000000 # DATA STORAGE  #datadir                          = /data/mysqldb/ # BINARY LOGGING  #log-bin                          = /data/mysqldb/mysql-binexpire-logs-days                = 14sync-binlog                     = 1 # REPLICATION  #skip-slave-start                = 1relay-log                        = /data/mysqldb/relay-binslave-net-timeout               = 60 # caches and limits # tmp-table-size                  = 32mmax-heap-table-size            =  32mquery-cache-type &nbSp;             = 0query-cache-size                =  0max-connections                 = 500thread-cache-size               = 50open-files-limit                = 65535table-definition-cache         =  4096table-open-cache                = 4096 # INNODB  #innodb-flush-method             = O_DIRECTinnodb-log-files-in-group      =  2innodb-log-file-size           = 64minnodb-flush-log-at-trx-commit =  1innodb-file-per-table          =  1innodb-buffer-pool-size        = 592m # logging # log-error                       = /data/mysqldb/mysql-error.loglog-queries-not-using-indexes   = 1slow-query-log                  = 1slow-query-log-file             = /data/mysqldb/mysql-slow.log

Copy the MySQL boot file and its commands join path

CP Support-files/mysql.server/etc/init.d/mysqld vim/etc/profile.d/mysql.sh path=/usr/local/mysql/bin:/usr/local/ Mysql/lib: $PATH Export pathsource/etc/profile.d/mysql.sh

Start MySQL and add startup items

Service mysqld start Chkconfig mysqld on

Set MySQL login permissions

Drop user ' @localhost;d rop user ' @hostname; update mysql.user set Password=password (' ******* '); flush privileges;

Iv. installation of Nginx compiler

This article is from the "Frank" blog, so be sure to keep this source http://zhoufan.blog.51cto.com/4278592/1793394

Centos 6 compile and install LNMP

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.