Script to compile and install nginx on CentOS 6.

Script to compile and install nginx on CentOS 6.

  1. Coyy compileInstallNginx.bash to target CentOS box, and then run it as 'root'
#!/bin/bash

#. Compile and make/make install nginx
#. run as 'root'

currDir=$(dirname $(readlink -f "$0"))
source ${currDir}/../utils/commonFuncs.bash
redAlert "PWD: $currDir"

nginxTarball=nginx-1.12.2.tar.gz
untareddir=$(echo ${nginxTarball} | cut -d't' -f1 | sed 'sA\.$AA')
greenAlert "Untarged Dir: $currDir}/${untareddir}"

tar xvf ${currDir}/${nginxTarball}

cd ${currDir}/${untareddir}
redAlert "Now dir: "`pwd`
echo
redAlert "Conigure, make, make installing..."
redAlert "./configure && make -j4 && make install"
./configure && make -j3 && make install
echo
greenAlert `which nginx`
greenAlert "Done!"
  1. Prepare
    1). Copy or download nginx-1.12.2.tar.gz to target box under some dir.
    2). Copy compileInstallNginx.bash also in this dir.
    3). Copy pwd/../utils/commonFuncs.bash together.
    4). Run compileInstallNginx.bash as 'root'

  2. Tips:
    greenAlert and redAlert is the color echo function in commonFuncs.bash.

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 12,178评论 0 10
  • 第一步:新建一个c_test.c文件; 在其中输入以下内容: :wq保存退出 第二步:编译c_test.c. 没有...
    阳明AI阅读 3,728评论 0 1
  • 今天孩子放学回到家里,发生了一些小插曲。 她带回来了一张数学期中试卷,另外还漏了一张。 当我仔细去看她的试卷时,9...
    君临成长日记阅读 1,567评论 0 0

友情链接更多精彩内容