Bluesky
Intern
Intern
  • UID1927
  • Fans0
  • Follows0
  • Posts1
Reads:3038Replies:3

Alibaba Cloud Tech Share – Install JDK, Tomcat, and its configuration Build Java web project on Ali

Created#
More Posted time:Feb 14, 2017 0:04 AM
Install JDK, Tomcat, and its configuration process. Build Java web project on Ali cloud.Get ready.Download putty and FileZlilla.
1, JDK installation
1, first of all to the http://www.oracle.com/technetwork/java/javase/downloads/index-jsp-138363.html download JDK, download to the local to the FileZlilla upload this package to the Ali cloud server

Open putty. Enter the IP address, follow the prompts to enter the user name and password.

2, configuration directory
Note: it is best to use root users to operate
Create a new directory:
CD usrmkdir javacd javamkdir JDK
Then unzip the JDK tar file to the directory above:
Tar zxvf jdk-8u73-linux-x64.gz -C /usr/java/jdk
The results are as follows:


3, configuration environment variables
Input:
VI /etc/profile
or
GEDIT /etc/profile
Add the following:
#set Java environmentexport JAVA_HOME=/usr/java/jdk/jdk1.8.0_73export JRE_HOME=/usr/java/jdk/jdk1.8.0_73/jreexport CLASSPATH=.: $JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATHexport PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$JAVA_HOME:$PATH
Note that this is changed to the corresponding JDK directory, and to root users to make changes, otherwise can not save
Save execution:
Source /etc/profile
Verify installation:
Input:
Java -version
The following shows that the installation is successful



2, configure Tomcat
1, Download tomcat, to download http://tomcat.apache.org/, where the author is using the tomcat7. Tomcat will be downloaded to the local computer, through the FileZlilla upload this package to a personal cloud server


2, installation
Here I install Tomcat to /usr/java/tomcat.
implement
Tar zxvf apache-tomcat-7.0.68.tar.gz -C /usr/java/tomcat
Note that the Tomcat directory should be created in advance

3, configuration environment
Go to the bin folder above tomcat:

open
VI setclasspath.sh
or
GEDIT setclasspath.sh
Add the following:
Export JAVA_HOME=/usr/java/jdk/jdk1.8.0_65 export JRE_HOME=/usr/java/jdk/jdk1.8.0_65/jre



Can save.
And then return to the bin directory:
Execution:
./startup.sh
The following shows that the installation is successful

Or directly through the port to external access, first look at the external IP server
After confirmation plus a port 8080 can be accessed:

End.

Latest likes:

CloudwingCloudw... DavecomDaveco... wendyflywendyf...

fridayyo
Post banned
Post banned
  • UID214
  • Fans5
  • Follows15
  • Posts357
1st Reply#
Posted time:Feb 16, 2017 10:40 AM
Sorry, the user is banned

Davecom
Intern
Intern
  • UID2115
  • Fans0
  • Follows0
  • Posts2
2nd Reply#
Posted time:Feb 24, 2017 12:17 PM
Good idea ,Thanks

RichardOfoezie
Intern
Intern
  • UID3989
  • Fans0
  • Follows0
  • Posts2
3rd Reply#
Posted time:Oct 24, 2017 8:23 AM
I have successfully installed and started tomcat on my ubuntu VM.
I am able to view tomcat welcome page on localhost using the "w3m http://localhost:8080" terminal command.
Unfortunately, I can't browse tomcat welcome page  outside of localhost using my Alibabacloud ECS assigned internet ip (http://InternetIP:8080).
I have disabled firewall using "sudo ufw disable " terminal command, yet nothing seem to work.



I have also edited tomcat server.xml file using "sudo nano [filename]" command, as suggested on some other online forum.

***FIRST MODIFICATION of tomcat server.xml file that did not work ***

<Connector port="8080" protocol="HTTP/1.1"
           connectionTimeout="20000"
           URIEncoding="UTF-8"
           redirectPort="8443"

           useIPVHosts="true"/>


***ANOTHER MODIFICATION of tomcat server.xml file that did not work either ***

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

           address="0.0.0.0"/>




On Microsoft Azure, it's mandatory for firewall inbound rules to be set and enabled for ports. It is also mandatory that

Endpoints be configured for same port on Azure console, before any connection can be made to VMs over the internet.

I am wondering if this is also the case with Alibabacloud ECS?




Kindly advise me on possible solution(s) to enable me access resources on my Alibabacloud Ubuntu VM via tomcat server.




*** By the way, "startup.sh" did not work in my case.

    I was however, able to start tomcat using "catalina.sh run"
Guest