Javaweb Environment construction under Linux

Source: Internet
Author: User
Tags filezilla

Step: 1, using remote Tools to connect to the server, for examplexsheel (SSH),FileZilla (FTP)2,JDKinstallation and related configuration3,Mysqlinstallation and related configuration4,Tomcatinstallation and related configuration5, project deployment and startup

Detailed steps: 1, remote connection:

A) Xsheel connection: Similar to the General SSH Connection tool, enter the server IP and user name password and so on.

b) Ssh connection: I use the FileZillaHere, we can also use 8uftp, all of them are similar.

Note: This remote tool can be selected according to their own preferences, are similar.

Attached: If connection is encountered when the connection is not connected, restart the service before connecting, pay attention to the firewall.

Ssh Service restart:serviceSSD restart

FTP Service restart:servicevsftpd Restart

If the connection is not connected can be prompted to view the configuration file, for example, I had a lot of time with these remote tools, wasting a lot of effort, such as ssh restrict the root user remote connection, FTP - specific local user connections and so on, these can be modified by modifying the configuration file, but in general there is no problem with these services.

Ssh config file path:/etc/ssh/ssh_config

FTP configuration file path:vi/etc/vsftpd/vsftpd.conf

2. JDKinstallation and related configuration

A) Download a jdkonline, such as jdk-7u45-linux-x64.tar.gz;

b) Use the "tar-zxvf file name" command to extract, for example, I want to install in the /hezw/usr directory,
Then directly copy the above jdk files to the /hezw/usr directory to extract,
Note: If the jdk does not have permission to execute, use "chmod +x file name" to add permissions;

c) Add the following configuration at the end of the /etc/profile file:
Java_home=/hezw/usr/jdk1.7.0_45
Path=.: $JAVA _home/bin: $PATH
Export Java_home PATH

d) Implement "Source/etc/profile" to make the configuration effective;

E) Finally execute the Java javac command Test!

3. Mysqlinstallation and related configuration

A) Download a MySQL rpm package online and install it via yum ;

b) command line input yum-y install MySQL mysql-server;

c) Start MySQL after installation:service mysqld start;

D) just installed is no password, so you can first set a password, such as password

Set as eetrust to enter command:/usr/bin/mysqladmin-u root password "eetrust"

e)   then Mysql to this basic installation is done, of course, others are now not remote access, so we can open remote access, This is enabled by authorization: grant all privileges on *.* to   ' root ' @ '% '  IDENTIFIED BY  ' eetrust '  with grant option FLUSH PRIVILEGES  mysql If someone else cannot access it remotely. service, check if the firewall is off.

Attached: After login with root account, add lower_case_table_names=1 after [mysqld] in/ETC/MY.CNF , restart MYSQL service, this has been set successfully: The case of the table name is not distinguished

4. Tomcatinstallation and related configuration

Tomcat Installation:

Download the tar package and unzip it directly to the official website .

Tomcat related operations:

First, go to the bin directory under Tomcat , for example:cd/usr/tomcat/bin

Start Tomcat:./startup.sh

Close Tomcat:./shutdown.sh

To see if Tomcat is closed:ps-ef|grep java, if more information indicates that it is not closed, otherwise it is closed.

If you want to kill Tomcatdirectly, you can use the kill command to kill the Tomcat process directly: For example, you can view it based on Whether Tomcat closes the command gets to the process IDandthen directly kill

Example:kill-9 12389

  

  Tomcat To View logs: tail-f catalina.out (catalina.out is located in the logs directory,tail means tail view, -F for dynamic viewing, or tail-100f catalina.out to dynamically view the last log )

5. Project deployment and start-up

For example , if you have a war package for a project, copy the War package directly to Tomcat 's webapps Directory, and then start the project.

Javaweb Environment construction under Linux

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.