Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Apache2.4.25+mysql5.7+php7.13 compilation and installation of For Centos7

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

#! / bin/bash

# this script is suitable for new system installation, one-click installation script

# installation environment

# [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###

# configure apache2

Vim / opt/app/apache/conf/httpd.conf is modified as follows

194 ServerName localhost:80

two hundred and fifty one

252 DirectoryIndex index.html index.php inex.phtml

two hundred and fifty three

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 password

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

# start the service

# systemctl start mysqld.service

# View temporary password

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

# change password

# mysql_secure_installation security initialization.

The test library is linked.

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

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report