一键安装lnmp脚本(包括软件版本)

直接上脚本:附件也包含脚本

#!/bin/bash

yum -y install make apr* autoconf automake curl-devel gcc gcc-c++ zlib-devel openssl openssl-devel pcre-devel gd  kernel keyutils  patch  perl kernel-headers compat* mpfr cpp glibc libgomp libstdc++-devel ppl cloog-ppl keyutils-libs-devel libcom_err-devel libsepol-devel libselinux-devel krb5-devel zlib-devel libXpm* freetype libjpeg* libpng php-common php-gd ncurses* libtool* libxml2 libxml2-devel patch freetype-devel cmake zlib  ncurses* openssl*  cmake gcc* autoconf bison  libpng*

##文件请上传至/opt/soft/

cd /opt/soft/

##安装pcre支持正则

tar -zxvf pcre-8.34.tar.gz

cd pcre-8.34

./configure && make && make install

##增加www用户和组

groupadd www

useradd -s /sbin/nologin -M -g www www

##安装zlib 支持gzip

cd /opt/soft/

tar -zxvf zlib-1.2.8.tar.gz

cd zlib-1.2.8

./configure && make && make install

##安装nginx

cd /opt/soft/

tar -zxvf nginx-1.11.6.tar.gz

cd nginx-1.11.6

./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-ipv6  --with-pcre=/opt/soft/pcre-8.34 --with-zlib=/opt/soft/zlib-1.2.8

make && make install

###安装php支持软件

cd /opt/soft/

tar zxvf libiconv-1.14.tar.gz

cd libiconv-1.14/

./configure

sed -i s‘#_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");#//_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");#‘ srclib/stdio.h

make && make install

cd /opt/soft/

##安装libmcrypt

tar zxvf libmcrypt-2.5.8.tar.gz

cd libmcrypt-2.5.8

./configure && make && make install

ldconfig

cd libltdl/

./configure --enable-ltdl-install

make && make install

###mhash

cd /opt/soft/

tar zxvf mhash-0.9.9.9.tar.gz

cd mhash-0.9.9.9

./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

cd /opt/soft/

tar zxvf mcrypt-2.6.8.tar.gz

cd mcrypt-2.6.8

ldconfig

./configure && make && make install

###安装php

cd /opt/soft/

mkdir -p /usr/local/php/etc

tar -zxvf php-5.6.11.tar.gz

cd php-5.6.11

./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-magic-quotes --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-mbstring --with-mcrypt --enable-ftp --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --enable-fileinfo --with-libdir=lib64 --enable-opcache

echo "/usr/local/lib">>/etc/ld.so.conf

ldconfig

make ZEND_EXTRA_LIBS=‘-liconv‘

make install

##安装redis扩展

cd /opt/soft/

tar -zxvf phpredis-2.2.4.tar.gz

cd phpredis-2.2.4

/usr/local/php/bin/phpize

./configure --with-php-config=/usr/local/php/bin/php-config

make && make install

###安装swool

cd /opt/soft/

#yum install git -y

#git clone https://github.com/swoole/swoole-src.git

tar -zxvf  swoole-src.tar.gz

cd swoole-src/

/usr/local/php/bin/phpize

./configure --with-php-config=/usr/local/php/bin/php-config

make && make install

cd /opt/soft/

cp /opt/soft/php.ini /usr/local/php/etc/

cp /opt/soft/php-fpm.conf   /usr/local/php/etc/

mkdir /usr/local/php/log

mkdir /opt/web

mv /usr/local/nginx/conf/nginx.conf /usr/local/nginx/conf/nginx.conf.bak

cp nginx.conf /usr/local/nginx/conf/

/usr/local/nginx/sbin/nginx

/usr/local/php/sbin/php-fpm

####安装mysql:

groupadd mysql

useradd -s /sbin/nologin -M -g mysql mysql

cd /opt/soft

tar -zxvf mysql-5.6.25.tar.gz

cd mysql-5.6.25

cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DEXTRA_CHARSETS=all -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_READLINE=1 -DWITH_SSL=system -DWITH_ZLIB=system -DWITH_EMBEDDED_SERVER=1 -DENABLED_LOCAL_INFILE=1

make && make install

cp /etc/my.cnf /etc/my.cnf.bak

cd /opt/soft

cp my.cnf /etc/

##授权

cd /usr/local/mysql/

chown -R mysql .

chgrp -R mysql .

##初始化mysql:

/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql --defaults-file=/etc/my.cnf

##启动mysql:

/usr/local/mysql/bin/mysqld_safe  --defaults-file=/etc/my.cnf --user=mysql&

sleep 10

##修改密码

/usr/local/mysql/bin/mysqladmin  -u root password "dengchao"

/usr/local/mysql/bin/mysql  -uroot -pdengchao -e ‘grant all privileges on   *.* to [email protected]"%" identified by "zTt20LB5" with grant option;‘

/usr/local/mysql/bin/mysql  -uroot -pdengchao -e ‘flush privileges ;‘

由于51cto限制上传50m附件,所以附件已上传至百度云:

http://pan.baidu.com/s/1pKBuCQJ

有问题,请大家多多交流

时间: 02-02

一键安装lnmp脚本(包括软件版本)的相关文章

Rehat一键安装mysql脚本和备份数据库脚本

Rehat一键安装mysql脚本 ##说明:适用,Rehat 5 6 7 1.运行状态,运行成功输出mysql临时密码 2.代码如下 #!/bin/bash #获取系统信息 sudo cat /etc/issue>myfile aa=sudo grep '5.' myfile bb=sudo grep '6.' myfile cc=sudo grep '7.' myfile echo $aa echo "It is a test" > myfile #获取系统信息 sudo

一键安装shell脚本

一.一键安装nginx脚本 #!/bin/bash #################################### #Name:nginx_install.sh #Author:doublelinux #version:1.1 #Date:2017/08/19 #################################### yum -y install pcre pcre-devel yum -y install openssl openssl-devel mkdir -p

一键安装lnmp报错 pycurl.so: undefined symbol: CRYPTO_set_locking_callback

There was a problem importing one of the Python modulesrequired to run yum. The error leading to this problem was: /usr/lib64/python2.6/site-packages/pycurl.so: undefined symbol: CRYPTO_set_locking_callback Please install a package which provides thi

LNMP一键安装shell脚本(v1.2)

鉴于搭建一个LNMP环境使用一步一步的方法安装比较笨拙,故将安装步骤编写成一个简单shell脚本,并且能实现大部分需求 适合的系统版本:CentOS6.5-6.7 64位 安装的前提准备: mysql-5.6.28.tar.gz cmake-3.4.3.tar.gz nginx-1.8.1.tar.gz libgd-2.1.1.tar.bz2 ibiconv-1.14.tar.gz jpegsrc.v6b.tar.gz php-5.6.20.tar.bz2 将以上的源码包download下来放并

LNMP一键安装---LNMP部署就是这么容易

=======该脚本在CentOS6.5_x86_64位系统验证通过,荐于环境限制其它平台未做测试======== 安装方式: =================================================================================== 将OneKey_Install_LNMP.zip上传到Linux服务器后解压并执行包中shell脚本: 解压包:unzip OneKey_Install_LNMP.zip 切换包目录:cd OneKey_

Centos6.5中一键安装LNMP和收工配置

1. cd /usr wget -c http://soft.vpser.net/lnmp/lnmp1.2-full.tar.gz tar zxf lnmp1.2-full.tar.gz cd lnmp1.2-full ./install.sh lnmp 进入安装状态后按照提示做安装选择( 参考 http://lnmp.org/install.html )

一键安装nginx脚本

#!/bin/bash . /etc/init.d/functions #安装依赖包 yum -y install pcre-devel openssl-devel #创建相关目录,并下载nginx软件包 [ ! -d /application ] && mkdir -p /application [ ! -d /server/tools ] && mkdir -p /server/tools cd /server/tools wget http://nginx.org/d

一键安装lnmp(5)

php(){cd $pathtar zxvf yasm-1.3.0.tar.gz cd yasm-1.3.0.tar.gz ./configuremakemake installcd $pathtar zxvf libmcrypt-2.5.8.tar.gzcd libmcrypt-2.5.8./configure --prefix=/usr/local/libmcryptmakemake installcd $pathtar jxvf libvpx-1.4.0.tar.bz2cd libvpx-

一键安装lnmp(2)

all(){path=`pwd`cd $pathechoecho "exclude=*.i386 *.i686" >> /etc/yum.confrpm -ivh http://mirrors.ustc.edu.cn/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpmyum listyum update -ysleep 20;#######检查命令是否执行正常##############################if [