Recently wrote a small project in Java, want to deploy to the server, so bought a Windows server2012, but do not know how to deploy, later know the need to configure the Java Runtime environment. After some research has finally been done. Below is my personal summary, because it is the first time to deploy the server, so some places are not perfect.
First step: Install the JDK
- Download
This can be downloaded to the Oracle website , Download the following steps:https://jingyan.baidu.com/article/ C1465413b54ec40bfcfc4cdd.html The latest version of Oracle page is not the case, search the jdkdirectly, find javase , and then download the same steps.
- installation
After the download is installed, this is the next step directly. Refer to the following:https://jingyan.baidu.com/article/b24f6c82c989da86bfe5dab2.html Installation path You can choose your own.
- Configuring Environment variables
Reference Link:https://jingyan.baidu.com/article/6dad5075d1dc40a123e36ea3.html classpath can not be configured. After opening the command window, enter java and javac If output a list of things, the configuration is successful
Step Two: Install tomcat
Baidu is not self-, this is very simple
after the problem: becauseTomcatThe default access port is8080, the initial access address ishttp://192.168.1.232:8080/. (PersonalIPaddress may vary)
(1If you need direct access, do not enter8080port, you need to modifyServer.xml(file inTomcatunder the installation directoryconffolder), under
<connector port= "protocol=" http/1.1 "connectiontimeout=" 20000 "redirectport=" 8443 "/>will bePortthe value is changed to the. This allows you to enter domain name access directly.
(2)will beJAVA WEBProject Export to”Project Name. War "file. of the copied server.Tomcat \webapps
directory to store.
5,Warafter the files are put in place, you can modify them as needed.Tomcatunder the installation directoryconffolder
under theServer.xmlin the following:
<context docbase= "D:\Program files\apache software foundation\tomcat 7.0\webapps\ project name" path= "" reloadable= "true"/ >will beDocBasevalue is modified toWarthe file name of the file (not the suffix name, and the absolute path).
Part III : Installing mysql
direct Baidu MySQL, installation tutorial self-Baidu. Because this is very simple.
after opening the command prompt,cd to the bin directory under MySQL , enter mysql-u root ( Default User name )-P Enter , enter MySQL after entering the password , you can create the database, data table and so on.
finally in in Tomcat, under the bin directory, double-click startup to start the tomcat Server and you can access it.
Remark :
do not drop after Tomcat startup, you can choose to minimize.
Mysql installation is sure to remember the password
JDK best with jdk7 or jdk8
Configuration environment variables are recommended to be configured in system variables so that other users can access
If you want to use Tomcat8 above,jdk should use more than JDK8, or not support
also refer to the following http://blog.csdn.net/u013063099/article/details/58006642
How does Windows server2012 run the Javaweb project?