Git Product home page Git Product logo

Comments (2)

2Dou avatar 2Dou commented on September 2, 2024

这是我centos7上的安装脚本,不过nginx的配置文件仍然要自己写

#!/usr/bin/sh

# push pwd
pushd

cd /tmp

yum -y install wget build-essential git gcc g++ gcc-c++ make autoconf

# nginx
wget http://nginx.org/download/nginx-1.9.3.tar.gz \
    && tar xzvf nginx-1.9.3.tar.gz

# pcre1
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.36.tar.gz \
    && tar xzvf pcre-8.36.tar.gz

# opnssl
wget https://www.openssl.org/source/openssl-1.0.2d.tar.gz \
    && tar xzvf openssl-1.0.2d.tar.gz

# zlib
wget http://zlib.net/zlib-1.2.8.tar.gz \
    && tar xzvf zlib-1.2.8.tar.gz

# extention
git clone https://github.com/cuber/ngx_http_google_filter_module
git clone https://github.com/yaoweibin/ngx_http_substitutions_filter_module

cd nginx-1.9.3

./configure \
    --prefix=/usr/share/nginx \
    --sbin-path=/usr/sbin/nginx \
    --conf-path=/etc/nginx/nginx.conf \
    --user=nginx \
    --group=nginx \
    --with-ipv6 \
    --with-http_ssl_module \
    --with-http_spdy_module \
    --with-http_secure_link_module \
    --with-http_sub_module \
    --with-pcre=../pcre-8.36 \
    --with-zlib=../zlib-1.2.8 \
    --with-openssl=../openssl-1.0.2d \
    --add-module=../ngx_http_google_filter_module \
    --add-module=../ngx_http_substitutions_filter_module \

# build && install
make && make install

popd

# --------------------------------------------
#追加一个nginx组
groupadd -f nginx
#追加一个nginx用户
useradd -s /sbin/nologin -g nginx nginx

#建立nginx日志目录
mkdir /var/log/nginx
#赋予访问权限
chown nginx:nginx /var/log/nginx

echo "
[Unit]
Description=nginx
After=network.target syslog.target

[Service]
Type=forking
ExecStart=/usr/sbin/nginx
ExecStop=/usr/sbin/nginx -s quit
ExecReload=/usr/sbin/nginx -s reload

[Install]
WantedBy=multi-user.target
" > /lib/systemd/system/nginx.service

systemctl enable nginx.service

systemctl start nginx.service

systemctl status nginx.service

from ngx_http_google_filter_module.

nanzhushan avatar nanzhushan commented on September 2, 2024

这个脚本我收藏了

from ngx_http_google_filter_module.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.