Linux Ubuntu Deployment Web environment and project Tomcat+jdk+mysql

Source: Internet
Author: User
Tags chmod create database mysql import apache tomcat

1. Download file

Download a good tomcat, JDK, MySQL Linux compression package suffix named. tar.gz

and uploaded to the server via XFTP

or directly from the Linux command under the wget file.

For example:

wget http://apache.fayea.com/tomcat/tomcat-7/v7.0.77/bin/apache-tomcat-7.0.77-deployer.tar.gz

Ps: Later can be downloaded from the page when the link to get

2, unzip the file

Unzip the file to the specified directory

Command: TAR-ZXVF jdk-7u55-linux-x64.tar.gz-c/usr/java

3, JDK Configuration environment variables

Input: Vim/etc/profile into the editing interface and adds

Export java_home=/usr/java/jdk1.7.0_79

Export JRE_HOME=/USR/JAVA/JDK1.7.0_79/JRE

Exportclasspath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar: $JRE _home/lib

Export path= $PATH: $JAVA _home/bin

After completion input: Wq save exit

Input source/etc/profile make configuration effective

Enter Java-version View version

4,tomcat Configuration

Extract the tomcat files to a specified folder

You can change the port

Input: Vim/opt/tomcat/conf/server.xml

You can change the port and set the character encoding

Start Tomcat

Switch to the Tomcat/bin directory

Input./startup.sh

If you are prompted for permission issues, set permissions:

sudo chmod a+rwx-r logs chmod description (U: Same permissions as owner of file [a: Everyone];+: Add permission; rwx: Readable writable executable)-R: Recursively all directories and files

After the change is completed in the browser input: ip+ port appears Apache Tomcat indicates a successful start

5,mysql Configuration

Unzip the MySQL file to/usr/local

Command: TAR-ZXVF mysql-5.6.21-linux-glibc2.5-x86_64.tar.gz-c/usr/local

Change file name MV mysql-5.6.21-linux-glibc2.5-x86_64 MySQL

Go to MySQL Directory

Get permission: Chown-r mysql:mysql.

Install MySQL:./scripts/mysql_install_db--user=mysql

Tip Installing MySQL system tables..../bin/mysqld:error while loading shared libraries:libaio.so.1:cannot open shared OB ject file:no such file or directory

Missing package

Input: sudo apt-get install libaio-dev download then you can reinstall the

Add boot up: CP support-files/mysql.server/etc/init.d/mysql

Start Mysql:service MySQL start or/etc/init.d/mysql start

To see if it started successfully: Ps-ef|grep MySQL

Set Password

Input:./bin/mysqladmin-u root password ' password '

Set the soft chain: Ln-s/usr/local/mysql/bin/mysql/usr/local/bin/mysql

Go to MySQL

Input: mysql-u root-p ' password '

Configuring the MySQL Environment

Input: Vim/etc/profile

Add at the end

Path=/usr/local/mysql/bin: $PATH
Export PATH

Input: Source/etc/profile make configuration effective

Re-enter: Mysql-u root-p

We can get into it.

Set remote connection Permissions

Input: Use MySQL; Go to MySQL

1, change the table method

Input: Update user set host= '% ' where user= ' root '; Set permissions

Note: This change permission causes the local login not to be on the set MySQL

Input: Flush privileges; Refresh

2, Authorization law

Input: Grant all privileges on * * to ' root ' @ '% ' identified by ' 123 '; The first ' root ' is the user name, the second '% ' is all IP can be accessed remotely, and the third ' 123 ' indicates that the user password is closed if it is not used frequently

Input: Flush privileges; Refresh

Then connect through the MySQL visual interface

6,mysql Import Script

Import Mode one by SQLyog

After you refresh, you can view the table

Import Method Two

Linux Command Import

Reference: http://www.cnblogs.com/sunxiaotao/p/4142798.html

Export. sql files to a Linux file via XFTF as

Go to MySQL

Mysql>create database newdb; If you already have a database, you don't have to set up

Mysql>use newdb;

Mysql>set names UTF8;

mysql>source/home/sq.sql;//assume that your SQL file is in the same directory as/home/sq.sql

Linux Ubuntu Deployment Web environment and project Tomcat+jdk+mysql

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.