Combat: Real server-side deployment JSP project experience summary and record (complete process from 0 to 10 suitable for server-side deployment 0 Novice experience)
Jsp+tomcat+mysql project deployment to a real server; server MySQL installation; Server JDK installation; Server Tomcat installation; Server SQL file management; Server JSP project and server MySQL connection;
The first step is to install JDK,JDK that should be installed first in all the software that needs to be installed.
How to install the JDK can refer to this article
我截取了可以参考的部分1. 装JDK ,我从本地右键复制一个jdk,然后到远程桌面的C盘下面,鼠标右键粘贴(我是直接在服务器端用浏览器下载的,要保证版本与你本地开发环境所使用版本号相同。如果不同,但本地实验过不会出bug,那也可以)安装即可,选项一般选默认就行2. 配置一下JAVA_HOME--》系统高级设置->环境变量->系统变量新建->变量名JAVA_HOME->变量值jdk目录且最后不带分号
-
The second step is to configure Tomcat, the general official website download is a zip package, extracted to the C-drive line. In the Tomcat bin directory, double-click Startup.bat to start the Tomcat service. Enter http://localhost:8080/
in the browser the first page of Tomcat indicates that Tomcat has started successfully. However, there are many times when Tomcat boot is required automatically. Here's a quick introduction to how to set up automatic boot on win server. Create a new system environment variable: catalina_home, the value is your Tomcat directory, finally open path, add variable value:%catalina_home%\bin; Then open cmd, drag the Service.bat in the Bin folder of the Tomcat directory into the small black box, enter, if the
Shows everything OK can proceed to the next step. If this is not the case, then the path to the installation tomcat is wrong or the environment variable is wrong, please check. After the cmd window type service.bat install Tomcat
or service.bat install
, and then press ENTER, a window similar to the following appears and then succeeds.
Last services->apache tomcat-> right-click, select Start, and then change the startup type to automatic in the properties
Then copy the project folder from your local Tomcat WebApp into the webapp of the Tomcat directory in the C drive under the remote Desktop.
The third step is to install MySQL, refer to my previous blog, if the net start mysql
path for the System32 folder in the CMD can not start the trial CD command to cut back to the Bin folder and try again, go a few more times on the pass.
As for the import of SQL files, you need to export from the local MySQL management tools (such as Navicat), and then save to the server and then use the MySQL management tools on the server (such as navicat, server-side MySQL management tools installed on their own, here do not repeat) import can
导入方法我简要描述一下(以管理工具为navicat为例)1. 先按照我上面给的博客在mysql中配置连接。然后在navicat中建立连接。连接名随意,我取名为localhost_3306,密码一栏取刚改的密码。这个时候不要着急点确定,点击“连接测试”,人品好的都不会报错。然后关闭对话框,在左侧导航栏双击已经建立的localhost_3306连接名可以看到他变绿了2. 这时右键点击这个绿名字选择新建数据库,数据库名称与你jsp项目中jdbc中传进去的数据库字符串名字相同,字符集因人而异,我选了GBK,点击确定3. 然后双击新建好的数据库使它变绿,接下来找到已经传到远程桌面中的.sql文件,拖到这个数据库里面。弹出的对话框中一般不改什么,就改一下编码,与之前的编码一样,如我的是GBK。4. 完成后关闭,数据库右键选择刷新,sql文件应已成功导入“表”中5. 至此数据库导入结束
Now in server-side browser input http://localhost:8080/xxx
If you can open your project normally, you should already be able to deploy the site from your native access server. If not, the server Tomcat is not yet started.
Problems encountered and how to solve them
-
Server-side Navicat connect to the database if you have changed the password according to my blog, it will error 1862.
Workaround type SET PASSWORD = PASSWORD (' root ') after logging into MySQL using mysql-h localhost-u root-p
;
, Change the password to root, this time navicat password to root can be logged in, if it is not the same as the password string in your JSP project is not the same, repeat this step, and then change the password to you want, and the project to connect to the database file the same password can be. Now it can be connected normally, just a small bug need not panic.
-
Server-side browser can localhost:8080/...
Access but the extranet cannot be resolved by ip:8080
access: Increase TCP8080 port
In the System Firewall inbound rule Select New rule, click Add Port----rules apply tcp-> Specify a local port of 8080- > Next, Next, give the port definition name: Web, described as 8080.
-
How to open ping
Windows Firewall, advanced settings, inbound rules, and then locate "File and Printer Sharing (Echo request-icmpv4-in)" In the list, right-click to select the Enable rule, And in its properties set to ' Allow connection ', OK. To disable ping, remove the checkmark.
-
When accessing the HTML format to find that they do not need to modify the source code
Encountered a small HTML problem, the kind of something to reduce content, you can directly in the server Remote Desktop Tomcat folder WebApp project files in the source with Notepad modified, Once you have finished modifying the Start.dat again, double-click Tomcat. The Tomcat black box that is already running does not have to close the
Spit slot: This kind of thing should be considered well in local development, for example, I encountered different browser Access server Web site HTML font resolution last night, this episode in the local development should be thought, and resolved.
============================= unrelated to the topic ===========================================
The website was officially launched yesterday evening 9:50
Remember it ~ ~
[Pretend there is a server desktop]– not be able to intercept, but I don't want to put it here.
Development period: 40 days
Core development: 21 days
Subjective time input: 200h
Late system operation: 6 months
Title: System administrator (self-styled)
===================================================================================
Reference Resources
Entry1-tomcat:http://jingyan.baidu.com/article/a65957f4b12b8724e77f9b5a.html
If Entry1 error is->entry2:http://blog.csdn.net/ruanqiangqiang/article/details/7414905
Entry2 Verification: http://www.cnblogs.com/qisel/p/3915262.html
Entry2 Verification: http://www.jb51.net/article/87456.htm
entry3-mysql:http://blog.csdn.net/s_gy_zetrov/article/details/55669018
entry4-mysql:error1862 https://segmentfault.com/q/1010000008150194
Entry5-8080:http://jingyan.baidu.com/article/ed15cb1b0e520a1be369810c.html
Entry6-ping:www.jb51.net/article/89163.htm
Finally, a little bit of broken up. Generally like the kind of things I have not dared to imagine now, I will have to know people everywhere to show off to blow their own strong that idea. But I always do not like to show off, even to show off, even the general record of life will not be widely told. Look at my friends circle, I know, I seldom send a circle of friends. I belong to this kind of say a point to do seven points left two minutes in a daze, corresponding to the saying "say three points do seven." My original evaluation is said to do six points left three points in a daze, and now finally made a point to add to their own points. Although now I have a strong urge to tell all my friends, but my philosophy of life forbids me to do so, the most, but also only in the blog to mention, after all, look at my blog is mostly strangers. So, although here say a few more words but I will take this paragraph to deal with, unless look carefully, otherwise cannot see. If you are watching this now and you know who I am, please don't advertise for me. The second thing I hate is that people say what I don't want to say and let others know. As for the first nuisance, here I don't say.
Jsp_ OPS _jsp Project deployed to server (for 0 novice experience)