Use the bricklayer to build the javaweb environment and the bricklayer to build the javaweb

Source: Internet
Author: User
Tags gz file

Use the bricklayer to build the javaweb environment and the bricklayer to build the javaweb

 

 

/*

This article is based onVpsOfCentos-6-x86_64OfLinuxBuild the system.

Tools to be prepared:1,Putty(For connectionLinuxSystem)

2,WinSCP(Provided by the bricklayerFtpUpload and download tools)

*/

1, UseWinSCPTool connectionLinuxFile Management

 

 

ThenJdkOfTar.gzFile andTomcatOfTar.gzUpload files/Usr/localFolder

The version used in this article is

Jdk-7u25-linux-x64.tar.gz

Apache-tomcat-7.0.69.tar.gz

2, UsePuttyConnectionLinux

 

 

 

 

 

 

 

 

I,InstallJdk

[Root @ cc ~] # Cd/usr/local (go to this directory)

[Root @ cc local] # mkdir jdk (create a folder named jdk in the current directory)

[Root @ cc local] # ls (view directory)

[Root @ cc local] # cd jdk

(Decompress the jdk-7u25-linux-x64.tar.gz file under the/usr/localdirectory to the current directory)

[Root @ cc jdk] # tar-xvfz/usr/local/jdk-7u25-linux-x64.tar.gz ./

(Modify the configuration of the profile file)

[Root @ cc jdk] # vi profile

Then add

Export JAVA_HOME =/usr/local/jdk/jdk1.7.0 _ 25

Export JRE_HOME =/usr/local/jdk/jdk1.7.0 _ 25/jre

Export PATH = $ PATH:/usr/local/jdk/jdk1.7.0 _ 25/bin

Export CLASSPATH =./:/usr/local/jdk/jdk1.7.0 _ 25/lib:/usr/local/jdk/jdk1.7.0 _ 25/jre/lib

 

/* How to Use vi editing

Press esc: wq! Save and exit

: Q! Do not save and exit

O insert in the next row of the current row

Insert at current ss position

*/

Save and exit and run java-version to check whether jdk is correctly installed.

So far, jdk installation is complete.

 

II,InstallTomcat

Create a tamcat folder under/usr/local.

Unzip tomcat.

Start tomcat command./startup. sh

Disable tomcat command./shutdown. sh

 

III,InstallMysql

ViewMysqlInstalled?

Rpm-qa | grep mysql

If not, run the following command to installMysql

Yum search mysql

 

Start after installationMysql

Service mysql start

 

CloseMysql

Service mysql stop

 

So farMysqlYou can install and run it.

 

EnterMysqlRun

MysqlCommand

 

IfMysqlAdministrator andRootPassword

UseMysql-u root-p

Enter the password.MysqlNow

 

Now the environment has been set up.

 

SetJavawebPackageWarPackage and put it inTomcatOfWebappRestart under directoryTomcatYou can access the site.

 

 

/* Tips

Garbled web pages

It may be that the character encoding of the database is different from the webpage encoding.

View database codeShow variables like 'Char % ';

 

Set the database encodingUtf8

Set character_set_client = utf8;

 

 

These are all setUtf8

 

 

*/

Bingo ~~

 

Connect to the database:

Jdbc: mysql: /// localhost: 3306/bus? UseUnicode = true & characterEncoding = UTF-8

 

 

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.