您好,登錄后才能下訂單哦!
#!/bin/bash
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
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請(qǐng)聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。