Tomcat on the cloud server configuration appears part of the problem and how to deal

Description of the problem :( a) for modifying tomcat 8080 port for direct access to the domain name can not be used after 80 port; (b) Add items not directly accessible through the domain name (the server still to be resolved)

Configuring basic process:

  1, you need to purchase the appropriate server, domain name registration, domain name resolution correctly;

    DNS is successful can order through a local computer dos verification: Windows + R to run cmd command in the dos command line that appears enter "ping www.xxx.com", ie ping + domain name, the data returned by check to determine ip address whether the domain name resolution succeeds (just parse domain name may take some time to take effect)

  2, download jdk and tomcat-free installation of compressed files (used here is: jdk-8u231-linux-x64.tar.gz apache-tomcat-9.0.29.tar.gz);

    Can be downloaded from the official website of jdk and tomcat according to their needs

  3, upload to step 2 in the downloaded zip file, you can use is recommended Xftp (mainly file operations) and Xshell (mostly command-line operation) to remotely operate a cloud server;

  4, using the command line Xshell decompressing the compressed file compression, configure and start jdk environment (omitted here);

  5, configuration tomcat:

    (5.1), use the command line to enter the cloud server Xshell stored in the tomcat folder, execute 

        tar -xvf apache-tomcat-9.0.29.tar.gz

       Command to decompress (according to their own use tomcat run the compressed file name), the command is executed after the end to see the apache-tomcat-9.0.29 file after unzip the folder by ls, using

       cd apache-tomcat-9.0.29 command to enter the folder (ls command to see all the files within the folder);

    (5.2), use cd bin into the bin directory, use vim setclasspath.sh modify the contents, add the following command at the last exit and save (esc + ZZ):

       export JAVA_HOME=/java/jdk1.8.0-231

       export JRE_HOME=/java/jdk1.8.0-231/jre

       Description: Here / java jdk and tomcat represents an absolute path (ie, the file path displayed Xftp)

  And solve problems encountered in the operation of my tomcat configuration process:

    (5.3), immediately following the step should be to use ./startup.sh start tomcat, tomcat represents a successful start, then they can turn on the computer when the browser displays "Tomcat started" when entering www.xxx.com:8080

   Test tomcat successful configuration, when the page is displayed is tomcat home would mean tomcat configuration is successful, such as when the display fails, again according to previous steps to check whether their configuration a mistake; if done correctly, you can see the cloud server security set of rules whether to add a 8080 port security rules;

    (5.4), modify the port 8080

      After tomcat configuration is successful, enter the conf directory, use the command to modify the vim server.xml, as shown in the following areas need to be modified, save the changes and exit (Please do not modify elsewhere);   

        <Connector port="80" protocol="HTTP/1.1"
          connectionTimeout="20000"
          redirectPort="8443" />

    (5.5), go to the bin directory, restart tomcat

       Close tomcat: ./shutdown.sh (failure to close an exception occurs, check the print log file of tomcat troubleshooting, or to see if the port is occupied)

       Start tomcat: ./startup.sh 

    (5.6), then enter in the browser directly to your own domain name www.xxx.com reasonably be accessible to the tomcat pages, but can not appear in front of the access and configuration operations when there are no errors, and may I encountered the same problem

  6, the emergence of (5.6) in the description of the problem when my own solution:

    (6.1), after deleting the file Tomcat decompressed, re (5.1), the operation step (5.2), skip (5.3) after the operation of the two-step operation, performed immediately after a few steps, at this time in the browser page can be accessed directly through the domain tomcat

 

  7, for the deployment of Java Web project in tomcat, to achieve direct access to the project domain there are problems, but this test method provides a local tomcat's (see step 8 in the project's deployment tomcat)

    (7.1) first need to configure the environment locally and installed tomcat

    (7.2) at the local tomcat installation directory, and enter the conf folder and edit the server.xml file, first step (5.4) as modified in 8080 to modify the port, and then

    <Host name = "localhost" appBase = "webapps" unpackWARs = "true" autoDeploy = "true"> Add <Context path = "" docBase = "Item Name" /> intermediate content </ Host> is added after As follows:
    

    <Host name="localhost" appBase="webapps"
        unpackWARs="true" autoDeploy="true">
        <Context path="/" docBase="ShoppingNetwork"/>

       <Valve ....

     </Host>

    (7.3), go to the bin folder, double-click startup.bat run tomcat, after a successful run can be entered directly in the browser localhost, appears is added to the project home page, indicating the local configuration of tomcat success.

 

  8, on a personal project in tomcat deployment of Java Web summary

 

  This article is a summary of part of their own after inspection elsewhere, if infringement or causing distress to you, please contact me promptly remove content, inconvenience please understand.

  If the content of the article useful for you, feel very honored.

  Welcome you to submit your comments.

  O (∩_∩) O

Guess you like

Origin www.cnblogs.com/moreforests/p/12076555.html