Tomcat, Nginx, MySQL

Source: Internet
Author: User
Tags file url

"description" the morning on the server deployed its own web directory (Tomcat virtual directory), the afternoon installed and learned Nginx (a bit of a problem, later resolved), the evening to try Nginx and Tomcat configuration (confused)

One: Completed today

1) Configure the Tomcat virtual directory

2) Deploy RESTful projects

3) Download and install Nginx

4) Configure the default.conf under Nginx

Second: Tomorrow's plan

1) Complete configuration nginx, use subdomain access

2) Complete the view Nginx log, write the statistics of the number of visits, statistical response delay

Three: Difficult problems

1) What is the internal request forwarding process for Nginx and Tomcat?

2) What is load-balanced distributed deployment?

Four: Thinking Summary

The operation under Linux is always not very handy, more familiar with

There are many limitations to using mybatis alone (such as the inability to implement transactions that span multiple sessions), and many business systems are used to manage transactions using spring, so mybatis is best integrated with spring.

Flush Privileges

Grant all on * * to ' alin ' @ '% ' identified by ' 698970s ' with GRANT OPTION;

GRANT all privileges on * * to ' root ' @ '% ' identified by ' 698970s ' with GRANT OPTION;

GRANT All privileges on * * to ' root ' @ ' 192.168.31.250 ' identified by ' 698970s ' with GRANT OPTION;

The former is the MySQL core program, generates the management database instance, the database instance Task Scheduler thread and so on, and provides the related interface for different client calls, which is the tool to manipulate the database instance

There are many clients operating MySQL instances, mysql-client just one of them, including Mysql,mysqldump,mysqlslap, these access, backup, stress testing tools

Mysql-server is the service side, that is, you do not install the server, the client has no object to operate, like, you bought a watermelon knife, but did not buy watermelon .... Cut watermelon There are many tools, watermelon knife is just one of

Introducing several mainstream MySQL graphical clients, navicat,phpmyadmin


install-info:no dir file specified; Try--help for more information.dpkg: Error processing GetText (--configure): Child process post-installation Script returned error number 1 error occurred while processing: Br>e:sub-process/usr/bin/dpkg returned an error code (1)

1.$ sudo mv/var/lib/dpkg/info/var/lib/dpkg/ Info_old//The Info folder is now renamed
2.$ sudo mkdir/ Var/lib/dpkg/info//re-create a new info folder
3.$ sudo apt-get update,

4.$ sudo mv/var/lib/ dpkg/info/*/var/lib/dpkg/info_old//After performing the previous action, some files are generated under the new Info folder and are now moved to the Info_old folder under
5.$ sudo rm-rf/var/lib/dpkg/info//delete your new info folder by deleting
6.$ sudo mv/var/lib/dpkg/info_old/var/lib/dpkg/info//Change the previous Info folder back to the first name

 an explanation of Ubuntu open MySQL remote 3306 port

1. First check if the port is open Netstat-an|grep 3306

The 3306 Port shows: 127.0.0.1 represents the Local

2. Open MySQL config file sudo vim/etc/mysql/mysql.conf.d/mysqld.cnf

Log Off bind-address = 127.0.0.1?

---------------------------------------------

first, static deployment
1. Copy the Web project files directly into the WebApps directory
Tomcat's WebApps directory is the default app directory for Tomcat and will load all applications in this directory when the server is started. So the JSP program can be packaged into a war package placed in the directory, the server will automatically solve the war package,
and create a folder with the same name in this directory. A war package is a jar package with an attribute format that compresses all the contents of a Web program. Specifically how to package, you can use the IDE environment of many development tools, such as Eclipse.
You can also use the cmd command: JAR-CVF mywar.war myweb
WebApps This default application directory can also be changed. Open the Server.xml file under Tomcat's Conf directory to find the following:

unpackwars= "true" autodeploy= "true"
xmlvalidation= "false" Xmlnamespaceaware= "false" >
the appbase can be modified.
2. Specify in Server.xml
In the Tomcat configuration file, a Web application is a specific context that can be deployed by deploying a JSP application in a new context in Server.xml. Open the Server.xml file and create a context within the host tag, as follows.

In the conf directory in Tomcat, add the,
<context path= "/hello" docbase= "d:\ workspace\hello\webroot" debug= "0" privileged= "true" >
</Context>
or
<context path= "/myapp" reloadable= "true" docbase= "D:\myapp" workdir= "D:\myapp\work"/>
or
<context path= "/sms4" docbase= "D:\workspace\sms4\WebRoot"/>

Description:
Path is a virtual path;
DocBase is the physical path of the application;
Workdir is the working directory of the application that stores the files generated by the runtime associated with this application;

Debug is set to debug level, 0 means to provide the least information, 9 to provide the most information
privileged is set to true to allow Tomcat Web apps to use the servlet within the container
reloadable If True, Tomcat automatically detects changes in the application's/web-inf/lib and/web-inf/classes directories, automatically mounts new applications, and can change applications without having to restart Tomcat. Implementing a hot Deployment
antiresourcelocking and Antijarlocking thermal deployments are parameters that need to be configured, false by default to avoid updating a webapp, and sometimes Tomcat does not remove the old webapp completely, usually leaving web-inf/ A jar package under Lib,
you must turn off Tomcat to delete, which causes automatic deployment to fail. Set to True,tomcat when the corresponding WebApp is run, the corresponding source files and jar files are copied to a temporary directory.
3. Create a context file
In the conf directory, create a new Catalina\localhost directory, create a new XML file in the directory, the name can not be arbitrarily taken, and the name after the path is the same, according to the configuration of the path below, The XML name should be Hello (hello.xml), the content of the XML file is:
<context path= "/hello" docbase= "E:\workspace\hello\WebRoot" debug= "0" privileged= "true" ></Context>

examples of Tomcat comes in as follows:
<context docbase= "${catalina.home}/server/webapps/host-manager"
privileged= "true" antiresourcelocking= "false" antijarlocking= "false" >
</Context>
This example is Tomcat's own, and the edited content is actually the same as the second, where the XML file name is the access path, which hides the app's real name.
4. Note:
Deleting a web app also deletes the corresponding context in the corresponding folder and Server.xml under WebApps, and also deletes the corresponding XML file in the Tomcat Conf\catalina\localhost directory. Otherwise Tomcat will still go to configure and load ...
two dynamic deployment
Login to the Tomcat Management console: http://localhost:8080/, enter your username and password to manage your app and publish it dynamically.
in context Path (option): Enter/yourwebname, which represents the access address of your app.
XML configration in the file URL to specify an XML file, such as we create a hmcx.xml file under F:\, the content is as follows: <context reloadable= "false"/> where docbase No need to write, because the next text box is filled in. Or a little bit simpler,
This text box does not fill anything, in the war or Directory URL: Type F:\HMCX, and then click on the Deploy button, you can see the Web application, the name of the context Path (option): The name of the.

If there is a simpler way to deploy the. War file, here's a select War file uploae Click Browse to select the. war files, and then click Deploy.

Tomcat, Nginx, 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.