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     - Oracle 12CIN-memory in table spaces (Database)

- Elaborate .NET Multithreading: Thread Pool (Programming)

- OpenSSH version smooth upgrade method (Linux)

- Oracle View Object Information (Database)

- Linux Man Page Installation (Linux)

- Bash difference in single quotes and double quotes (Programming)

- Install DB2 V10 and Data Studio V3 under Linux (Ubuntu) environment (Database)

- Using a proxy method under Linux terminal (Linux)

- Linux 4.0+ kernel support for hardware switching module (HW Switch Offload) (Linux)

- Ubuntu install code editor Sublime Text 3 (Linux)

- Offline (local) Yum source structures (Linux)

- Oracle 11g Export guide problem not an empty table (Database)

- Use the TC flow control test under Linux (Linux)

- How to install Eclipse Luna IDE on CentOS 7 / RHEL 7 (Linux)

- C ++ complex class of operator overloading (Programming)

- Vim useful plugin: YouCompleteMe (Linux)

- Oracle database online redo logs are several methods of recovery of deleted (Database)

- Ubuntu 10.04 to Ubuntu 10.10 Upgrade (Linux)

- Java input and output common class Scanner (Programming)

- Confrontation dragged Library - Web front-end encryption slow (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

jetty-distribution-8.1.17.v20150415.tar.gz

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>
     
         
         
         
  More:      
 
- Single-node Hadoop installation notes distributed pseudo & (Server)
- Linux System Getting Started Tutorial: How to Force Change your password at next logon Linux (Linux)
- How to prevent page five invisible killer (Linux)
- State and Linux nf_conntrack TCP disconnect time (Programming)
- View processes and threads under Linux (Linux)
- CentOS yum source as the default setting methods in DVD (Linux)
- Android determine the device network connection status, and determine the connection (Programming)
- Python variable type (Programming)
- Two classic macro definition under Linux (Linux)
- OpenNMS separate database (Server)
- Interesting example of Linux Sort command (Linux)
- Preview function to confirm the stop resource Oracle 12c new feature crsctl (Database)
- 25 Git Usage Tips (Linux)
- impdp error ORA-31631, ORA-39122 (Database)
- C ++ copy constructor (Programming)
- Android system source code and compile the kernel source code (Programming)
- Enable Intel Rapid Start in GNU / Linux (Linux)
- Use apt-p2p up a local Debian package cache (Server)
- Linux (RHEL6 CENTOS6 OLE6) VNC-SERVER Installation and Configuration (Server)
- How do I upgrade from Ubuntu 15.04 to Ubuntu 15.10 (Linux)
     
           
     
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.