CentOS6.5 64-bit Environment Build Java Server Environment tutorial

Source: Internet
Author: User
Tags openssl library

Tutorials :

1.

First enter the Linux system using the javac or java-version command to see if the JDK already exists Environment

If it exists, it needs to be uninstalled first.

RPM Offload

Uninstall OPEN-JDK First

Java–version

Rpm-qa | grep java

RPM-E--nodeps java-1.7.0-openjdk-1.7.0.45-2.4.3.3.el6.x86_64

RPM-E--nodeps java-1.6.0-openjdk-1.6.0.0-1.66.1.13.0.el6.x86_64

To start installing the JDK:

Upload the installation package to the server

Create a java under usr/local/

Mkdir/usr/local/src/java

CP./softwore/jdk-8u171-linux-i586.tar.gz./java/

uploading a JDK tar package

TAR-ZXVF jdk-8u171-linux-i586.tar.gz

Installation dependencies

Yum Install glibc.i686

To configure environment variables:

① Vi/etc/profile

② add at the end line

#set Java Environment

java_home=/usr/local/java/jdk1.8.0_171

Jre_home=/usr/java/jdk1.8.0_171/jre

Classpath=.: $JAVA _home/lib: $JRE _home/lib: $CLASSPATH

Export path= $JAVA _home/bin: $JRE _home/bin: $PATH

Save exit

③source/etc/profile make changes to the configuration take effect immediately

④java-version view JDK version information if the Java version "1.8.0_171" configuration is displayed successfully

    1. install MySQL

Unzip .

Cp/usr/local/softwore/mysql-5.5.49-1.linux2.6.i386.rpm-bundle.tar./

Installation dependencies

Yum Install Libaio.so.1

Yum-y Install libaio.so.1 libgcc_s.so.1 libstdc++.so.6

3. Install the service-side program

RPM-IVH Mysql-serv

If an error occurs

Error installing MySQL under Linux !

[[email protected] local]# rpm-i mysql-server-5.5.31-2.el6.i686.rpm 
         File/usr/share/mysql/czech/errmsg.sys from install of mysql-server-5.5.31-2.el6.i686 conflicts With file from the package mysql-libs-5.1.66-2.el6_3.i686
        file/usr/share/ Mysql/danish/errmsg.sys from install of mysql-server-5.5.31-2.el6.i686 conflicts with file from package mysql-libs-5.1.66-2.el6_3.i686
        file/usr/share/mysql/dutch/ Errmsg.sys from Install the mysql-server-5.5.31-2.el6.i686 conflicts with the file from the package mysql-libs-5.1.66-2.el6_3. i686
        File/usr/share/mysql/english/errmsg.sys from Install of mysql-server-5.5.31-2.el6.i686 conflicts with file from the package mysql-libs-5.1.66-2.el6_3.i686

Cause: There is already a mysql-libs-5.1.66-2.el6_3.i686 library (this is from Linux ) so you need to delete the previous library before you can install it!

Execute command:

RPM-E mysql-libs-5.1.66-2.el6_3.i686--nodeps forced Uninstall!

Then look at:

Rpm-qa|grep MySQL

perform the installation of your own MySQL:

Rpm-i mysqlxxxxx.rpm

4. Install the password yourself - Install the client at this time to easily change the password

REMEMBER to SET A PASSWORD for the MySQL root USER!

To does so, start the server, then issue the following commands:

/usr/bin/mysqladmin-u root password ' new-password '

/usr/bin/mysqladmin-u root-h vm_67_49_centos password ' new-password '

Alternatively you can run:

/usr/bin/mysql_secure_installation

Which would also give you the option of removing the test

Databases and anonymous user created by default. This is

Strongly recommended for production servers.

See the Manual for more instructions.

Problems at http://bugs.mysql.com/

    1. Installing the Client

Installation dependencies

Yum Install libncurses.so.5

RPM-IVH mysql-client-5.5.49-1.linux2.6.i386.rpm

View status

Service MySQL Status

Start the service

Service MySQL Start

Change Password

Log In first : Mysql-uroot

Change Password :

Use MySQL

Update the user set Password=password ("Custom password") where user= "root";

Flush privileges;

To turn on remote access :

Grant all permissions to the root user

Grant all privileges on * * to ' root ' @ '% ' identified by ' custom password ';

Flush privileges;

quit MySQL First

Firewall Open 3306 Port

/sbin/iptables-i input-p TCP--dport 3306-j ACCEPT

Persistence rules

/etc/rc.d/init.d/iptables Save

View the status of the current firewall

/etc/init.d/iptables status

start the MySQL service automatically when the system starts

Add to System services:

Chkconfig--add MySQL

Auto Start:

Chkconfig MySQL on

Query list:

Chkconfig

Note: No auto-start is not turned on (off) .

Installing tomcate

Create a folder

Decompression TAR-ZXVF apache-tomcat-7.0.57.tar.gz

Start : tomcate

go to Bin directory :

./startup.sh or sh startup.sh

1. Check the log:
Tail-f. /logs/catalina.out

View effect http://192.168.0.160:8080/
Discovery cannot be accessed:

2. Firewall open 8080 port


/sbin/iptables-i input-p TCP--dport 8080-j ACCEPT

/etc/rc.d/init.d/iptables Save

View the status of the current firewall

/etc/init.d/iptables status

Install nginx reverse proxy server ;

Extract

Compile

1.1.1 Environmental Requirements

Nginx is a C language development, it is recommended to run on Linux, this tutorial uses Centos6.4 as the installation environment.

Gcc

Installation nginx need to download the source code to compile, compile dependent gcc environment, if there is no GCC environment, need to install Gcc:yum install gcc-c++

PCRE

PCRE (perl Compatible Regular Expressions) is a Perl library that includes a Perl-compatible regular expression library. The Nginx HTTP module uses PCRE to parse the regular expression, so the Pcre library needs to be installed on Linux.

Yum install-y pcre Pcre-devel

Note: Pcre-devel is a two-time development library developed using PCRE. Nginx also needs this library.

Zlib

The Zlib library provides a number of ways to compress and decompress, and Nginx uses zlib to gzip the contents of the HTTP package, so you need to install the Zlib library on Linux.

Yum install-y zlib Zlib-devel

Openssl

OpenSSL is a strong Secure Sockets Layer cipher library that includes key cryptographic algorithms, common key and certificate encapsulation management functions, and SSL protocols, and provides a rich set of applications for testing or other purposes.

Nginx not only supports the HTTP protocol, but also supports HTTPS (that is, transmitting HTTP on the SSL protocol), so you need to install the OpenSSL library on Linux.

Yum Install-y OpenSSL Openssl-devel

1.1.2 Compiling and installing

The first step: Upload the Nginx source package to the Linux server

Step two: Unzip the source package. TAR-ZXF nginx-1.8.0.tar.gz

Step three: Enter the nginx-1.8.0 folder. Use the Configure command to create the makefile.

Fourth step: The parameters are set as follows:

./configure

--prefix=/usr/local/nginx \

--pid-path=/var/run/nginx/nginx.pid \

--lock-path=/var/lock/nginx.lock \

--error-log-path=/var/log/nginx/error.log \

--http-log-path=/var/log/nginx/access.log \

--with-http_gzip_static_module \

--http-client-body-temp-path=/var/temp/nginx/client \

--http-proxy-temp-path=/var/temp/nginx/proxy \

--HTTP-FASTCGI-TEMP-PATH=/VAR/TEMP/NGINX/FASTCGI \

--HTTP-UWSGI-TEMP-PATH=/VAR/TEMP/NGINX/UWSGI \

--http-scgi-temp-path=/var/temp/nginx/scgi

Note: The temp file directory above is specified as /var/temp/nginx , you need to / var under Create Temp and Nginx Catalogue

Fifth step: Make

Sixth step make Install

1.1 Nginx start-up and shutdown1.1.1 Start

In the Nginx directory there is a sbin directory, the Sbin directory has an nginx executable program.

./nginx

1.1.2 Close Nginx

Close command: Equivalent to find nginx process kill.

./nginx- s stop

Exit command:

./nginx-s quit

It is recommended to use this command when the program has finished executing and closing.

1.1.3 dynamically loading configuration files

./nginx-s Reload

You can update the configuration file without shutting down Nginx.

5. start nginx

The CD nginx directory

configuration file conf

Start Nginx

./nginx

The./nginx-s reload can update the configuration file without shutting down Nginx.

6. Release the port number

/sbin/iptables-i input-p TCP--dport 80-j ACCEPT

Add this setting to the rules in the firewall

/etc/rc.d/init.d/iptables Save

4. Publish the Project

A. databases and tables

backing up a store28 database

under windows

mysqldump-uroot-p123 store28 > F:/1.sql

Mysqldump Store > F:/store.sql

will be 1.sql uploading the root directory

Restoring a database from Remote Tools

log in to MySQL first

Create a database Store28

Enter store28

Source/root/1.sql

B. Project

Package a project war

features of the war pack :

in the tomcat/webapps directory, as long as Tomcat starts the war , it automatically extracts

upload Store.war to the root of the virtual machine

Move the Store.war to the tomcat/webapps

Installing Redis

Extract

TAR-ZXVF redis-3.0.7.tar.gz

Compile

Under the redis-3.0.7 folder

Make compilation

compile complete using the Make install command to install

Make install

Copy the configuration file redis.conf to the bin directory ,

Modify the configuration file as background run form

load the configuration file as a form to run Redis

./redis-server redis.conf

now Redis can run in the background.

1. deploying user-managed Projects1.1. Upload Usermanage.sql and the Root.war to the /ucenter/web1.2. Execute Database Script

Cat Usermanage.sql | mysql-uroot-p123456

1.3. deploying Web Programs 1.3.1. Delete web Apps all files under the

Cd/ucenter/web/itcast-usermanage/webapps

RM-RF *

1.3.2. Copy Root.war to the WebApps

Cp/ucenter/web/root.war.

1.3.3. Restart Tomcat

Cd.. /bin/

SH startup.sh && tail-f. /logs/catalina.out

1.3.4. start the browser test

/ http the IP of your own Linux server : 8080

CentOS6.5 64-bit Environment Build Java Server Environment tutorial

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: info-contact@alibabacloud.com 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.