LINUX Configuration Javaweb Project three major steps

Source: Internet
Author: User
Tags tomcat server

A: Install the JRE, the following steps used in the Vim editor, if not familiar with can refer to the = http://www.cnblogs.com/lovling/p/7808494.html

01: Download SERVER-JRE Installation package = http://www.oracle.com/technetwork/java/javase/downloads/server-jre9-downloads-3848530.html

02: Unzip to/usr/lib/java directory

03: Modify environment variable file with VIM editor = Vim/etc/environment

04: Write content = # Note: jdk1.8.0_151 is the folder name after decompression

Java_home= "/usr/lib/java/jdk1.8.0_151"
Classpath= "$JAVA _home/lib"
Path= "$JAVA _home/bin"

05: Install JRE = sudo update-alternatives--install/usr/bin/java java/usr/lib/java/jdk1.8.0_151/bin/java 300

06: Choose JRE = sudo update-alternatives--config java

The JRE selection appears and the version you just installed is selected according to the version

07: Test environment is installed successfully = Java-version (if the correct version number is installed successfully)

Two: Install the TOMCAT server

01: Download the corresponding version of Tomcat = http://tomcat.apache.org/

02: Unzip to the appropriate location as needed = The author installs in the/root directory

04: Configure Web Admin Account # = Vi/root/apache-tomcat-9.0.1/conf/tomcat-users.xml

Note: apache-tomcat-9.0.1 is the extracted file name

Write content =

<tomcat-users>
<user name= "account" password= "password" roles= "Admin-gui,manager-gui"/>
</tomcat-users>

05: Configure the Web Access port = vi/root/apache-tomcat-9.0.1/conf/server.xml

Modify <connector port= "8080" protocol= "http/1.1" connectiontimeout= "20000" redirectport= "8443"/>

For <connector port= "protocol=" http/1.1 "connectiontimeout=" 20000 "redirectport=" 8443 "/>

06: Go in the server startup and shutdown directory = CD /root/apache-tomcat-9.0.1/bin

Start Command = =./startup.sh Note:./cannot be omitted

Close Command = =./shutdown.sh

07:tomcat 8, do not allow non-native access to the project management interface, if you want to open permissions

Need to go to VI./root/apache-tomcat-9.0.1/webapps/manager/meta-inf/context.xml

Comment or delete all content within the context tab

Three: Firewall configuration

01: Open the server listening port for externally accessible 80 as an example (this port is consistent with the port configured above, the default is 8080)

02: Set Port Outbound access =/sbin/iptables-i input-p tcp--dport 80-j ACCEPT

03: Save Settings = Service Iptables Save

04: Restart Firewall = Service iptables restart

Four: After the configuration is complete, it can be accessed in the external browser

1: View Native IP = = ifconfig

2: Access Address example: http://192.168.3.4:80

Note: The external project configuration to the directory name under the WebApps directory cannot have-such special characters, otherwise there will be a 404 case

LINUX Configuration Javaweb Project three major steps

Related Article

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.