Build an environment on Alibaba Cloud server and use Tomcat to publish the website to the public network

The operating system of the Alibaba Cloud server I chose is Windows2012 R2 graphical interface, which is convenient for Xiaobai to operate…

1. Configure the environment of the cloud server

(1) Install jdk: The version I choose to install here is jdk-8u144-windows-i586_8.0.1440.1. It is enough to install and configure environment variables normally, which is no different from installing on your own computer.
(2) Install tomcat: I installed tomcat-7.0.86-windows-x86, you can choose the installation-free version, you can use it directly after decompression, but you need to configure it if you want to boot and start automatically.
(3) Install mysql and the visualization tool Navicat

2. Upload the website package to be published

The selected website package is already compiled locally and placed in the /tomcat/webapps/ file
write picture description here

Third, configure the Tomcat file

Select the right-click text under the /tomcat/conf/service.xml file to open the editor:
write picture description here
the added content is as follows:

    <Connector port="80" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
    <Context path="" docBase="C:\Program Files (x86)\Tomcat7.0\webapps\sciencepark" reloadable="true" crossContext="true" />

Change the port to 80, because Ali's cloud server has a port 80 open. The path fills in the absolute path of the project you want to publish, here is C:\Program Files (x86)\Tomcat7.0\webapps\sciencepark
write picture description here

Fourth, start Tomcat

Finally, at the last moment, run the /tomcat/bin/startup file as an administrator and wait for tomcat to start successfully. Then the address accessed on the public network is: the public network ip of the cloud server + your project name
For example , mine is:http://120.79.139.27/sciencepark/
This completes the configuration.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325276251&siteId=291194637