centos lnmp yum install script nginx with purge and replacement function

install php 7.2 mariadb nginx + purge + sub_filter

yum -y update
yum -y install wget zip unzip gzip
cd /usr/local/src
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
yum -y install php72w-common php72w-fpm php72w-opcache php72w-gd php72w-mysqlnd php72w-mbstring php72w-pecl-redis php72w-pecl-memcached php72w-devel
systemctl enable php-fpm
systemctl start php-fpm

wget http://labs.frickle.com/files/ngx_cache_purge-2.3.tar.gz
tar zxvf ngx_cache_purge-2.3.tar.gz

# nginx install
# https://docs.nginx.com/nginx/admin-guide/installing-nginx/installing-nginx-open-source/
# vi /etc/yum.repos.d/nginx.repo
# 	[nginx]
#	name=nginx repo
#	baseurl=https://nginx.org/packages/mainline/centos/7/$basearch/
#	gpgcheck=0
#	enabled=1


yum -y install gcc gcc-c++ autoconf automake zlib zlib-devel pcre-devel openssl openssl-devel
yum -y install nginx

#wget -O ngx_http_substitutions_filter_module-master.zip https://github.com/yaoweibin/ngx_http_substitutions_filter_module/archive/master.zip
#unzip ngx_http_substitutions_filter_module-master.zip


wget http://nginx.org/download/nginx-1.17.10.tar.gz
tar zxvf nginx-1.17.10.tar.gz
cd nginx-1.17.10
./configure --with-poll_module --with-http_stub_status_module --with-http_ssl_module --prefix=/usr/local/nginx  --with-file-aio --with-http_realip_module --with-http_addition_module  --add-module=../ngx_cache_purge-2.3  --with-http_sub_module 

make
make install

cp objs/nginx  /usr/local/nginx/sbin/nginx
# use nginx -V  显示 sbin 路径

systemctl enable nginx
systemctl start nginx
cd /etc/nginx/conf.d/
echo "[mariadb]"  >>  /etc/yum.repos.d/MariaDB.repo
echo "name = MariaDB"  >>  /etc/yum.repos.d/MariaDB.repo
echo "baseurl = http://yum.mariadb.org/10.3/centos7-amd64"  >>  /etc/yum.repos.d/MariaDB.repo
echo "gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB"  >>  /etc/yum.repos.d/MariaDB.repo
echo "gpgcheck=1"  >>  /etc/yum.repos.d/MariaDB.repo
yum -y update 
yum -y install mariadb mariadb-server
systemctl enable mariadb
systemctl start mariadb
mysql_secure_installation
### php-fpm session ###
mkdir /var/lib/php/session
mkdir /var/lib/php/wsdlcache
chmod -R 777 /var/lib/php
chown -R apache:apache /var/lib/php


相关推荐

暂无评论

微信扫一扫,分享到朋友圈

centos lnmp yum install script nginx with purge and replacement function