Ubuntu 16.04 using Docker to build Java+tomcat+nginx reverse proxy/static and dynamic separation

Source: Internet
Author: User
Tags nginx reverse proxy

ubuntu 16.04 new two Docker containers using Docker to build a Java+tomcat+nginx reverse proxy docker run -it --name  tomcat-mysql -v /mnt:/mnt -p 8866:80 -p 33006:3306 ubuntu /bin/ bashdocker run -itd --name webserver -p 8888:80 -v /mnt/:/mnt/  ubuntu /bin/bash[email protected]:~# docker ps -acontainer id         IMAGE                command             created              STATUS               PORTS                                             names82756bbf1a00         ubuntu                "/bin/bash"          53 minutes ago       Up 53 minutes       0.0.0.0:80-> 80/tcp                               webserver38530da66ec0         ubuntu                "/bin/bash"          23 hours  ago        up 23 hours          0.0.0.0:8866-&gT;80/tcp, 0.0.0.0:33006->3306/tcp   tomcat-mysqljava+tomcat+mysql ip : 172.17.0.2 enters first container to start configuration java+tomcat+mysql ip:172.17.0.2 :docker attach  Tomcat-mysqljava build Installation: Download javawget http://download.oracle.com/otn-pub/java/jdk/7u79-b15/ JDK-7U79-LINUX-X64.TAR.GZ Create the Java directory and unzip the mkdir -p /usr/jdktar -xzvf jdk-7u79-linux-x64.tar.gz &NBSP;-C&NBSP;/USR/JDK Configure environment variables, add the following configuration at the end of the/etc/profile file Vim /etc/profileexport java_home=/usr/jdk/export  classpath=${java_home}/libexport path=${java_home}/bin: $PATH make configuration file effective Source /etc/profile test JAVA  -versionjava version  "1.7.0_79" Java (TM)  SE Runtime Environment  (build &NBSP;1.7.0_79-B15) Java hotspot (TM)  64-Bit Server VM  (build 24.79-b02,  Mixed mode) proof that the installation is complete tomcat installation: Download: wget http://apache.fayea.com/tomcat/tomcat-7/v7.0.70/bin/ APACHE-TOMCAT-7.0.70.TAR.GZ Create the installation directory and unzip the Mkdir -p /usr/tomcattar -xzvf apaChe-tomcat-7.0.70.tar.gz -c /usr/tomcat Configure the Tomcat startup script to add two lines to the catalina.sh vim /usr/tomcat/ Catalina.shcatalina_home=/usr/tomcatjava_home=/usr/jdk turn off cp /usr/tomcat/bin/through service management Tomcat service Catalina.sh /etc/init.d/tomcatchkconfig --add tomcatchkconfig tomcat on new Web site Program directory mkdir  -p /usr/www/www.abc.comtar -xzvf /mnt/soft/abc.tar.gz -c /usr/www/ www.abc.com Configuring tomcatvim /usr/tomcat/conf/server.xml  Configuration Tomcat Host support utf-8<connector port= "8080"  protocol= "http/1.1"                 connectiontimeout= "20000"                 redirectport= "8443"  uriencoding= "UTF-8"  /> Configuration program path  


This article is from the "Technology House private Space" blog, please be sure to keep this source http://chulinx.blog.51cto.com/4098114/1842031

Ubuntu 16.04 using Docker to build Java+tomcat+nginx reverse proxy/static and dynamic separation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.