Home IT Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ CentOS 6 rapid deployment of Java applications     - CentOS6 installed Tomcat (Server)

- Common Linux system performance monitoring command (Linux)

- Try to use Lets Encrypt (Linux)

- Laravel 4.2 Laravel5 comprehensive upgrade Raiders (Server)

- MySQL server after an unexpected power outage can not start (Database)

- To setup Cocos2dx project under Ubuntu (Linux)

- Oracle Database asynchronous IO cause slow query response (Database)

- Use libpq under Ubuntu 14.04 (Linux)

- Use MD5 transform algorithm to prevent exhaustive decipher passwords (Linux)

- How to Install Focuswriter 1.4.5 (Linux)

- How Ubuntu Snappy Core 2 running on Raspberry Pi (Linux)

- Installation configuration CUDA under Ubuntu 14.04 (Linux)

- How to allow users to access only a specific database (MSSQL) (Database)

- When Linux virtual machine to another copy of the operating system, a static IP NAT mode Invalid (Linux)

- Talking about modern programming language syntax and standard library tightly bound phenomenon (Programming)

- CentOS 6.6 command-line automatic completion (Linux)

- Android project and coding specifications (Programming)

- Relationship between Linux permissions with the command (Linux)

- Git remote repository Explanation (Linux)

- CentOS 7.0 running Docker kernel error solution (Server)

 
         
  CentOS 6 rapid deployment of Java applications
     
  Add Date : 2018-11-21      
         
       
         
  IDC currently provides services vendors is really varied, but a very few corrections services in place, out of time to consider or suggested the use of Windows, install at least the development environment will be much more convenient, not to spend too long. In general Java development environment mainly middleware, JDK, database three parts, following the deployment began to share my experience.

First, install the Linux version of jdk

Linux installation is not complicated, troubling is that the tortoise-like jdk download connection speed, as well as sign-mess of trouble, as is strongly recommended to download jdk rpm or bin files, these two files are installed it is extremely simple, If the system does not support rpm file on the choice of bin file, a simple sh command to get.

In order to eliminate interference it is recommended to uninstall itself comes openjdk, if it does not exist can omit this step.


First check rpm -qa | grep java

Displays the following information:

java-1.4.2-gcj-compat-1.4.2.0-40jpp.115
java-1.6.0-openjdk-1.6.0.0-1.7.b09.el5

Uninstall:

rpm -e --nodeps java-1.4.2-gcj-compat-1.4.2.0-40jpp.115
rpm -e --nodeps java-1.6.0-openjdk-1.6.0.0-1.7.b09.el5

There are other commands

rpm -qa | grep gcj

rpm -qa | grep jdk

If you can not find the openjdk source, then also it can be uninstalled

yum -y remove java java-1.4.2-gcj-compat-1.4.2.0-40jpp.115
yum -y remove java java-1.6.0-openjdk-1.6.0.0-1.7.b09.el5

1 Install jdk

Install jdk really super simple, first enter downloaded jdk directory, use the command to file authorization

chmod + x filename of your jdk

Enter ./jdk filename .bin, less than a minute to installed the jdk

2 copies of the directory to / usr / local (change Optional)

After the installation in order to facilitate management, you can copy the installation directory to / usr / local following, the following command

cp original installation directory / usr / local / jdk6

3 configure the environment variables (critical)

First, use the vi command to edit profile, command vim / etc / profile;

And add the following content in the final surface file, directory, modified according to the actual situation

export JAVA_HOME = / usr / local / jdk6
export JAVA_BIN = / usr / local / 6 / bin
export PATH = $ PATH: $ JAVA_HOME / bin
export CLASSPATH =:. $ JAVA_HOME / lib / dt.jar: $ JAVA_HOME / lib / tools.jar
export JAVA_HOME JAVA_BIN PATH CLASSPATH

4 Restart linux

reboot

Second, the installation tomcat

This step is the linux version of tomcat uploaded to the server, it is recommended to delete the original built-in, because the native too hard to use, the war package into webapps below recommended apache-tomcat-6.0.29 this version, this version handy

Three or mysql installation mongodb

1 resolve issues related to the wonderful mysql

(1) abnormal speaking in tongues is not configured

This situation jpa development projects in more common solution is very simple, just put the dialect configuration and it's ok

< Bean id = "entityManagerFactory"
  class = "org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
  < Property name = "dataSource" ref = "dataSource" />
  < Property name = "jpaVendorAdapter">
   < Bean class = "org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
    < Property name = "showSql" value = "false" />
   < / Bean>
  < / Property>
  < Property name = "jpaProperties">
   < Props>
    < Prop key = "hibernate.hbm2ddl.auto"> update < / prop>
    < Prop key = "hibernate.dialect"> org.hibernate.dialect.MySQLInnoDBDialect < / prop>
   < / Props>
  < / Property>
< / Bean>

(2) is not on the database connection

Good rule out this problem, a problem basically url, user name or password is wrong, there is a lack of database driver jar package

(3) the name of the database table is not normal

This really is a miracle, the probability of this situation generally relatively small, so the Internet is difficult to find a solution, I am also looking for a long time to find a solution is to add the following node in the mysqld configuration

lower_case_table_names = 1

This situation often occurs in the window of the project ported to linux, after use under normal circumstances hibernat or jpa automatically generated table name and the name of the same class as the default entity class, and if the table name before the database is all lowercase, as long as the project start, the database will press jpa or hibernate generate a bunch of new specification table, cause an error.

 Commonly used mysql configuration file:

[Mysqld]
datadir = / var / lib / mysql
socket = / var / lib / mysql / mysql.sock
user = mysql
default-character-set = utf8
lower_case_table_names = 1
[Client]
password = gtyiaJB8R
port = 3306
socket = / var / lib / mysql / mysql.sock
default-character-set = utf8
# Disabling symbolic-links is recommended to prevent assorted security risks
# Symbolic-links = 0
[Mysqld_safe]
log-error = / var / log / mysqld.log
pid-file = / var / run / mysqld / mysqld.pid
default-character-set = utf8

(4) mongodb start / stop mode

mongodb and mysql have different, mainly in the launch of the database, mongodb inflicted reception start of course inappropriate, only to start background process in a way

 ./mongod --dbpath = mongdb your data directory --fork --logpath = / data / log / mongodb.log

If you want to stop mongodb recommended:

use admin
db.shutdownServer ();

These problems are not wonderful enough, to solve these problems so I really learned a lot.
     
         
       
         
  More:      
 
- About Python default character set (Linux)
- FFmpeg compiled with only H264 decoding library (Programming)
- MySQL log from the library than the main library (Database)
- Linux compiler installation Redis (Database)
- Using Android Studio integrated development environment to build Android (Linux)
- Linux Getting Started tutorial: Borrow Windows fonts in Ubuntu 14.10 (Linux)
- Linux - use chroot command (Linux)
- X security settings in Ubuntu (Linux)
- Using a proxy method under Linux terminal (Linux)
- Ubuntu 15.10 How to install TeamViewer 11 (Linux)
- Linux shell in back quotes (`) Application (Linux)
- CentOS 6.4 installation and configuration LNMP build PHP server runtime environment (Server)
- Set up MySQL master and slave servers under Ubuntu 14.04 (Server)
- Install the free open source financial software GnuCash 2.6.6 under Ubuntu (Linux)
- iOS9 new feature - stacked view UIStackView (Programming)
- Nginx server security configuration (Server)
- ORA-600 [kcbz_check_objd_typ] Error Handling (Database)
- Repair Maven project developed default Maven Plugin folder (Linux)
- Ubuntu 14.10 / 14.04 how to install Quick Start tool Mutate 2.2 (Linux)
- Oracle query start with connect by tree (Database)
     
           
     
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.