Skip to content

Instantly share code, notes, and snippets.

@MinCha
Last active September 11, 2021 22:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MinCha/8296107 to your computer and use it in GitHub Desktop.
Save MinCha/8296107 to your computer and use it in GitHub Desktop.
Nginx & Tomcat
#!/bin/bash
#######################################
# Init
#######################################
temp=~/temp
yum_repo=/etc/yum.repos.d/nginx.repo
tomcat_bin=http://mirror.apache-kr.org/tomcat/tomcat-7/v7.0.47/bin/apache-tomcat-7.0.47.tar.gz
tomcat_pathname=apache-tomcat-7.0.47
irteam_home=/home1/irteam
tomcat=/apps/tomcat
#######################################
# Install Nginx
#######################################
echo "[nginx]" | sudo tee $yum_repo
echo "name=nginx repo" | sudo tee -a $yum_repo
echo "baseurl=http://nginx.org/packages/centos/6/x86_64/" | sudo tee -a $yum_repo
echo "gpgcheck=0" | sudo tee -a $yum_repo
echo "enabled=1" | sudo tee -a $yum_repo
sudo -E yum install nginx
sudo chmod 4755 /usr/sbin/nginx
mkdir -p /home1/irteam/logs/nginx
mkdir -p /home1/irteam/logs/tomcat
#######################################
# Install Tomcat
#######################################
rm -rf $temp
mkdir -p $temp
cd $temp
wget $tomcat_bin
gzip -d *.gz && tar -xvf *.tar
rm -rf ./$tomcat_pathname/webapps/*
sudo chmod 777 $irteam_home
mkdir -p $irteam_home/apps && cp -r ./$tomat_pathname $irteam_home/apps
ln -s $irteam_home/apps/$tomcat_pathname $irteam_home/apps/tomcat
sudo chown -R irteam $irteam_home/apps
sudo chgrp -R irteam $irteam_home/apps
sudo chmod 700 $irteam_home
#######################################
# Clear
#######################################
rm -rf $temp
@ii64
Copy link

ii64 commented Sep 11, 2021

Sup

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment