Ubuntu Server builds Java Web server

Source: Internet
Author: User

1, install SSH in Ubuntu Server, if purchase server, this is already installed, including vim

Get Super Permissions

Update the installation package first

Start installing SSH

SSH has started.


2. Install the Xshell and create the connection
Installing Xshell

Establish a connection

Click OK


3. Xshell implement Windows upload/download files to Ubuntu
3.1 Uploading files
Get Super Permissions

Installing the Rz/sz tool

Cut to the appropriate directory, in the input RZ

3.2 Downloading files
Cut into the appropriate folder, enter the SZ file name

4. Install MySQL with root permission, you need to install the following three
1. Apt-get Install Mysql-server
2. Apt-get Install Mysql-client
3. Apt-get Install Libmysqlclient-dev
The test login MySQL database can be done by the following command:
Mysql-u root-p

-U represents the user name,-p indicates the user password

5. Installing the JDK
Upload files, I was put in/usr/local/

Unzip the file

Delete original file

Modify folder name

Set the variable file
Open/etc/profile with Vim

Write

Java_home=/usr/local/jdk
Path= $JAVA _home/bin: $PATH:.
Classpath= $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar:.
Export Java_home
Export PATH
Export CLASSPATH
Using Vim to write a method, about the use of Vim more detailed tutorial, you can self-Baidu
Insert key insertion; ESC enters command environment, enter semicolon ":", enter Wq to save and exit


Make it effective

See if the JDK is configured successfully

6. Install Tomcat, I put it in/usr/local/
Uploading files

Unzip the file

Delete original file

Modify folder name

Set the variable file
Open/etc/profile with Vim

Write

Using Vim to write a method
Insert key insertion; ESC enters command environment, enter semicolon ":", enter Wq to save and exit


Make it effective

Start Tomcat

Look at the log

Startup success

7. Deploy the site
Upload the file, remember it is under Tomcat under the WebApps directory

Install the zip-decompression software

Extract files, Unzip compressed package

8. Set the Web site file path so that it can have a default path

<context path= "" docbase= "/usr/local/tomcat/webapps/fristweb" debug= "0" reloadable= "true"/>


Turn Tomcat off and turn it on

9, install phpMyAdmin, there are many friends may not know why I want to install phpMyAdmin, I want to better operate the MySQL database, after the installation of phpMyAdmin, I can on the Web site to operate the database, which greatly facilitates our debugging
Installing Apache2

Modify the Apache port because the default port is 80, which occupies the site port

Just change a 8022.

Launch Apache

Installing phpMyAdmin

Association

In the browser input http://localhost:8022/phpmyadmin/, you can see our MySQL data, I this is the local server, you have to according to your IP

10, other configuration, you will find Tomcat boot very slow, the following methods can speed up the start of Tomcat
In the tomcat/bin/catalina.sh file, added at the beginning of the code, you can use Vim to write:

Export Java_home= "/USR/LOCAL/JDK"
Export Jre_home= "/usr/local/jdk/jre"
Export catalina_opts= "-djava.security.egd=file:/dev/./urandom"

Ubuntu Server builds Java Web server

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.