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