发表于: 2016-09-27 10:43:12
1 2286
一、今天完成
1.虚拟机安装ubuntu桌面版,主机安装xshell,虚拟机apt-get安装openjdk8、mysql,主机用Xshell通过SSH给虚拟机传送了jetty,war包拷入,jettty配置启动,主机postman访问成功。
二、明天计划
1.完成task3的nagix转发步骤,进入task4。
2.学习github、svn托管代码。
三、遇到问题
1.web.xml中,按照《spring技术内幕》的说法,需要设置listener监听
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring/ApplicationContext5-servlet.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
2.初次使用xshell的时候遇到了两个问题:
1)虚拟机网络是桥接,Xshell连接不上,首先在虚拟机可视化界面固定了一个生僻ip:192.168.1.222防止IP冲突,重新连接了下网络,然后在虚拟机上安装了openssh-server。
2)访问需要帐密,在虚拟机上用adduser xxx 新建了一个,然后Xshell可以终端形式访问虚拟机,然后windows的客户端切到/tmp目录,用rz选择上传jetty,成功接收。
启动jetty方法:到bin目录下运行 ./jetty.sh
3.启动jetty后,主机网页访问404报错
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 404 </title>
</head>
<body>
<h2>HTTP ERROR: 404</h2>
<p>Problem accessing /find/18725966666. Reason:
<pre> Not Found</pre>
</p>
<hr />
<a href="http://eclipse.org/jetty">Powered by Jetty:// 9.3.12.v20160915</a>
<hr/>
</body>
</html>
思考后应该是:
1)之前程序中,JDBC连接位置仍是192.168.1.254的远程地址,重新打war包
2)数据库还没从旧的Windows虚拟机中拷贝过来,相关指令:
Windows拷贝库生成文件
mysqldump -u xxx -p xxx odetrainclass >c:\mysql\db.sql
ubuntu中创建库
create database codetrainclass;
复制到新库
use codetrainclass;
set names utf8;
source /tmp/db.sql;
新库用户创建
CREATE USER 'admin'@'localhost' IDENTIFIED BY 'admin';
新库用户授权
grant all privileges on codetrainclass.* to 'admin'@'localhost';
四、收获
1.今天收获不大。
评论