中文字幕av专区_日韩电影在线播放_精品国产精品久久一区免费式_av在线免费观看网站

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

Apache2.4.25+mysql5.7+php7.13編譯安裝For Centos7

發布時間:2020-07-11 10:42:29 來源:網絡 閱讀:1252 作者:一招拜師 欄目:MySQL數據庫

#!/bin/bash

#此腳本適合新系統安裝,一鍵安裝腳本

#安裝環境

#[root@localhost apache]# hostnamectl 

#         Icon name: computer-vm

#           Chassis: vm

#    Virtualization: vmware

#  Operating System: CentOS Linux 7 (Core)

#       CPE OS Name: cpe:/o:centos:centos:7

#  Kernel: Linux 3.10.0-514.10.2.el7.x86_64

#      Architecture: x86-64

#Author:sadoc.blog.51cto.com

#Date:2017-04-08


. /etc/rc.d/init.d/functions


apache2="httpd-2.4.25.tar.gz"

apr152="apr-1.5.2.tar.gz"

aprutil="apr-util-1.5.4.tar.gz"

libiconv1="libiconv-1.15.tar.gz"

php173="php-7.1.3.tar.gz"

noarch="mysql57-community-release-el7-9.noarch.rpm"

pcre8="pcre-8.40.tar.gz"

appd="/opt/app/"

down="/opt/download"

xiezai="httpd mysql php"


for rpme in $xiezai

do

rpm -qa | grep $rpme


if [ $? = 0 ];then

  yum remove $rpme -y

fi

done 


if [ -d $appd/php7.1.3 ];then

   rm -rf $appd/php7.1.3

fi


if [ -d $appd/apache2.4.25 ];then

   rm -rf $appd/apache2.4.25

fi


if [ -d $appd/other_app ];then

   rm -rf -f $appd/other_app

fi



yum  install epel-release -y


packages="libxml2-devel curl-devel openjpeg openjpeg-devel openjpeg-libs libjpeg libpng freetype cmake wget autoconf"

apk="libjpeg libpng-devel freetype-devel mcrypt php-mcrypt libmcrypt libmcrypt-devel zlib-devel net-tools libxml2-devel"

apps="openssl-devel gcc gcc-c++ zip unzip gzip krb5 krb5-devel  glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl-devel"

for app in $packages $apps $apk 

do

 rpm -qa | grep $app >/dev/null 2>&1

 if [ $? = 0 ];then

 action "$app :: success" /bin/true

 else

 action "$app :: FAILED" /bin/false

 yum install $app -y >/dev/null 2>&1

 fi

 done

 

[ -d $appd ] || mkdir $appd -p

[ -d $down ] || mkdir $down -p

[ -d $appd/apache2.4.25 ] || mkdir $appd/apache2.4.25 -p

[ -d $appd/other_app ] || mkdir $appd/other_app -p

[ -d $appd/php7.1.3 ] || mkdir $appd/php7.1.3 -p


cd $down

[ -f $apr152 ] || wget http://mirrors.hust.edu.cn/apache//apr/apr-1.5.2.tar.gz

[ -f $aprutil ] || wget http://mirrors.hust.edu.cn/apache//apr/apr-util-1.5.4.tar.gz

[ -f $libiconv1 ] || wget https://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.15.tar.gz

[ -f $apache2 ] || wget http://mirror.bit.edu.cn/apache/httpd/httpd-2.4.25.tar.gz

[ -f $noarch ] || wget https://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm

[ -f $php173 ] || wget -t5 http://ca1.php.net/distributions/php-7.1.3.tar.gz

[ -f $pcre8 ] || wget  ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.40.tar.gz


rpm -ivh mysql57-community-release-el7-9.noarch.rpm


yum install mysql-server -y


tar zxf $apr152 && cd apr-1.5.2

./configure --prefix=/opt/app/other_app/apr

if [ $? = 1 ];then

    exit 1

else

make && make install

fi



cd $down

tar zxf $aprutil

cd apr-util-1.5.4

./configure --prefix=/opt/app/other_app/apr_util \

--with-apr=/opt/app/other_app/apr

if [ $? = 1 ];then

    exit 1

else

make && make install

fi


cd $down

tar zxf $libiconv1

cd libiconv-1.15

./configure --prefix=/opt/app/other_app/libiconv1.15

if [ $? = 1 ];then

    exit 1

else

make && make install

fi


cd $down

tar zxf $pcre8

cd pcre-8.40

./configure --prefix=/opt/app/other_app/pcre8.4

if [ $? = 1 ];then

    exit 1

else

make && make install

fi


cd $down

tar zxf $apache2

cd httpd-2.4.25

./configure --prefix=/opt/app/apache2.4.25 \

--with-apr=/opt/app/other_app/apr \

--with-apr-util=/opt/app/other_app/apr_util \

--with-pcre=/opt/app/other_app/pcre8.4 \

--enable-deflate \

--enable-expires \

--enable-headers \

--enable-modules=most \

--enable-so \

--with-mpm=worker \

-enable-rewrite \

--enable-zlib


if [ $? = 1 ];then

    exit 1

else

make && make install

fi



cd 


ln -s /opt/app/apache2.4.25 /opt/app/apache


cd $down

tar zxf $php173

cd php-7.1.3

./configure --prefix=/opt/app/php7.1.3 \

--with-apxs2=/opt/app/apache/bin/apxs \

-enable-calendar \

--with-mhash \

--with-openssl \

--with-mysqli=mysqlnd \

--with-mysqli=mysqlnd \

--with-pdo-mysql=mysqlnd \

--with-gd \

--with-iconv \

--with-zlib \

--enable-zip \

--enable-inline-optimization \

--disable-debug \

--disable-rpath \

--enable-shared \

--enable-xml \

--enable-bcmath \

--enable-shmop \

--enable-sysvsem \

--enable-mbregex \

--enable-mbstring \

--enable-ftp \

--enable-gd-native-ttf \

--enable-pcntl \

--enable-sockets \

--with-xmlrpc \

--enable-soap \

--without-pear \

--with-gettext \

--enable-session \

--with-curl \

--with-jpeg \

--with-freetype \

--enable-opcache \

--without-gdbm \

--with-mcrypt \

--disable-fileinfo





if [ $? = 1 ];then

    exit 1

else

make && make install

fi


exit 1

#########End############################################################



#配置apache2

vim /opt/app/apache/conf/httpd.conf 修改成如下


194 ServerName localhost:80


251 <IfModule dir_module>

252     DirectoryIndex index.html index.php inex.phtml

253 </IfModule>


388 AddType application/x-compress .Z

389 AddType application/x-gzip .gz .tgz

390 AddType application/x-httpd-php .php

391 AddType application/x-httpd-php-source .phps




#mysql5.7.11 root密碼

#https://dev.mysql.com/doc/refman/5.7/en/linux-installation-yum-repo.html

#啟動服務

#systemctl start mysqld.service

#查看臨時密碼

#grep 'temporary password' /var/log/mysqld.log

#修改密碼

#mysql_secure_installation 安全初始化.

測試書庫就鏈接

vim /opt/app/apache/htdocs/index.php


<?php

$servername = "127.0.0.1";

$username = "user";

$password = "Admin1379!";


// 創建連接

$conn = new mysqli($servername, $username, $password);


// 檢測連接

if ($conn->connect_error) {

    die("連接失敗: " . $conn->connect_error);

}

echo "連接成功";

?>


向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

吕梁市| 康保县| 台南县| 怀宁县| 宁乡县| 花垣县| 四会市| 夏邑县| 泉州市| 女性| 合川市| 武平县| 武清区| 光泽县| 岐山县| 新绛县| 禹州市| 息烽县| 泰来县| 北流市| 凯里市| 呼图壁县| 西华县| 赫章县| 台北市| 游戏| 张家口市| 林甸县| 凤山市| 靖西县| 大田县| 杭锦旗| 德令哈市| 姚安县| 建阳市| 平陆县| 沐川县| 同江市| 武宣县| 澎湖县| 全椒县|