one , create a docker container
Docker run--name 3001-p 3001:8080-v/usr/local/dockertomcat3001/webapps:/usr/local/tomcat/webapps-v/usr/local/ Dockertomcat3001/logs:/usr/local/tomcat/logs-m 512m-e java_opts= '-xmx512m '-D Tomcat
--------------------------------------------------------------------------------------------------------------
Docker run--name 3001-p:d ocker is named 3001
3001:8080-v: use 3001 This port number to monitor 8080 port 8080 for Tomcat Default Port
/usr/local/dockertomcat3001/webapps:/usr/local/tomcat/webapps-v path /usr/local/dockertomcat3001/ logs:/usr/local/tomcat/logs-d Tomcat
-M 512m-e java_opts= '-xmx512m ' can be used without
some Linux need to be in front of the command to add sudo
--------------------------------------------------------------------------------------------------------------
Related Commands :
Docker restart restart the Docker container . the container name .
Docker stop in the Docker container .
Docker start launches the Docker container .
Docker PS View all docker containers for the current system
Docker logs view logs for the current Docker container
Docker logs--tail=100 view Log last Bar
--------------------------------------------------------------------------------------------------------------
two , Apache reverse proxy
httpd-k install-n apache2.2 where "apache2.2" is the service name
( version different commands may not be the same )
Open Apache24\conf inside the httpd.conf file
Change Define Srvroot This is the path where the project is located . mine is in - Line .
The Listen is an apache Open Port . Use this port number to listen Tomcats
At the bottom , Proxypass and proxypassreverse are project Paths , in General , the two of them are the same. .
in Apache24\conf\extra this folder , there is httpd-ssl.conf This file , the default port inside is 443. If you have a second or 3 Apache , be careful not to repeat the port number
Apache Reverse Proxy