CentOS 6 The steps to compile and install Lnmp

Source: Internet
Author: User
Tags memcached mkdir centos

# manual Installation Lnmp
Contains Libiconv libunwind gperftools libmcrypt mhash mcrypt libpng freetype jpeg
GD pcre libmemcached php_memcached (memcached.so) eaccelerator Zendoptimizer
mysql5.5 php5.3 nginx1.2.7 memcached tokyocabinet tokyotyrant
#路径
Program Storage/data/service
Lib or Common/data/service/common
Data storage/data/data
Log storage/data/logs

# Yum Source Changes
Rm-f centos6-base-163.repo \
Rm-f/etc/yum.repos.d/centos6-base-163.repo
Yum install-y wget
Wget-4--no-cache http://mirrors.163.com/.help/CentOS6-Base-163.repo \
-o/etc/yum.repos.d/centos6-base-163.repo

Mv/etc/yum.repos.d/centos-base.repo/etc/yum.repos.d/centos-base.repo.bak

Yum Makecache && yum update-y && rm-f/etc/yum.repos.d/centos-base.repo

Yum install NTP wget cpp gcc gcc-c++ gcc-g77 make unzip libtool \
Libtool-ltdl-devel libc-client-devel libstdc++-devel db4-utils libcap-devel \
Expat-devel perl pam-devel perl-time-hires libaio-devel bzr patch bzip2-devel \
CMake Bison libevent-devel ncurses-devel openssl-devel zlib-devel \
Libxml2-devel tcp_wrappers-devel nasm Lemon flex libxpm-devel fontconfig-devel \
Pcre-devel Sqlite-devel perl-extutils-embed Neon-devel

# Libiconv
./configure
Make && make install
echo "/usr/local/lib" >>
/etc/ld.so.conf.d/service_lib.conf &&/sbin/ldconfig

# Libunwind
Cflags=-fpic./configure
Make Cflags=-fpic && make cflags=-fpic Install

# Gperftools
./configure--enable-frame-pointers
Make && make install
/sbin/ldconfig

# MySQL 5.5
Groupadd mysql-g 1002
Useradd mysql-u 1002-g mysql-s/sbin/nologin

Rm-f CMakeCache.txt
CMake \
. -dcmake_install_prefix=/data/service/mysql \
-dmysql_datadir=/data/data/mysql \
-DSYSCONFDIR=/DATA/SERVICE/MYSQL/ETC \
-dmysql_unix_addr=/tmp/mysql.sock \
-dwith_innobase_storage_engine=1 \
-dwith_memory_storage_engine=1 \
-dwith_federated_storage_engine=1 \
-dwith_blackhole_storage_engine=1 \
-dwith_example_storage_engine=1 \
-dwith_partition_storage_engine=1 \
-dwith_archive_storage_engine=1 \
-dwith_myisam_storage_engine=1 \
-dwith_perfschema_storage_engine=1 \
-ddefault_charset=utf8 \
-DDEFAULT_COLLATION=UTF8_GENERAL_CI \
-dwith_extra_charsets=all \
-dwith_readline=1 \
-denabled_local_infile=1 \
-dmysql_tcp_port=3306 \
-dwith_debug=0
Make && make install

Ln-s/data/service/mysql/lib/data/service/mysql/lib64
echo "/data/service/mysql/lib64/" >>
/etc/ld.so.conf.d/service_lib.conf &&/sbin/ldconfig
Mkdir-p/data/service/mysql/etc && mkdir-p/data/data/mysql
Cp-f support-files/my-medium.cnf/data/service/mysql/etc/my.cnf
# # Add Gperftools
Sed-i ' s/executing\ mysqld_safe$/&\nexport\ ld_preload= ' \/usr\/local\/lib\/libtcmalloc.so '/'
/data/service/mysql/bin/mysqld_safe

Cp-f Support-files/mysql.server/data/service/mysql/mysqld
chmod 755/data/service/mysql/mysqld
Chown-r Mysql.mysql/data/data/mysql

Vim/data/service/mysql/etc/my.cnf
[Mysqld]
Pid-file =/data/data/mysql/mysqld.pid
DataDir =/data/data/mysql

Max_connections = 500
max_connect_errors=10000
Slow_query_log=1
Slow_query_log_file =/data/data/mysql/slowsql.log
Long_query_time = 2
Log-queries-not-using-indexes

innodb_file_per_table = 1
Innodb_data_home_dir =/data/data/mysql
Innodb_data_file_path = ibdata1:10m:autoextend:max:2000m
Innodb_log_group_home_dir =/data/data/mysql
innodb_file_per_table = 1
Innodb_buffer_pool_size = 256M
Innodb_additional_mem_pool_size = 2M
Innodb_log_buffer_size = 8M
Innodb_log_file_size = 256M
Innodb_log_files_in_group = 3
Sync_binlog = 1
Innodb_flush_log_at_trx_commit = 0
Innodb_lock_wait_timeout = 50

Log-bin=mysql-bin
Binlog_format = Mixed
Expire_logs_days = 7

[Mysqld_safe]
Log-error =/data/data/mysql/mysql.log

/data/service/mysql/scripts/mysql_install_db \
--user=mysql--basedir=/data/service/mysql--datadir=/data/data/mysql

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.