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 bision pcre-devel perl
Installing Libiconv
Tar zxvf libiconv-1.14.tar.gz cd libiconv-1.14/./configure--prefix=/usr/local make && make install
Installing Libmcrypt
TAR-ZXVF LIBMCRYPT-2.5.7.TAR.GZCD libmcrypt-2.5.7./configuremake make install CD libltdl/./configure-- Enable-ltdl-install make make Install
Installing Mhash
Tar xfmhash-0.9.9.9.tar.bz2 CD mhash-0.9.9.9./configuremake&& make install
Installing Mcript
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
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
installation CMake
Tar zxvfcmake-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 zxvf 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/1793098
Centos 6 compile and install LNMP