sh在ubuntu18.04上安装nginx(代码片段)

author author     2022-12-18     113

关键词:

#!/bin/bash
# THIS IS MEANT TO BUILD IT FROM SOURCE AND INSTALLING IT
# http://nginx.org/en/download.html
# UPDATE SYSTEM
apt-get update && apt-get upgrade -y
# GET NGINX MAINLINE FROM SOURCE
wget http://nginx.org/download/nginx-1.17.3.tar.gz
# EXTRACT NGINX
tar -zxvf https://nginx.org/download/nginx-1.17.3.tar.gz
cd nginx-1.17.3/
# INSTALL DEPENDENCIES
apt-get install build-essential
apt-get install libpcre3 libpcre3-dev libpcrecpp0v5 libssl-dev zlib1g-dev
#CONFIGURE NGINX
./configure --sbin-path=/usr/bin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --with-debug --with-pcre --with-http_ssl_module
#or
./configure \
  --sbin-path=/usr/bin/nginx \                  #location of the executable
  --conf-path=/etc/nginx/nginx.conf \           #path of the configuration file
  --error-log-path=/var/log/nginx/error.log \   #where to store the error logs
  --http-log-path=/var/log/nginx/access.log \   #where to store the access logs
  --with-debug \
  --with-pcre \                                 #use the pcre library for regex
  --pid-path=/var/run/nginx.pid                 #for referencing the process id
  --with-http_ssl_module
# BUILD BINARIES
make
# INSTALL NGINX
make install
# RUN NGINX
nginx
#!/bin/bash
# UPDATE SYSTEM
sudo apt-get update && apt-get upgrade -y
# GET NGINX MAINLINE FROM SOURCE
wget https://nginx.org/download/nginx-1.17.3.tar.gz
# EXTRACT NGINX
tar -zxvf https://nginx.org/download/nginx-1.17.3.tar.gz
cd nginx-1.17.3/
# INSTALL DEPENDENCIES
sudo apt-get install libpcre3 libpcre3-dev libpcrecpp0v5 libssl-dev zlib1g-dev
#CONFIGURE NGINX
./configure --sbin-path=/usr/bin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --with-debug --with-pcre --with-http_ssl_module
# BUILD BINARIES
make
# INSTALL NGINX
sudo make install
# RUN NGINX
sudo nginx
sudo apt-get install nginx
#THIS IS MEANT TO COPY KEEP THE CONFIG FILE ON THE HOST
docker run -p 80:80 --name nginx-container -v /host/path/nginx.conf:/etc/nginx/nginx.conf:ro -d nginx

#OTHER VERSIONS
docker run -p 80:80 --name nginx-container -v /host/path/nginx.conf:/etc/nginx/nginx.conf:ro -d nginx:alpine
docker run -p 80:80 --name nginx-container -v /host/path/nginx.conf:/etc/nginx/nginx.conf:ro -d nginx:stable
docker run -p 80:80 --name nginx-container -v /host/path/nginx.conf:/etc/nginx/nginx.conf:ro -d nginx:latest
docker run -p 80:80 --name nginx-container -v /host/path/nginx.conf:/etc/nginx/nginx.conf:ro -d nginx:mainline

#RUN ON DEBUG MODE
docker run -p 80:80 --name nginx-container -v /host/path/nginx.conf:/etc/nginx/nginx.conf:ro -d nginx nginx-debug -g 'daemon off;'

sh在ubuntu18.04上安装mongodb4.0(代码片段)

查看详情

sh在ubuntu18.04上安装i3-gap(代码片段)

查看详情

sh在ubuntu18.04上安装i3-gap(代码片段)

查看详情

sh如何在debian/ubuntu上安装nginx和googlepagespeed(代码片段)

查看详情

sh如何在debian/ubuntu上安装nginx和googlepagespeed(代码片段)

查看详情

sh邮差安装ubuntu18.04(代码片段)

查看详情

ubuntu18.04server安装nginx+git服务(代码片段)

安装需要安装的包有nginx,fcgiwrap,git.其中git在Ubuntu18.04Server安装时已经默认安装了.需要安装的是前两个而fcgiwrap是在universe区域里面(找一个包时如果不确定是在那个区域,可以在 https://packages.ubuntu.com/上面先查一下默认的Ubuntu18.0... 查看详情

sh安装ubuntu18.04后该怎么办(代码片段)

查看详情

shwkhtmltopdf安装在ubuntu18.04上(代码片段)

查看详情

ubuntu18.04系统安装nginx(代码片段)

 Nginx软件包在默认的Ubuntu存储库中可用。安装非常简单。首先更新包列表,然后安装Nginx。sudoaptupdatesudoaptinstallnginx或sudoaptinstall-ynginx #1、安装sudoaptupdatesudoaptinstallnginx#2、安装完,nginx就默认被启动,通过下面命令查看sudo... 查看详情

sh在ubuntu16.04上安装php7.2nginx和php7.2-fpm(代码片段)

查看详情

sh在ubuntu16.04上安装php7.2nginx和php7.2-fpm(代码片段)

查看详情

sh在ubuntu16.04上安装php7.2nginx和php7.2-fpm(代码片段)

查看详情

在ubuntu18.04上安装virtualbox5.2(代码片段)

InstalltheLatestVirtualBoxonUbuntu18.04LTS!robot|01/01/2018|Applications,Labs,LinuxUbuntu|6CommentsSinceUbuntu18.04LTSwasreleased,IhavebeentestingitinmylabenvironmentusingVMwareWorkstationPro…thisstep 查看详情

sh如何在ubuntu16.04/18.04上使用dante(不仅仅)设置socks5代理服务器(代码片段)

查看详情

在ubuntu18.04上使用静态可执行文件安装dockerce及后续设置(代码片段)

在Ubuntu18.04上使用静态可执行文件安装DockerCE及后续设置前几天安装了最新的Ubuntu18.04LTS,想在上面安装一个docker,结果发现docker官方的软件源里没有Ubuntu18.04的安装包版本,可能是系统太新了,官方还没来得及制... 查看详情

在ubuntu18.04上安装nvidia驱动(代码片段)

...悉配置啥的。所以首先是在裸机上安装Nvidia驱动。环境:Ubuntu18.04 刚安装完系统,当然是把软件更新器提出的下载更新给下载一下了。所以首先应该是1sudoapt-getupdate当然,上述是系统主动提出的更新,并没有输入指令啦~接下... 查看详情

Wordpress 网站在 Ubuntu 18.04 LTS 上全新安装 VirtualMin 后显示 php 代码

】Wordpress网站在Ubuntu18.04LTS上全新安装VirtualMin后显示php代码【英文标题】:WordpresssiteshowsphpcodeafterfreshinstallofVirtualMinonUbuntu18.04LTS【发布时间】:2020-02-0307:39:10【问题描述】:安装Virtualmin后,我的WordPress网站立即出现以下错误。... 查看详情