Linux environment (JDK 7 + Tomcat 7 + MySQL5.5) _ MySQL

Source: Internet
Author: User
Tags tar extract
Linux (JDK 7 + Tomcat 7 + MySQL5.5) deployment environment Tomcat 7 Tomcat

JDK 0: Download JDK http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html 1: Uninstall (root user) 1.0: query installed jdk # rpm-qa | grep jdk *** # rpm-qa | grep java *** 1.1: remove by name (-e indicates deletion,-nodeps indicates forced deletion to prevent association between JDK and program, resulting in deletion failure !) # Rpm-e-nodeps *** 1.2: run java-version again. if the prompt-bash: java-version: command not found is displayed, the following scheme does not need to be continued. jdk is deleted successfully. 1.3: manually delete folders (-f indicates deleting the entire folder and sub-directories) # rm-f/usr/bin/java # rm-f/usr/bin/javac # rm-f/etc/alternatives/java # rm-f/etc/alternatives/javac 2: installation (root user) 2.1: add operation permissions to each user # chomd + x jdk _*. *. *. rpm 2.2: install JDK # rpm-ivh jdk _*. *. *. rpm 2.3: modify the following configuration file | -- # cd/switch to the root directory | -- # cd ect configuration file directory | -- # vi. /profile modify the/etc/profile File (all users in the world) | -- # Open the profile and press I to enter the editing mode. add the following content at the end: # set java environment export JAVA_HOME =/usr/share/ Jdk1.7.0 _ 60 export PATH = $ JAVA_HOME/bin: $ PATH export CLASSPATH =.: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar | -- # Press catl + c to enter the Normall mode. input # wq to save and close | -- # find-name. bash_profile: locate bash_profile. /skel /. bash_profile | -- # vi. /skel /. bash_profile. modify. bash_profile file (which allows a user to use these environment variables) | -- # After opening the profile, press I to enter the editing mode, and add the following at the end: export JAVA_HOME =/usr/java/jdk1.7.0 _ 60 # first check whether your jdk is also in this directory. export PATH = $ JAVA_HOME/bin: $ PATH ex Port CLASSPATH =.: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar | -- # Press catl + c to enter Normall mode. input # wq to save and close | -- # source/etc/profile takes effect after execution 2.4: Test [root @ localhost ~] # Vim Hello. java public class Hello {public static void main (String [] args) {System. out. println ("hello World") ;}} [root @ localhost ~] # Javac Hello. java [root @ localhost ~] # Java Hello World 3: More details http://www.2cto.com/os/201211/171035.html------------------------------------------------------------------------------------------------------------------Tomcat 0 :: http://tomcat.apache.org/download-70.cgi 1: unzip tomcat # unzip xxx.zip # zip unzip # tar-zxvf xxx.tar. gx # tar extract 2: move tomcat to/usr/java/tomcat [version]; (recommended) # mv-rf tomcat_x.x.x/usr/java/tomcat [version] 3: configure tomcat environment (optional) # vim/etc/profile = # add the following configuration to the end: export TOMCAT_HOME =/usr/java/tomcat7/bin export CATALINA_HOME =/usr/java/tomcat7 # its purpose: it can be executed in any directory. /shutdown. sh OR. /startup. sh 4: Test access: http://localhost:8080 5: then you can package the web project into a zip file and upload the project to the server through pscp xx user @ ip: // xx in the cmd window. Then decompress the package on the server and restart tomcat to run the package: http://blog.sina.com.cn/s/blog_866c5a5d0101cn1l.html------------------------------------------------------------------------------------------------------------------MySql 0: Download website: http://dev.mysql.com/downloads/mysql/5.1.html 1: install server [root @ localhost ~] # Rpm-ivh xxx. emp; 2: install client [root @ localhost ~] # Rpm-ivh xxx. emp; 3: MySql important directory | -- Database Directory [root @ localhost ~] #/Var/lib/mysql | -- configuration file [root @ localhost ~] #/Usr/share/mysql (mysql. server and configuration file) | -- related command [root @ localhost ~] #/Usr/bin/(mysqladmin | mysqldump) | -- start the script [root @ localhost ~] #/Etc/rc. d/init. d (Directory of the mysql startup script file) 4: start mysql [root @ localhost ~] #/Etc/init. d/mysql start 5: check the port number in use (if 3306 is enabled successfully) [root @ localhost ~] # Netstat-nat Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 127.0.0.1: 2208 0.0.0.0: * LISTEN tcp 0 0 0.0.0.0: 776 0.0.0.0: * LISTEN tcp 0 0 0.0.0.0: 3306 0.0.0.0: * LISTEN tcp 0 0 0.0.0.0: 111 0.0.0.0: * LISTEN 6: After the password is set, mysql has a default user root, no password. [Root @ localhost ~] #/Usr/bin/mysqladmin/-u root-p password 123456 7: log on to mysql [root @ localhost ~] # Mysql-u root-p 123456 8: Query Database show databases 9: query table use test show tables 10: stop mysql [root @ localhost ~] #/Usr/bin/mysqladmin-u root-p shutdown 11: Common Cause 11.1: mysql 13: 07 after linuxe is started, mysql of linuxe cannot be connected in windows. error: 1130-host... is not allowed to connect to this MySql server open mysql remote connection without using localhost solution http://www.cnblogs.com/xyzdw/archive/2011/08/11/2135227.html Grant all privileges on *. * TO 'username '@' % 'identified by 'password' with grant option; flush privileges; 12: for details, refer: http://www.t086.com/article/638------------------------------------------------------------------------------------------------------------------

During our study, we will all encounter many strange problems, but such a strange problem is a valuable experience for us to improve. Therefore, do not worry too much or blame yourself. Patiently calm down and solve the problem.

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.