Build Javaweb + mysql_MySQL in 64-bit Ubuntu

Source: Internet
Author: User
Build Javaweb + mysql Ubuntu with 64-bit Ubuntu

Today, we have set up a 64-bit ubuntu tomcat + java + mysql environment. The following is a summary:

1. download jdk

Address:

Http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-linux-x64.tar.gz? AuthParam = 1394967394_1531ce17d13be0962e25ec8fe3e45f1d

Installation:

Tar xvf decompress the downloaded jdk package.

Configure the environment variables in the/etc/profile File (note: run the vi command). (Note: assume that the directory after jdk decompression is/softsetupdir/jdk1.7.0 _ 51)

Put the following three lines at the end of the profile file and save them.

Export JAVA_HOME =/softsetupdir/jdk1.7.0 _ 51

Export PATH = $ PATH: $ JAVA_HOME/bin: $ JAVA_HOME/jre/bin

Export CLASSPATH = $ JAVA_HONE/lib; $ JAVA_HONE/jre/lib :.

To make these configurations take effect immediately, run the following command:

Source/etc/profile

Test:

At this point, you enter java in the command line, and the javac command should be ready. it also indicates that your jdk has been configured.

2. download tomcat

Address:

Http://mirrors.cnnic.cn/apache/tomcat/tomcat-8/v8.0.3/bin/apache-tomcat-8.0.3.tar.gz

Installation:

Rest assured that after tomcat is downloaded, decompress it and execute the script startup. sh in the decompressed bin directory to start the tomcat service.

Test:

Http: // IP: 8080

Check whether the browser can see the tomcat docs documentation. If yes, it means tomcat is ready.

3. follow mysql

Sudo apt-get install mysql-server

After installation, the mysql environment variables are configured.

Test:

Input:

Mysql-p

Enter password

If you can connect to mysql, it means mysql is ready.

Expansion: start and stop the mysql service

Service mysql stop

Service mysql start

Service mysql restart

4. configure the domain name

In the domain name center, add the domain name to the IP address of the machine

For example, you only need to modify xxx. xxx as your IP address, and advertise your domain name.

Host name (A) (up to 20 allowed) IP address TTL Operation Help

Www.uh316.com

Xxx. xxx 3600 modification-delete

5. in this case, you need to enter the domain name and add a port to access the index.htm under the webapps/rootof tomcat on the machine.

To solve this problem, we need to change the Http service port of tomcat to 80.

Cause: When the browser sends an http request, the default port is 80.

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.