LNMP(Linux-Nginx-Mysql-PHP)可爱的黄金搭档,不过配置并不轻易,而我平常用于测试环境又经常用到,所以打包了这么一个免安装的LNMP包,内置常用库和模块,以及基本的优化设置,这样子建立一个测试环境仅仅只需要快速的导出一个minimal然后解压这个包执行一个初始脚本就可以让环境恢复了….
Linux运维交流群 : 344177552
各软件包版本:
[root@i-it ~]# tree source/
source/├── curl-7.36.0.tar.bz2
├── freetype-2.5.2.tar.bz2
├── gd-2.0.35.tar.gz
├── gperftools-2.2.tar.gz
├──ImageMagick-6.8.8-10.tar.gz
├── jpegsrc.v9a.tar.bz2
├── libiconv-1.14.tar.gz
├── libmcrypt-2.5.8.tar.bz2
├── libpng-1.6.8.tar.bz2
├── libtool-2.4.2.tar.gz
├── libunwind-1.1.tar.gz
├── libxml2-2.8.0.tar.bz2
├── mhash-0.9.9.9.tar.bz2
├── mysql-5.5.6-rc.tar.gz
├── ncurses-5.9.tar.bz2
├── nginx-1.7.1.tar.gz
├── openssl-1.0.1h.tar.gz
├── pcre-8.35.tar.gz
├── php-5.2.15.tar.bz2
├── xcache-3.1.0.tar.bz2
└── zlib-1.2.8.tar.gz
支持Redhat CentOS 64位操作环境,理论上Ubuntu这样的也能run,不过由于没有充足的时间让我去处理初始化脚本,我本来是想写一个py来调用这个包,然后解包做一次预配置给有兴趣的使用者一个灵活的选择,不过目前而言只是一个渣渣的shell…如下:
[root@i-it /]# cat software/init.sh
#!/bin/bash# Author: Sha Liu.
# Last Modified: 2014/6/14
# Email : itchenyi@gmail.com
# Blog : www.i-it.info
groupadd -g 1500 nginx
useradd -M -u 1500-g nginx -s /sbin/nologin nginx
mkdir /var/tmp/nginx
chown nginx:nginx /var/tmp/nginx/
mkdir /tmp/tcmalloc
chmod 0777/tmp/tcmalloc/
\cp -rf /software/.Full_conf/nginx.start /etc/init.d/nginx
chmod 755/etc/init.d/nginx && chkconfig nginx on
mkdir /data/mysql/{binlog,relaylog}-p
mkdir /data/logs /usr/sbin/groupadd mysql
/usr/sbin/useradd -s /sbin/nologin -g mysql mysql
/software/mysql/bin/mysql_install_db --basedir=/software/mysql/--datadir=/data/mysql/--user=mysql
\cp -rf /software/.Full_conf/mysqld.start /etc/init.d/mysqld
\cp -rf /software/.Full_conf/my.cnf /etc/my.cnf
\cp -rf /software/.Full_conf/limits.conf /etc/security/limits.conf
\cp -rf /software/.Full_conf/sysctl.conf /etc/sysctl.conf
chkconfig mysqld on && chmod 755/etc/init.d/mysqld
chown mysql:mysql /data/mysql/-R echo "/software/sharelib/lib">>/etc/ld.so.conf
echo "/software/google-perftools/lib">>/etc/ld.so.conf
echo "/software/google-libunwind/lib">>/etc/ld.so.conf
echo "/software/mysql/lib/mysql">>/etc/ld.so.conf
ldconfig -v \cp -rf /software/.Full_conf/php-fpm /etc/init.d/php-fpm
chkconfig php-fpm on && chmod 755/etc/init.d/php-fpm service mysqld start
service nginx start
service php-fpm start
首先你要安装一个合适的操作系统,必须是64位的,操作如下:
[root@i-it ~]# tar jxf No_Install_LNMP.tar.bz2 -C /
###解包到根下面,至于上传,自己想办法###
[root@i-it ~]# sh /software/init.sh
###运行初始化脚本###
InstallingMySQL system tables...
OK
Filling help tables...
OK To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !Todo so, start the server,then issue the following commands:/software/mysql//bin/mysqladmin -u root password 'new-password'/software/mysql//bin/mysqladmin -u root -h i-it password 'new-password'Alternatively you can run:/software/mysql//bin/mysql_secure_installation which will also give you the option of removing the test
databases and anonymous user created bydefault.Thisis
strongly recommended for production servers.See the manual for more instructions.You can start the MySQL daemon with:
cd /software/mysql/;/software/mysql//bin/mysqld_safe &You can test the MySQL daemon with mysql-test-run.pl
cd /software/mysql//mysql-test ; perl mysql-test-run.plPlease report any problems with the /software/mysql//scripts/mysqlbug script!/usr/lib64/mysql:
libmysqlclient_r.so.16-> libmysqlclient_r.so.16.0.0
libmysqlclient.so.16-> libmysqlclient.so.16.0.0/software/sharelib/lib:
libcharset.so.1-> libcharset.so.1.0.0
libz.so.1-> libz.so.1.2.8
libMagickWand-6.Q16.so.2-> libMagickWand-6.Q16.so.2.0.0
libiconv.so.2-> libiconv.so.2.5.1
libmhash.so.2-> libmhash.so.2.0.1
libjpeg.so.9-> libjpeg.so.9.1.0
libpng16.so.16-> libpng16.so.16.8.0
libfreetype.so.6-> libfreetype.so.6.11.1
libmcrypt.so.4-> libmcrypt.so.4.4.8
libgd.so.2-> libgd.so.2.0.0
libltdl.so.7-> libltdl.so.7.3.0
libxml2.so.2-> libxml2.so.2.8.0
libMagick++-6.Q16.so.3-> libMagick++-6.Q16.so.3.0.0
libMagickCore-6.Q16.so.2-> libMagickCore-6.Q16.so.2.0.0/software/google-perftools/lib:
libtcmalloc.so.4-> libtcmalloc.so.4.2.1
libprofiler.so.0-> libprofiler.so.0.4.0
libtcmalloc_and_profiler.so.4-> libtcmalloc_and_profiler.so.4.2.1
libtcmalloc_debug.so.4-> libtcmalloc_debug.so.4.2.1
libtcmalloc_minimal.so.4-> libtcmalloc_minimal.so.4.2.1
libtcmalloc_minimal_debug.so.4-> libtcmalloc_minimal_debug.so.4.2.1/software/google-libunwind/lib:
libunwind-coredump.so.0-> libunwind-coredump.so.0.0.0
libunwind.so.8-> libunwind.so.8.0.1
libunwind-ptrace.so.0-> libunwind-ptrace.so.0.0.0
libunwind-x86_64.so.8-> libunwind-x86_64.so.8.0.1
libunwind-setjmp.so.0-> libunwind-setjmp.so.0.0.0/software/mysql/lib/mysql:
libmysqlclient_r.so.16-> libmysqlclient_r.so.16.0.0
libmysqlclient.so.16-> libmysqlclient.so.16.0.0.....省略/lib64/tls:(hwcap:0x8000000000000000)/usr/lib64/sse2:(hwcap:0x0000000004000000)/usr/lib64/tls:(hwcap:0x8000000000000000)StartingMySQL........... SUCCESS!Starting nginx:[ OK ]Starting php_fpm done
各配置文件的路径:
PHP :/software/php/etc/Mysql:/etc/my.cnf Nginx:/software/nginx/conf/
PHP的扩展模块默认启用了 Xcache memcache pdo_mysql,同时也编译了imagick的支持,不过它默认是注释状态,因为有LibX11 libgomp这两个不好编译的软件包,我也懒得把他们从系统库里分离出来,如果要启用请执行以下操作:
1、取消php配置文件中配置的注释
extension ="imagick.so" 2、安装依赖库
[root@i-it ~]# yum install libX11 libgomp -y 3、reload php-fpm
[root@i-it ~]# service php-fpm reload
Reload service php-fpm done
好了,没什么要介绍的了,有任何意见欢迎大家留言给我,谢谢