189 8069 5689

lnmp脚本安装-创新互联

#!/bin/bash

创新互联公司网站建设提供从项目策划、软件开发,软件安全维护、网站优化(SEO)、网站分析、效果评估等整套的建站服务,主营业务为网站设计、网站建设,app软件定制开发以传统方式定制建设网站,并提供域名空间备案等一条龙服务,秉承以专业、用心的态度为用户提供真诚的服务。创新互联公司深信只要达到每一位用户的要求,就会得到认可,从而选择与我们长期合作。这样,我们也可以走得更远!

SOFTWARE_SOURCE=/home/source

NGINX_VERSION=nginx-1.8.0.tar.gz

MYSQL_VERSION=mysql-5.6.26.tar.gz

PHP_VERSION=php-5.5.29.tar.gz

if [ ! -d $SOFTWARE_SOURCE/nginx-1.8.0 ];then

echo "=========================开始安装Nginx=========================="

    for i in $(chkconfig | awk '{print $1}');do chkconfig $i off; done

    chkconfig network on

    chkconfig sshd on

    chkconfig rsyslog on

    chkconfig crond on

    yum install gcc gcc-c++ zlib zlib-devel pcre pcre-devel openssl openssl-devel -y

    tar xf $SOFTWARE_SOURCE/$NGINX_VERSION -C $SOFTWARE_SOURCE

    cd $SOFTWARE_SOURCE/nginx-1.8.0

./configure \

--prefix=/usr/local/nginx \

--user=web \

--group=web \

--with-http_stub_status_module \

--with-http_ssl_module

make && make install || exit 1

    echo "=========================安装Nginx成功==========================="

else

    echo "=========================安装Nginx失败==========================="

fi

if [ ! -d $SOFTWARE_SOURCE/mysql-5.6.26 ];then

echo "=========================开始安装MySQL==========================="

    useradd -s /sbin/nologin mysql

    yum install cmake ncurses ncurses-devel -y

    tar xf $SOFTWARE_SOURCE/$MYSQL_VERSION -C $SOFTWARE_SOURCE

    cd  $SOFTWARE_SOURCE/mysql-5.6.26

cmake \

-DCMAKE_INSTALL_PREFIX=/usr/local/mysql \

-DMYSQL_DATADIR=/home/mysql/data \

-DSYSCONFDIR=/etc \

-DWITH_MYISAM_STORAGE_ENGINE=1 \

-DWITH_INNOBASE_STORAGE_ENGINE=1 \

-DWITH_MEMORY_STORAGE_ENGINE=1 \

-DWITH_READLINE=1 \

-DMYSQL_UNIX_ADDR=/var/lib/mysql/mysql.sock \

-DMYSQL_TCP_PORT=3306 \

-DENABLED_LOCAL_INFILE=1 \

-DWITH_PARTITION_STORAGE_ENGINE=1 \

-DEXTRA_CHARSETS=all \

-DDEFAULT_CHARSET=utf8 \

-DDEFAULT_COLLATION=utf8_general_ci

make && make install || exit 1

    echo "=========================安装MySQL成功==========================="

else

    echo "=========================安装MySQL失败==========================="

    echo "=========================安装MySQL成功==========================="

else

    echo "=========================安装MySQL失败==========================="

fi

if [ ! -d $SOFTWARE_SOURCE/php-5.5.29 ];then

echo "=========================开始安装PHP==========================="

    yum install make gd gd-devel zlib zlib-devel \

        libxml2 libxml2-devel freetype \

        freetype-devel libpng libpng-devel \

        bison bison-devel libjpeg libjpeg-devel \

        libmcrypt libmcrypt-devel curl curl-devel -y

    tar xf $SOFTWARE_SOURCE/$PHP_VERSION -C $SOFTWARE_SOURCE

    cd $SOFTWARE_SOURCE/php-5.5.29

./configure \

--prefix=/usr/local/php \

--with-config-file-path=/usr/local/php/etc \

--with-mysql=/usr/local/mysql/ \

--with-mysqli=/usr/local/mysql/bin/mysql_config \

--with-pdo-mysql=/usr/local/mysql \

--with-libxml-dir \

--with-png-dir \

--with-jpeg-dir \

--with-freetype-dir \

--with-gd \

--with-zlib-dir \

--with-openssl \

--with-mcrypt \

--enable-xml \

--enable-soap \

--enable-safe-mode \

--enable-short-tags \

--enable-static \

--enable-mbstring=all \

--enable-sockets \

--enable-fpm \

--enable-mbstring \

--with-curl \

--with-mhash \

make && make install || exit 1

    echo "=========================安装PHP成功==========================="

else

    echo "=========================安装PHP失败==========================="

fi

另外有需要云服务器可以了解下创新互联scvps.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


文章名称:lnmp脚本安装-创新互联
网页地址:http://jkwzsj.com/article/dpsgji.html

其他资讯