Last active
September 11, 2021 22:12
-
-
Save MinCha/8296107 to your computer and use it in GitHub Desktop.
Nginx & Tomcat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sup