################ Docker 설치 ###############
1. Update your apt sources
$ sudo apt-get update
$ sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
2. Prerequisites by Ubuntu Version
$ sudo apt-get update
$ sudo apt-get install linux-image-extra-$(uname -r) linux-image-extra-virtual
3. Install
$ sudo apt-get update
$ sudo apt-get install docker-ce
$ sudo service docker start
$ sudo docker run hello-world
++++++ swap limit 해제 ++++++
$ sudo vim /etc/default/grub
===== grub =====
...
GRUB_CMDLINE_LINUX_DEFAULT="cgroup_enable=memory swapaccount=1"
...
=============================
$ sudo update-grub
$ sudo reboot now
++++++ ++++++++++++ ++++++
++++++ directory 위치 변경 ++++++
$ sudo vim /lib/systemd/system/docker.service
===== docker.service =====
...
ExecStart=/usr/bin/dockerd -H fd://
=> 아래와 같이 수정
ExecStart=/usr/bin/dockerd -H fd:// -g /home/docker/store
...
=============================
$ sudo systemctl daemon-reload
++++++ ++++++++++++ ++++++
++++++ 필요한 directory 생성 ++++++
$ sudo mkdir -p /home/docker/bin
$ sudo mkdir -p /home/docker/volumes
++++++ ++++++++++++ ++++++
++++++ docker-compose 설치 ++++++
$ sudo curl -L "https://github.com/docker/compose/releases/download/1.8.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/bin/docker-compose
$ sudo chmod +x /usr/bin/docker-compose
$ sudo docker-compose --version
++++++ ++++++++++++ ++++++
++++++ docker network 만들기 +++++
$ sudo docker network create \
--driver bridge \
--subnet 172.18.0.0/16 \
--gateway 172.18.0.1 \
--opt "com.docker.network.bridge.enable_icc"="true" \
--opt "com.docker.network.bridge.enable_ip_masquerade"="true" \
--opt "com.docker.network.bridge.host_binding_ipv4"="0.0.0.0" \
--opt "com.docker.network.bridge.name"="chakan-docker0" \
--opt "com.docker.network.driver.mtu"="1500" \
chakan-bridge
++++++ ++++++++++++ ++++++
################ Docker - MARIADB ###############
$ sudo docker pull mariadb
$ sudo mkdir -p /home/docker/volumes/mariadb
파일:
$ chakan-mariadb.sh run|start|stop|remove|status|bash
++++++ ++++++++++++ ++++++
################ Docker - PHPMYADMIN ###############
$ sudo docker pull phpmyadmin/phpmyadmin
$ sudo mkdir -p /home/docker/volumes/phpmyadmin
파일:
$ chakan-phpmyadmin.sh run|start|stop|remove|status|bash
++++++ ++++++++++++ ++++++
################ Docker - NGINX ###############
$ sudo docker pull nginx
++++++ nginx-reverse-proxy ++++++
$ sudo mkdir -p /home/docker/volumes/nginx/reverse-proxy
$ sudo mkdir -p /home/docker/volumes/nginx/reverse-proxy/conf.d
$ sudo mkdir -p /home/docker/volumes/nginx/reverse-proxy/logs
파일:
$ chakan-nginx-reverse-proxy.sh run|start|stop|remove|status|bash
++++++ ++++++++++++ ++++++
################ Docker - TOMCAT 8.5 ###############
$ sudo docker pull tomcat:8.5
++++++ tomcat-production ++++++
$ sudo mkdir -p /home/docker/volumes/tomcat/production
$ sudo mkdir -p /home/docker/volumes/tomcat/production/conf
$ sudo mkdir -p /home/docker/volumes/tomcat/production/logs
파일:
$ chakan-tomcat-production.sh run|start|stop|remove|status|bash
++++++ tomcat-demo ++++++
$ sudo mkdir -p /home/docker/volumes/tomcat/demo
$ sudo mkdir -p /home/docker/volumes/tomcat/demo/conf
$ sudo mkdir -p /home/docker/volumes/tomcat/demo/logs
파일:
$ chakan-tomcat-demo.sh run|start|stop|remove|status|bash
++++++ tomcat-staging ++++++
$ sudo mkdir -p /home/docker/volumes/tomcat/staging
$ sudo mkdir -p /home/docker/volumes/tomcat/staging/conf
$ sudo mkdir -p /home/docker/volumes/tomcat/staging/logs
파일:
$ chakan-tomcat-staging.sh run|start|stop|remove|status|bash
++++++ ++++++++++++ ++++++
..다시정리 ################ Docker - MYSQL설치 ###############
$ sudo docker pull mysql
$ sudo mkdir -p /home/docker/volumes/database/mysql/data
++++++ mysql run|start|stop|remove|re-run|status ++++++
파일 다운로드: chakan-mysql
"/home/docker/bin" 위치에 복사
$ sudo chown root:root chakan-mysql
$ sudo chmod a+x chakan-mysql
++++++ ++++++++++++ ++++++
################ Docker - MARIADB설치 ###############
$ sudo docker pull mariadb
$ sudo mkdir -p /home/docker/volumes/database/mariadb/data
++++++ mariadb run|start|stop|remove|re-run|status ++++++
파일 다운로드: chakan-mariadb
"/home/docker/bin" 위치에 복사
$ sudo chown root:root chakan-mariadb
$ sudo chmod a+x chakan-mariadb
++++++ ++++++++++++ ++++++
################ Docker - PHPMYADMIN설치 ###############
$ sudo docker pull phpmyadmin/phpmyadmin
$ sudo mkdir -p /home/docker/volumes/webapp/phpmyadmin
++++++ phpmyadmin run|start|stop|remove|re-run|status ++++++
파일 다운로드: chakan-phpmyadmin
"/home/docker/bin" 위치에 복사
$ sudo chown root:root chakan-phpmyadmin
$ sudo chmod a+x chakan-phpmyadmin
****** mariadb와 연결하도록 되어 있음
****** mysql과 연결하려면 수정 필요
++++++ ++++++++++++ ++++++
################ Docker - NGINX설치 ###############
$ sudo docker pull nginx
$ sudo mkdir -p /home/docker/volumes/was/nginx
...
P
# sudo npm install -g bower
# sudo update-alternatives --install "/usr/bin/bower" "bower"
"/home/development/environment/lib/node/nodejs/bin/bower" 1
++++++ Install Gulp ++++++
# sudo npm install -g gulp-cli
# sudo update-alternatives --install "/usr/bin/gulp" "gulp"
"/home/development/environment/lib/node/nodejs/bin/gulp" 1
++++++ Install JHipster ++++++
# sudo npm install -g generator-jhipster
++++++ ++++++++++++ ++++++
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
W
# sudo /usr/lib/tomcat/tomcat/webapps/manager/WEB-INF/web.xml
======================================
<multipart-config>
<!-- 100MB max -->
<max-file-size>104857600</max-file-size>
<max-request-size>104857800</max-request-size>
<file-size-threshold>0</file-size-threshold>
</multipart-config>
======================================
+++++ ++++++++++++++++++ +++++
1. Update your apt sources
$ sudo apt-get update
$ sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
2. Prerequisites by Ubuntu Version
$ sudo apt-get update
$ sudo apt-get install linux-image-extra-$(uname -r) linux-image-extra-virtual
3. Install
$ sudo apt-get update
$ sudo apt-get install docker-ce
$ sudo service docker start
$ sudo docker run hello-world
++++++ swap limit 해제 ++++++
$ sudo vim /etc/default/grub
===== grub =====
...
GRUB_CMDLINE_LINUX_DEFAULT="cgroup_enable=memory swapaccount=1"
...
=============================
$ sudo update-grub
$ sudo reboot now
++++++ ++++++++++++ ++++++
++++++ directory 위치 변경 ++++++
$ sudo vim /lib/systemd/system/docker.service
===== docker.service =====
...
ExecStart=/usr/bin/dockerd -H fd://
=> 아래와 같이 수정
ExecStart=/usr/bin/dockerd -H fd:// -g /home/docker/store
...
=============================
$ sudo systemctl daemon-reload
++++++ ++++++++++++ ++++++
++++++ 필요한 directory 생성 ++++++
$ sudo mkdir -p /home/docker/bin
$ sudo mkdir -p /home/docker/volumes
++++++ ++++++++++++ ++++++
++++++ docker-compose 설치 ++++++
$ sudo curl -L "https://github.com/docker/compose/releases/download/1.8.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/bin/docker-compose
$ sudo chmod +x /usr/bin/docker-compose
$ sudo docker-compose --version
++++++ ++++++++++++ ++++++
++++++ docker network 만들기 +++++
$ sudo docker network create \
--driver bridge \
--subnet 172.18.0.0/16 \
--gateway 172.18.0.1 \
--opt "com.docker.network.bridge.enable_icc"="true" \
--opt "com.docker.network.bridge.enable_ip_masquerade"="true" \
--opt "com.docker.network.bridge.host_binding_ipv4"="0.0.0.0" \
--opt "com.docker.network.bridge.name"="chakan-docker0" \
--opt "com.docker.network.driver.mtu"="1500" \
chakan-bridge
++++++ ++++++++++++ ++++++
################ Docker - MARIADB ###############
$ sudo docker pull mariadb
$ sudo mkdir -p /home/docker/volumes/mariadb
파일:
$ chakan-mariadb.sh run|start|stop|remove|status|bash
++++++ ++++++++++++ ++++++
################ Docker - PHPMYADMIN ###############
$ sudo docker pull phpmyadmin/phpmyadmin
$ sudo mkdir -p /home/docker/volumes/phpmyadmin
파일:
$ chakan-phpmyadmin.sh run|start|stop|remove|status|bash
++++++ ++++++++++++ ++++++
################ Docker - NGINX ###############
$ sudo docker pull nginx
++++++ nginx-reverse-proxy ++++++
$ sudo mkdir -p /home/docker/volumes/nginx/reverse-proxy
$ sudo mkdir -p /home/docker/volumes/nginx/reverse-proxy/conf.d
$ sudo mkdir -p /home/docker/volumes/nginx/reverse-proxy/logs
파일:
$ chakan-nginx-reverse-proxy.sh run|start|stop|remove|status|bash
++++++ ++++++++++++ ++++++
################ Docker - TOMCAT 8.5 ###############
$ sudo docker pull tomcat:8.5
++++++ tomcat-production ++++++
$ sudo mkdir -p /home/docker/volumes/tomcat/production
$ sudo mkdir -p /home/docker/volumes/tomcat/production/conf
$ sudo mkdir -p /home/docker/volumes/tomcat/production/logs
파일:
$ chakan-tomcat-production.sh run|start|stop|remove|status|bash
++++++ tomcat-demo ++++++
$ sudo mkdir -p /home/docker/volumes/tomcat/demo
$ sudo mkdir -p /home/docker/volumes/tomcat/demo/conf
$ sudo mkdir -p /home/docker/volumes/tomcat/demo/logs
파일:
$ chakan-tomcat-demo.sh run|start|stop|remove|status|bash
++++++ tomcat-staging ++++++
$ sudo mkdir -p /home/docker/volumes/tomcat/staging
$ sudo mkdir -p /home/docker/volumes/tomcat/staging/conf
$ sudo mkdir -p /home/docker/volumes/tomcat/staging/logs
파일:
$ chakan-tomcat-staging.sh run|start|stop|remove|status|bash
++++++ ++++++++++++ ++++++
..다시정리 ################ Docker - MYSQL설치 ###############
$ sudo docker pull mysql
$ sudo mkdir -p /home/docker/volumes/database/mysql/data
++++++ mysql run|start|stop|remove|re-run|status ++++++
파일 다운로드: chakan-mysql
"/home/docker/bin" 위치에 복사
$ sudo chown root:root chakan-mysql
$ sudo chmod a+x chakan-mysql
++++++ ++++++++++++ ++++++
################ Docker - MARIADB설치 ###############
$ sudo docker pull mariadb
$ sudo mkdir -p /home/docker/volumes/database/mariadb/data
++++++ mariadb run|start|stop|remove|re-run|status ++++++
파일 다운로드: chakan-mariadb
"/home/docker/bin" 위치에 복사
$ sudo chown root:root chakan-mariadb
$ sudo chmod a+x chakan-mariadb
++++++ ++++++++++++ ++++++
################ Docker - PHPMYADMIN설치 ###############
$ sudo docker pull phpmyadmin/phpmyadmin
$ sudo mkdir -p /home/docker/volumes/webapp/phpmyadmin
++++++ phpmyadmin run|start|stop|remove|re-run|status ++++++
파일 다운로드: chakan-phpmyadmin
"/home/docker/bin" 위치에 복사
$ sudo chown root:root chakan-phpmyadmin
$ sudo chmod a+x chakan-phpmyadmin
****** mariadb와 연결하도록 되어 있음
****** mysql과 연결하려면 수정 필요
++++++ ++++++++++++ ++++++
################ Docker - NGINX설치 ###############
$ sudo docker pull nginx
$ sudo mkdir -p /home/docker/volumes/was/nginx
++++++ nginx-hosts run|start|stop|remove|re-run|status ++++++
파일 다운로드: chakan-nginx-hosts
"/home/docker/bin" 위치에 복사
$ sudo chown root:root chakan-nginx-hosts
$ sudo chmod a+x chakan-nginx-hosts
****** hostname 추가할 경우 수정 필요
$ sudo mkdir -p /home/docker/volumes/was/nginx/hosts/conf.d
$ sudo mkdir -p /home/docker/volumes/was/nginx/hosts/logs
****** auth 연결 (auth.conf) ******
파일 다운로드: auth.conf
"/home/docker/volumes/was/nginx/hosts/conf.d" 위치에 복사
****** dev 연결 (dev.conf) ******
파일 다운로드: dev.conf
"/home/docker/volumes/was/nginx/hosts/conf.d" 위치에 복사
****** *************** ******
++++++ ++++++++++++ ++++++
################ Docker - TOMCAT 8.5설치 ###############
$ sudo docker pull tomcat:8.5
$ sudo mkdir -p /home/docker/volumes/was/tomcat
++++++ tomcat-auth run|start|stop|remove|re-run|status ++++++
파일 다운로드:
"/home/docker/bin" 위치에 복사
$ sudo chown root:root chakan-tomcat-auth
$ sudo chmod a+x chakan-tomcat-auth
++++++ ++++++++++++ ++++++
################ Docker - JENKINS설치 ###############
$ sudo docker pull jenkins
$ sudo mkdir -p /home/docker/volumes/webapp/jenkins
++++++ jenkins run|start|stop|remove|re-run|status ++++++
파일 다운로드: chakan-jenkins
"/home/docker/bin" 위치에 복사
$ sudo chown root:root chakan-jenkins
$ sudo chmod a+x chakan-jenkins
****** jenkins_home 생성
$ sudo mkdir -p /home/docker/volumes/webapp/jenkins/home
++++++ ++++++++++++ ++++++
???파일 다운로드: chakan-nginx-hosts
"/home/docker/bin" 위치에 복사
$ sudo chown root:root chakan-nginx-hosts
$ sudo chmod a+x chakan-nginx-hosts
****** hostname 추가할 경우 수정 필요
$ sudo mkdir -p /home/docker/volumes/was/nginx/hosts/conf.d
$ sudo mkdir -p /home/docker/volumes/was/nginx/hosts/logs
****** auth 연결 (auth.conf) ******
파일 다운로드: auth.conf
"/home/docker/volumes/was/nginx/hosts/conf.d" 위치에 복사
****** dev 연결 (dev.conf) ******
파일 다운로드: dev.conf
"/home/docker/volumes/was/nginx/hosts/conf.d" 위치에 복사
****** *************** ******
++++++ ++++++++++++ ++++++
################ Docker - TOMCAT 8.5설치 ###############
$ sudo docker pull tomcat:8.5
$ sudo mkdir -p /home/docker/volumes/was/tomcat
++++++ tomcat-auth run|start|stop|remove|re-run|status ++++++
파일 다운로드:
"/home/docker/bin" 위치에 복사
$ sudo chown root:root chakan-tomcat-auth
$ sudo chmod a+x chakan-tomcat-auth
++++++ ++++++++++++ ++++++
################ Docker - JENKINS설치 ###############
$ sudo docker pull jenkins
$ sudo mkdir -p /home/docker/volumes/webapp/jenkins
++++++ jenkins run|start|stop|remove|re-run|status ++++++
파일 다운로드: chakan-jenkins
"/home/docker/bin" 위치에 복사
$ sudo chown root:root chakan-jenkins
$ sudo chmod a+x chakan-jenkins
****** jenkins_home 생성
$ sudo mkdir -p /home/docker/volumes/webapp/jenkins/home
++++++ ++++++++++++ ++++++
...
P
################ JDK 설치 ###############
(오라클 자바 리눅스용 다운로드 함)
# sudo mkdir -p /home/development/environment/lib/jvm
# sudo mv jdk*.*.*_*/ /home/development/environment/lib/jvm
# sudo ln -s /home/development/environment/lib/jvm/jdk*.*.*_*
/home/development/environment/lib/jvm/jdk
/home/development/environment/lib/jvm/jdk
# sudo update-alternatives --install "/usr/bin/java" "java"
"/home/development/environment/lib/jvm/jdk/bin/java" 1
"/home/development/environment/lib/jvm/jdk/bin/java" 1
# sudo update-alternatives --install "/usr/bin/javac" "javac"
"/home/development/environment/lib/jvm/jdk/bin/javac" 1
"/home/development/environment/lib/jvm/jdk/bin/javac" 1
# sudo update-alternatives --install "/usr/bin/javaws" "javaws"
"/home/development/environment/lib/jvm/jdk/bin/javaws" 1
"/home/development/environment/lib/jvm/jdk/bin/javaws" 1
# sudo chmod a+x /usr/bin/java
# sudo chmod a+x /usr/bin/javac
# sudo chmod a+x /usr/bin/javaws
# sudo update-alternatives --config java
# sudo update-alternatives --config javac
# sudo update-alternatives --config javaws
++++++ ++++++++++++ ++++++
################ NODE 설치 ###############
(Nodejs 다운로드 함)
# sudo mkdir -p /home/development/environment/lib/node
# sudo mv node-v*.*.*-*.tar.xz /home/development/environment/lib/node
# sudo cd /home/development/environment/lib/node
# sudo unxz node-v*.*.*-*.tar.xz
# sudo tar xvf node-v*.*.*-*.tar
# sudo ln -s node-v*.*.*-* nodejs
# sudo update-alternatives --install "/usr/bin/node" "node"
"/home/development/environment/lib/node/nodejs/bin/node" 1
# sudo update-alternatives --install "/usr/bin/npm" "npm"
"/home/development/environment/lib/node/nodejs/bin/npm" 1
++++++ Install Bower ++++++++++++ ++++++++++++ ++++++
################ NODE 설치 ###############
(Nodejs 다운로드 함)
# sudo mkdir -p /home/development/environment/lib/node
# sudo mv node-v*.*.*-*.tar.xz /home/development/environment/lib/node
# sudo cd /home/development/environment/lib/node
# sudo unxz node-v*.*.*-*.tar.xz
# sudo tar xvf node-v*.*.*-*.tar
# sudo ln -s node-v*.*.*-* nodejs
# sudo update-alternatives --install "/usr/bin/node" "node"
"/home/development/environment/lib/node/nodejs/bin/node" 1
# sudo update-alternatives --install "/usr/bin/npm" "npm"
"/home/development/environment/lib/node/nodejs/bin/npm" 1
# sudo chmod a+x /usr/bin/node
# sudo chmod a+x /usr/bin/npm
++++++ ++++++++++++ ++++++
# sudo update-alternatives --config node
# sudo update-alternatives --config npm
++++++ Install Yeoman ++++++
# sudo npm install -g yo
# sudo update-alternatives --install "/usr/bin/yo" "yo"
"/home/development/environment/lib/node/nodejs/bin/yo" 1
# sudo update-alternatives --install "/usr/bin/yo-complete" "yo-complete"
"/home/development/environment/lib/node/nodejs/bin/yo-complete" 1
++++++ Install Yeoman ++++++
# sudo npm install -g yo
# sudo update-alternatives --install "/usr/bin/yo" "yo"
"/home/development/environment/lib/node/nodejs/bin/yo" 1
# sudo update-alternatives --install "/usr/bin/yo-complete" "yo-complete"
"/home/development/environment/lib/node/nodejs/bin/yo-complete" 1
# sudo chmod a+x /usr/bin/yo
# sudo chmod a+x /usr/bin/yo-complete
# sudo update-alternatives --config yo
# sudo update-alternatives --config yo-complete
# sudo chmod a+x /usr/bin/yo-complete
# sudo update-alternatives --config yo
# sudo update-alternatives --config yo-complete
# sudo npm install -g bower
# sudo update-alternatives --install "/usr/bin/bower" "bower"
"/home/development/environment/lib/node/nodejs/bin/bower" 1
# sudo chmod a+x /usr/bin/bower
# sudo update-alternatives --config bower
++++++ ++++++++++++ ++++++# sudo update-alternatives --config bower
++++++ Install Gulp ++++++
# sudo npm install -g gulp-cli
# sudo update-alternatives --install "/usr/bin/gulp" "gulp"
"/home/development/environment/lib/node/nodejs/bin/gulp" 1
# sudo chmod a+x /usr/bin/gulp
# sudo update-alternatives --config gulp
++++++ ++++++++++++ ++++++# sudo update-alternatives --config gulp
++++++ Install JHipster ++++++
# sudo npm install -g generator-jhipster
++++++ ++++++++++++ ++++++
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
W
################ SSH 설치 ###############
# sudo apt-get install ssh
# sudo apt-get install ssh
################ JDK 설치 ###############
(오라클 자바 리눅스용 다운로드 함)
# sudo mkdir -p /usr/lib/jvm
# sudo mv jdk*1.7.0_*/ /usr/lib/jvm/
# sudo ln -s /usr/lib/jvm/jdk1.7.0_* /usr/lib/jvm/jdk
# sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk/bin/java" 1
# sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk/bin/javac" 1
# sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk/bin/javaws" 1
# sudo chmod a+x /usr/bin/java
# sudo chmod a+x /usr/bin/javac
# sudo chmod a+x /usr/bin/javaws
# sudo update-alternatives --config java
# sudo update-alternatives --config javac
# sudo update-alternatives --config javaws
############## TOMCAT 설치 #############
(아파치 톰켓 다운로드함)
# sudo mkdir /usr/lib/tomcat
# sudo mv apache-tomcat-x/ /usr/lib/tomcat/apache-tomcat-x/
# sudo ln -s /usr/lib/local/apache-tomcat-x tomcat
+++++ init.d에 톰켓 스크립트 등록 +++++
# vim /etc/init.d/tomcat
======================================
#!/bin/sh
#
# tomcat Startup script for the Apache-Tomcat WAS (version x)
#
# location /usr/lib/tomcat/tomcat
# config: /usr/lib/tomcat/tomcat/conf/server.xml
# Source function library
# chkconfig: 2345 95 20
# description: start/stop script for tomcat server
export JAVA_HOME="/usr/lib/jvm/jdk"
export PATH="$PATH:$JAVA_HOME/bin"
export TOMCAT_HOME="/usr/lib/tomcat/tomcat/bin"
case $1 in
start)
echo -n "Starting Tomcat...\n"
$TOMCAT_HOME/startup.sh
;;
stop)
echo -n "Stopping Tomcat...\n"
$TOMCAT_HOME/shutdown.sh
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage : $0 {start|stop|restart}"
exit 1
;;
esac
exit 0
############## TOMCAT 설치 #############
(아파치 톰켓 다운로드함)
# sudo mkdir /usr/lib/tomcat
# sudo mv apache-tomcat-x/ /usr/lib/tomcat/apache-tomcat-x/
# sudo ln -s /usr/lib/local/apache-tomcat-x tomcat
+++++ init.d에 톰켓 스크립트 등록 +++++
# vim /etc/init.d/tomcat
======================================
#!/bin/sh
#
# tomcat Startup script for the Apache-Tomcat WAS (version x)
#
# location /usr/lib/tomcat/tomcat
# config: /usr/lib/tomcat/tomcat/conf/server.xml
# Source function library
# chkconfig: 2345 95 20
# description: start/stop script for tomcat server
export JAVA_HOME="/usr/lib/jvm/jdk"
export PATH="$PATH:$JAVA_HOME/bin"
export TOMCAT_HOME="/usr/lib/tomcat/tomcat/bin"
case $1 in
start)
echo -n "Starting Tomcat...\n"
$TOMCAT_HOME/startup.sh
;;
stop)
echo -n "Stopping Tomcat...\n"
$TOMCAT_HOME/shutdown.sh
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage : $0 {start|stop|restart}"
exit 1
;;
esac
exit 0
======================================
# sudo chmod 744 /etc/init.d/tomcat
+++++ +++++++++++++++++ +++++
+++++ 부팅시 자동시작 등록 +++++
#sudo update-rc.d tomcat defaults
+++++ +++++++++++++ +++++
+++++ 부팅시 자동시작 해제 +++++
# sudo update-rc.d -f tomcat remove
+++++ +++++++++++++ +++++
+++++ tomcat-users 설정 +++++
# sudo vim /usr/lib/tomcat/tomcat/conf/tomcat-users.xml
======================================
<tomcat-users ...>
...
<role rolename="manager-gui"/>
<user username="tomcat" password="tomcat" roles="manager-gui"/>
...
</tomcat-users>
======================================
+++++ ++++++++++++ +++++
+++++ webapps 위치 변경 +++++
# sudo vim /usr/lib/tomcat/tomcat/conf/server.xml
(기존에 있는 <Host>는 주석처리함)
======================================
<Host name="localhost" appBase="/home/tomcat/webapps" unpackWARs="true" autoDeplay="true">
======================================
+++++ ++++++++++++ +++++
+++++ Domain Name별 webapps 위치 변경 +++++
# sudo vim /usr/lib/tomcat/tomcat/conf/server.xml
"<Host>"를 새로 추가함
======================================
<Host name="Domain Name" appBase="webapps위치" unpackWARs="true" autoDeplay="true">
</Host>
======================================
+++++ ++++++++++++ +++++
+++++ manager 업로드 용량 늘리기 +++++# sudo chmod 744 /etc/init.d/tomcat
+++++ +++++++++++++++++ +++++
+++++ 부팅시 자동시작 등록 +++++
#sudo update-rc.d tomcat defaults
+++++ +++++++++++++ +++++
+++++ 부팅시 자동시작 해제 +++++
# sudo update-rc.d -f tomcat remove
+++++ +++++++++++++ +++++
+++++ tomcat-users 설정 +++++
# sudo vim /usr/lib/tomcat/tomcat/conf/tomcat-users.xml
======================================
<tomcat-users ...>
...
<role rolename="manager-gui"/>
<user username="tomcat" password="tomcat" roles="manager-gui"/>
...
</tomcat-users>
======================================
+++++ ++++++++++++ +++++
+++++ webapps 위치 변경 +++++
# sudo vim /usr/lib/tomcat/tomcat/conf/server.xml
(기존에 있는 <Host>는 주석처리함)
======================================
<Host name="localhost" appBase="/home/tomcat/webapps" unpackWARs="true" autoDeplay="true">
======================================
+++++ ++++++++++++ +++++
+++++ Domain Name별 webapps 위치 변경 +++++
# sudo vim /usr/lib/tomcat/tomcat/conf/server.xml
"<Host>"를 새로 추가함
======================================
<Host name="Domain Name" appBase="webapps위치" unpackWARs="true" autoDeplay="true">
</Host>
======================================
+++++ ++++++++++++ +++++
# sudo /usr/lib/tomcat/tomcat/webapps/manager/WEB-INF/web.xml
======================================
<multipart-config>
<!-- 100MB max -->
<max-file-size>104857600</max-file-size>
<max-request-size>104857800</max-request-size>
<file-size-threshold>0</file-size-threshold>
</multipart-config>
======================================
+++++ ++++++++++++++++++ +++++
D
############## MYSQL 설치 ##############
# sudo apt-get install mysql-server mysql-client
# sudo apt-get install mysql-server mysql-client
+++++ mysql db파일 위치 변경 +++++
# sudo /etc/init.d/mysql stop
# sudo mv /var/lib/mysql /home/database/mysql
# sudo /etc/mysql/my.cnf
======================================
datadir = /var/lib/mysql
=> 한줄 수정
datadir = /home/database/mysql
======================================
# sudo vim /etc/apparmor.d/usr.sbin.mysqld
======================================
/var/lib/mysql/ r,
/var/lib/mysql/** rwk,
=> 위의 두줄을 아래와 같이 수정
/home/database/mysql/ r,
/home/database/mysql/** rwk,
======================================
# sudo /etc/init.d/apparmor restart
# sudo /etc/init.d/mysql start
+++++ +++++++++++++++ +++++
# sudo /etc/init.d/mysql stop
# sudo mv /var/lib/mysql /home/database/mysql
# sudo /etc/mysql/my.cnf
======================================
datadir = /var/lib/mysql
=> 한줄 수정
datadir = /home/database/mysql
======================================
# sudo vim /etc/apparmor.d/usr.sbin.mysqld
======================================
/var/lib/mysql/ r,
/var/lib/mysql/** rwk,
=> 위의 두줄을 아래와 같이 수정
/home/database/mysql/ r,
/home/database/mysql/** rwk,
======================================
# sudo /etc/init.d/apparmor restart
# sudo /etc/init.d/mysql start
+++++ +++++++++++++++ +++++
R
############## REDIS 설치 ##############
# sudo apt-get install redis-server redis-tools
+++++ password 설정 +++++
# sudo /etc/redis/redis.conf
======================================
requirepass password
======================================
# sudo service redis-server restart
+++++ +++++++++++++++ +++++
+++++ bind 설정 +++++
# sudo /etc/redis/redis.conf
======================================
bind 127.0.0.1 => 0.0.0.0 # for multiple ip address
======================================
# sudo service redis-server restart
+++++ +++++++++++++++ +++
+++++ +++++++++++++++ +++++
# sudo apt-get install redis-server redis-tools
+++++ password 설정 +++++
# sudo /etc/redis/redis.conf
======================================
requirepass password
======================================
# sudo service redis-server restart
+++++ +++++++++++++++ +++++
+++++ bind 설정 +++++
# sudo /etc/redis/redis.conf
======================================
bind 127.0.0.1 => 0.0.0.0 # for multiple ip address
======================================
# sudo service redis-server restart
+++++ +++++++++++++++ +++
+++++ +++++++++++++++ +++++
댓글 없음:
댓글 쓰기
참고: 블로그의 회원만 댓글을 작성할 수 있습니다.