Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Server \ To install and configure the Jetty server and JDK under Ubuntu 14.04.2     - Detailed reference Oracle 11g Partition (Database)

- systemd-nspawn Quick Guide (Linux)

- SQL Server memory Misunderstanding (Database)

- Xtrabackup creates a slave node without downtime (Database)

- When Vim create Python scripts, vim autocomplete interpreter and encoding method (Programming)

- Use Redis as time-series database: why and how (Database)

- The headers for the current running kernel were not found when VirtualBox installation enhancements (Linux)

- To solve the Mac in question invalid BASH under configuration environment variable (Linux)

- OpenGL Superb Learning Notes - Vertex Shader example (Programming)

- HA-Federation-HDFS + Yarn cluster deployment (Server)

- Apache Tomcat integration and resin (Server)

- MySQL Data Types (Database)

- Use DB2 federated access Oracle (Database)

- Install Python 3.3.4 under CentOS 6.4 (Linux)

- libreadline.so.6: can not open shared object file problem solution (Linux)

- Introduction and bash history command to quickly call (Linux)

- installation process of Matlab 2012a under Ubuntu 14.04 (Linux)

- Ubuntu way of decompressing files (Linux)

- Memcached and Redis (Linux)

- Linux, see picture not resolve the problem (Linux)

  To install and configure the Jetty server and JDK under Ubuntu 14.04.2
  Add Date : 2018-11-21      
  Talk about installing JDK and configure Jetty server in Ubuntu 14.04.2 process, the first step to get JDK installation file, because my system is 64-bit, so the installation package is jdk-7u80-linux-x64. gz

Uploaded to Ubuntu server

Executive tar -xvf jdk-7u80-linux-x64.gz, extract to the current directory

tar -xvf jdk-7u80-linux-x64.gz

We then move to the directory / usr / lib / jvm below

mv jdk1.7.0_80 /usr/lib/jvm/jdk1.7.0_80

Jdk directory using the chmod command to increase the executable permissions

sudo chmod u + x /usr/lib/jvm/jdk1.7.0_80/bin

Then set the environment variable JDK also can refer to:

-------------------------------------------------- -------------

Under JDK settings (three configurations environment variable method) Linux environment variables

1. Modify / etc / profile file

This is the recommended method if your computer just as a development because all users have the right to use the shell environment variables that may give the system security issues.
Open the / etc / profile with a text editor
- In the profile file is added at the end:
                JAVA_HOME = / usr / share / jdk1.5.0_05
                PATH = $ JAVA_HOME / bin: $ PATH
                CLASSPATH =:. $ JAVA_HOME / lib / dt.jar: $ JAVA_HOME / lib / tools.jar
                export JAVA_HOME
                export PATH
                export CLASSPATH
- re-register
- Help
a. You want /usr/share/jdk1.5.0_05jdk to your jdk installation directory
b. linux under the colon ":" to separate path
c. $ PATH / $ CLASSPATH / $ JAVA_HOME is used to refer to the original value of the environment variables when setting environment variables in particular should be careful not to overwrite the original value to, and this is a common mistake.
d. CLASSPATH in the current directory. "" can not lose, lose the current directory is also a common mistake.
e. export is exporting these three variables as global variables.
f. case must be strictly distinguished.

2. Modify the .bashrc file

This method is more secure, it can have permission to use these environmental variables to control user level, if you need to use these environmental variables to a user permissions, you only need to modify the .bashrc file their personal user home directory can a.
Open the .bashrc file user directory with a text editor
- At the end of the file .bashrc added:
                set JAVA_HOME = / usr / share / jdk1.5.0_05
                export JAVA_HOME
                set PATH = $ JAVA_HOME / bin: $ PATH
                export PATH
                set CLASSPATH =:. $ JAVA_HOME / lib / dt.jar: $ JAVA_HOME / lib / tools.jar
                export CLASSPATH
- re-register

3. Set directly in the shell variable

Not in favor of using this method, because another shell, you set is invalid, this method is only for temporary use, to be used later when you want to reset too much trouble.
Just execute the following command in a terminal shell:
                export JAVA_HOME = / usr / share / jdk1.5.0_05
                export PATH = $ JAVA_HOME / bin: $ PATH
                export CLASSPATH =:. $ JAVA_HOME / lib / dt.jar: $ JAVA_HOME / lib / tools.jar

        After the Open Terminal, type the command "java -version", if the JDK version, suggesting that the environment variable configuration was successful.

-------------------------------------------------- -------------

sudo vi / etc / profile

In the profile is not added to the end of

Save and exit

Because there may be a default JDK, as openJdk ubuntu, so, then set the default JDK

update-alternatives --install / usr / bin / java java /usr/lib/jvm/jdk1.7.0_80/bin/java 300
update-alternatives --install / usr / bin / javac javac /usr/lib/jvm/jdk1.7.0_80/bin/javac 300

By the above step was added to our installed JDK java menu

Through the following command to query all JDK menu

update-alternatives --list java

Then execute the following command to select the default JDK for our installed JDK

update-alternatives --config java

If you select more than one number

Next View java version numbers are correct

java -version

If correct would indicate a successful installation JDK

Then there is the jetty installation configuration

First, download the jetty on to eclipse website, since my local development environment is used jetty8, so the server can also download jetty8


Unbuntu uploaded to server, execute the following command to extract

tar -xvf jetty-distribution-8.1.17.v20150415.tar.gz

Jetty and then move to the next directory / opt / jetty

mv jetty-distribution-8.1.17.v20150415 / opt / jetty

To create the user jetty next to the configuration files, and set it to / opt / jetty directory host

sudo useradd jetty -U -s / bin / false
sudo chown -R jetty: jetty / opt / jetty

Next, copy the script to the jetty startup directory, run it as a service

cp /opt/jetty/bin/jetty.sh /etc/init.d/jetty

Next step is to create the jetty profile

sudo vi / etc / default / jetty

Save and Exit

Then you can use the command to start the Jetty service

sudo service jetty start

I had originally because of jdk installed ubuntu, so no installation JDk operation, but when you start, can not find the JDK always displayed, because the default JDK version is not correct, you need to change the default JDK implementation of the above operations, which started on not being given the

At this point, the server installation is complete

Next, configure your site's directory on the server

Jetty configuration files are placed in $ {JETTY_HOME} / etc directory

By $ {JETTY_HOME} /etc/jetty-webapps.xml file, you can see all of the default Jetty web app are on the $ {JETTY_HOME} / webapps directory

Jetty in the package with a default test.war application, $ {JETTY_HOME} can find this file under / webapps directory, when the default start Jetty and services have been deployed test.war applications. For test.war file, Jetty file also defines the context, on the $ {JETTY_HOME} /contexts/test.xml, which contextPath defined as a "/", which is why the default access http: // localhost: 8080 / a when is the reason why the application of the access test.

Deploy new web applications

For war deployment package, just to war file into the $ {JETTY_HOME} / webapps directory, and can be accessed directly through the browser

For web application deployment directory, then you can copy the web application directory to $ {JETTY_HOME} / webapps / under < myapp> directory, then in $ {JETTY_HOME} / contexts / < myapp> .xml file, which reads as follows

< ? Xml version = "1.0" encoding = "ISO-8859-1"?>
< ! DOCTYPE Configure PUBLIC "- // Jetty // Configure // EN" "http://www.eclipse.org/jetty/configure.dtd">
< Configure class = "org.eclipse.jetty.webapp.WebAppContext">
  < Set name = "contextPath"> / myapp < / Set>
  < Set name = "war"> < SystemProperty name = "jetty.home" default = "." /> / Webapps / myapp < / Set>
< / Configure>
- How to use Android Studio to play more package names APK (Programming)
- CentOS 6.6 compile and install phpMyAdmin configuration PostgreSQL9.4.1 (Database)
- Linux pwd command learning experience (Linux)
- Java exception handling mechanism (Programming)
- JavaScript function part (Programming)
- Binary search and modification (Programming)
- Scope of variables in Object-C (Programming)
- 30 Practical Linux system administrators will learn the command (Linux)
- Ten to improve the efficiency of the Linux bash tricks (Linux)
- Java Foundation - Getting Start (Programming)
- How to Install Suricata IDS on a Linux system (Server)
- Mumble installation source VoIP application on Ubuntu (Linux)
- Standard and IO redirection (Linux)
- Configuring s3c-linux- appears Unable to find the QT3 installation (Linux)
- When a software RAID data recovery and reconstruction of how failure (Linux)
- Linux package management operations Basic entry (Linux)
- Doubly linked list basic operations (Linux)
- Ubuntu and Archlinux install Notepadqq 0.50.2 (Linux)
- Oracle Database High-Risk Vulnerability Warning (Database)
- Everyone should know something about TCP (Linux)
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.