Detailed installation configuration process for Java development software that can be completed by copying and pasting

Source: Internet
Author: User
Tags install openssl sqlite svn zookeeper git client tomcat server redis server tortoisesvn

Java development and release process need to install a lot of software, these software installation process is usually not a mouse double-click can be solved, but it is not difficult, but very few people will spend energy to remember, I will install these software procedures, for reference! The finishing process is based on the CentOS 6.5 platform, and other Linux versions can also be referenced


The most important natural Java development is the JDK, starting with the installation of the JDK (the Windows Installer JDK is basically the same as Linux)

Download the JDK installation package from the official Oracle website: jdk-8u111-linux-x64.rpm

Check to see if there is a system-brought JDK or JDK installed before installation, and if so, delete it first

Rpm-qa|grep javarpm-e--nodeps filename

Then install the JDK, which is installed by default in the/usr/java directory

RPM-IVH jdk-8u111-linux-x64.rpm

Configuring Environment variables


Append the following content

#java confexport java_home=/usr/java/jdk1.8.0_111export path= $PATH: $JAVA _home/binexport classpath=: $JAVA _home/lib

Make the configuration effective immediately, and then use "java-version" to check the JDK's installation results


Ant is the Java Project Builder that downloads the ant installation package from the Ant official website: apache-ant-1.9.7-bin.tar.gz, then unzip

Tar xvf apache-ant-1.9.7-bin.tar.gz-c/usr/java/

Configuring Environment variables


Append the following content

#ant confexport ant_home=/usr/java/apache-ant-1.9.7export path= $PATH: $ANT _home/bin

Make the configuration effective immediately, and then use "ant-version" to check the ant installation results


MAVEN configuration is almost identical to ant, download the installation package from the MAVEN official website: apache-maven-3.2.1-bin.tar.gz, unzip the installation

Tar xvf apache-maven-3.2.1-bin.tar.gz-c/usr/java/

Configuring Environment variables


Append the following content

#maven confexport maven_home=/usr/java/apache-maven-3.2.1export path= $PATH: $MAVEN _home/bin

Make the configuration take effect immediately, and then use "mvn-version" to check the MAVEN installation results


Download the installation package from the Tomcat official website:, unzip on the line, do not need to be configured to start, the following describes other aspects of Tomcat common configuration

Specify the root directory of the project, configure Server.xml

Configure encoding format, tomcat default encoding Iso8859-1

<connector connectiontimeout= "20000" port= "3100" protocol= "http/1.1" redirectport= "8443" useBodyEncodingForURI= " True "uriencoding=" Utf-8 "/>

HTTPS One-way authentication

<connector port= "8443" protocol= "Org.apache.coyote.http11.Http11Protocol" maxthreads= "Max" sslenabled= "true" Scheme= "https" secure= "true" Clientauth= "false" sslprotocol= "TLS" keystorefile= "D:\tomcat.jks" keystorepass= "123456 "/>

HTTPS bidirectional authentication

<connector port= "8443" protocol= "Org.apache.coyote.http11.Http11Protocol" maxthreads= "Max" sslenabled= "true" Scheme= "https" secure= "true" Clientauth= "true" sslprotocol= "TLS" keystorefile= "D:\tomcat.jks" keystorepass= "123456" Truststorefile= "D:\tomcat.jks" truststorepass= "123456"/>

Download Red Hat Enterprise Linux 6/oracle Linux 6 (x86, 64-bit) corresponding to the 5.6 version of the installation package from the MySQL official website: mysql-client-5.6.33-1.el6.x86_64.rpm, mysql-server-5.6.33-1.el6.x86_64.rpm

View installed MySQL or MySQL libraries before installing and remove them

Rpm-qa|grep-i mysqlrpm-e--nodeps filename

If you are unloading load, use the following command to find additional files generated by MySQL and remove them

Find/-name mysqlrm-fr filename

Perl dependencies required to install MySQL

Yum Install-y Perl-module-install.noarch

Now we can install MySQL.

RPM-IVH MYSQL-SERVER-5.6.33-1.EL6.X86_64.RPMRPM-IVH mysql-client-5.6.33-1.el6.x86_64.rpm

The installation is complete, start the MySQL service, and set the boot to boot

Service MySQL startchkconfig MySQL on

After the MySQL installation is complete, generate a random password for the root account, located in the. mysql_secret file in the/root directory, log in to root with this password


Modify the root password and configure remote access

Set Password=password (' root '); grant all privileges on * * to ' root ' @ '% ' identified by ' root ';

Windows install MySQL also often used, here is a brief introduction, download the installation package from the official website:, extract to D:\java, and then add the extracted Bin directory into the system environment variable "Path", Go to the MySQL root directory, edit "My-default.ini", remove the comments from the next two lines and configure

Basedir = D:\java\mysql-5.6.33-winx64datadir = D:\java\mysql-5.6.33-winx64\data

Use the administrator to open the cmd command line, go to the MySQL bin directory, start the MySQL service

Mysqld-installnet start MySQL

After installing MySQL in Windows root account has no password, can log in directly, and then change the password

Mysql-u root-pmysql> Use mysql;mysql> Update user Set password = password (' root ') where user = ' root ';mysql> FL Ush privileges;

Nginx is a reverse proxy server that is commonly used to proxy tomcat clusters and provides load balancing

Download Nginx installation package from Nginx official website: nginx-1.8.1.tar.gz, unzip

Tar xvf nginx-1.8.1.tar.gz-c/usr/local

Then install the dependent

Yum Install Gccyum install Pcre*yum install Openssl*yum install zlib*

Installing Nginx

Cd/usr/local/nginx-1.8.1./configure--prefix=/usr/local/nginx--with-http_ssl_module--with-http_spdy_module-- With-http_stub_status_module--with-pcre--with-http_gzip_static_modulemakemake Install

Nginx start, close, restart command

Cd/usr/local/nginx/sbin./nginx./nginx-s Stop./nginx-s Reload

Then introduced a few common simple configuration, all in the Nginx conf directory nginx.conf set

Proxy Tomcat Server


Custom error page, in nginx/html directory create error page such as error.html, file size must be more than 512 bytes

Error_page 495/error.html;location =/error.html{root html;}

As a file download server, the directory where the files are stored is/var/tmp +/download/

Location ^~/download/{root   /var/tmp;if ($request _filename ~* ^.*?\. ( TXT|DOC|PDF|RAR|GZ|ZIP|DOCX|EXE|XLSX|PPT|PPTX) {Add_header content-disposition: ' Attachment; ';}}

Turn on HTTPS one-way authentication

server {Listen       443 ssl;server_name  localhost;ssl_certificate      Cert.pem;    #服务器证书公钥部分ssl_certificate_key  Cert.key;    #服务器证书私钥ssl_session_cache    shared:ssl:1m;ssl_session_timeout  5m;ssl_ciphers  high:!anull:! Md5;ssl_prefer_server_ciphers  on;location/{proxy_pass;    #代理tomcat的http服务}}

Turn on HTTPS bidirectional authentication

server {Listen       443 ssl;server_name  localhost;ssl_certificate      Cert.pem;    #服务器证书公钥部分ssl_certificate_key  Cert.key;    #服务器证书私钥ssl_verify_client on;    #开启浏览器认证ssl_client_certificate Ca.pem;    #CA根证书ssl_session_cache    shared:ssl:1m;ssl_session_timeout  5m;ssl_ciphers  high:!anull:! Md5;ssl_prefer_server_ciphers  on;location/{proxy_pass;    #代理tomcat的http服务proxy_set_header Client-cert $ssl _client_cert;    #将浏览器证书传递给tomcat以验证证书信息, Tomcat gets the certificate information through the header}}

Redis is a key-value database that runs in memory and is characterized by fast speed and is used as a cache server

Download the Redis installation package from the Redis official website: redis-3.2.5.tar.gz, put it in/usr/file, unzip the installation

Cd/usr/filetar XVF Redis-3.2.5.tar.gzcd/usr/file/redis-3.2.5make

Installed by default in/usr/local/bin and configured with environment variables


This command is used to view the Redis version information as follows

Redis server v=3.2.5 sha=00000000:0 malloc=jemalloc-4.0.3 bits=64 build=94baaab3f6dec4df

Next, start configuring Redis to create the desired directory for the configuration


Copy redis.conf


Modify Configuration

Bind Yespidfile/var/redis/run/redis.pidlogfile/var/redis/log/redis.logdir/var/redis/data

To configure Redis as a system service, copy the startup script first


Modify Configuration

#!/bin/sh# #chkconfig: 2345 90 10# file header To configure this cnkconfig, otherwise no boot from boot pidfile=/var/redis/run/redis.pidconf= "/etc/redis/ Redis.conf "

Configure boot-up

chmod +x/etc/init.d/redischkconfig Redis on

Start Redis Service

Service Redis Start

If you have already started Redis, and this start error, delete the previous PID file

Git client

The GIT client is configured under Windows, download the Windows version of the Git client from, double-click Install

Open git bash, run

Ssh-keygen-t rsa-c "[Email protected]"

Return, enter "Yes", and then enter, will generate SSH key in "C:\Users\username\.ssh\" file, copy all contents

Login to GitHub, open "Settings", click on the left "ssh and GPG Keys" menu, then click on the right side of the "New SSH Key" button, "Title" arbitrarily enter the name, "key" paste just copy of the key, note that the last do not empty space or line-wrapping, Save Configuration

Open git bash, enter

ssh-t [email protected]

A successful connection to GitHub indicates that the configuration was successful and the files can be transferred between the local and GitHub repositories.

git config--global "ywlaker" git config--global "[email protected]" Cd/d/github/testgit Initgit Remo  Te add origin [email Protected]:ywlaker/test.gitgit pull Origin mastergit Add./*git commit-m "comment" Git push-u origin Master

Download the installation package from Zookeeper official website: zookeeper-3.4.9.tar.gz, unzip the installation

Tar xvf zookeeper-3.4.9.tar.gz-c/USR/JAVACD/USR/JAVA/ZOOKEEPER-3.4.9/CONFCP zoo_sample.cfg zoo.cfg

Start Zookeeper

cd/usr/java/zookeeper-3.4.9/bin./ start

CentOS installation Subversion relies on Apr, apr-util, SQLite, download installation package: subversion-1.9.4.tar.gz, apr-1.5.2.tar.gz, apr-util-1.5.4.tar.gz ,, put these files in the/usr/file directory, unzip

Cd/usr/filetar xvf subversion-1.9.4.tar.gztar xvf apr-1.5.2.tar.gztar xvf apr-util-1.5.4.tar.gzunzip

Install Apr

CD apr-1.5.2.configure--prefix=usr/local/aprmake && make install

Installing Apr-util

Cd.. /apr-util-1.5.4./configure--prefix=/usr/local/apr-util--with-apr=/usr/local/aprmake && make install

Configure SQLite

Cd.. /MV sqlite-amalgamation-3150100./subversion-1.9.4/sqlite-amalgamation

Installing Subversion

CD subversion-1.9.4./configure--prefix=/usr/local/subversion--with-apr=/usr/local/apr--with-apr-util=/usr/local /apr-utilmake && make Install

Configuring Environment variables


Append the following content

#subversionexport path= $PATH:/usr/local/subversion/bin

Make the configuration effective immediately and use "svnserve-version" to check the installation results


Next start configuring the warehouse, Warehouse path/usr/svn/repo

Mkdir-p/usr/svn/reposvnadmin Create/usr/svn/repo

Files and directories are generated under the warehouse directory, editing

Cd/usr/svn/repo/confvi svnserve.conf

Remove the comments from the following lines and modify them, note that you must not leave a blank before

anon-access = noneauth-access = writepassword-db = passwdauthz-db = Authzrealm = Repo

Edit passwd File

VI passwd

Add (user = password)

[Users]root = root

Edit Authz File

VI Authz

Set permissions

[groups]admin = root[/] @admin = RW

Start Subversion

svnserve-d--listen-port 9999-r/USR/SVN

Next, you'll configure subversion as a system service, creating a file in the/ETC/INIT.D directory svn (no suffix)

Cd/etc/init.dvi SVN

Add the following content

#!/bin/bash#chkconfig:2345 10# #subversion # Build this file in/etc/init.d/svn# chmod 755/etc/init.d/svn#svn_home=/us r/svnif [!-F "/usr/local/subversion/bin/svnserve"]then    echo "Svnserver startup:cannot start"    exitficase "$" In    start)        echo "Starting svnserve ..."        /usr/local/subversion/bin/svnserve-d--listen-port 9999-r $SVN _ HOME        echo "started!"        ;;    Stop)        echo "stoping svnserve ..."        killall svnserve        echo "stopped!"        ;;    Restart) $        Stop $        start        ;    *)        echo "USAGE:SVN {start | Stop | Restart} "        exit 1esac

Set boot up

chmod 755/etc/init.d/svnchkconfig SVN on

SVN start, Close command

Service svn startservice svn stopservice svn restart

The Windows installation TORTOISESVN client software, checkout Svn://, may encounter the following two types of errors

Unable to connect to a repository at Urlline 19:option expected

Workaround: Error One, right-click "TortoiseSVN"--"Settings"--"Saved Data", then "Clear" all the items, re-"checkout". Error two, modify Subversion configuration file, remove the pre-line space before the configuration item

Detailed installation configuration process for Java development software that can be completed by copying and pasting

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: 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.