-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
381 lines (246 loc) · 26.8 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" >
<title>Andy world</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="description">
<meta property="og:type" content="website">
<meta property="og:title" content="Andy world">
<meta property="og:url" content="http://zhangandyhui.github.io/index.html">
<meta property="og:site_name" content="Andy world">
<meta property="og:description">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Andy world">
<meta name="twitter:description">
<link rel="alternative" href="/atom.xml" title="Andy world" type="application/atom+xml">
<link rel="icon" href="/favicon.png">
<link rel="stylesheet" href="/css/style.css">
</head>
<body>
<div id="container">
<div class="left-col">
<div class="overlay"></div>
<div class="intrude-less">
<header id="header" class="inner">
<a href="/" class="profilepic">
<img lazy-src="https://avatars1.githubusercontent.com/u/10860119?v=3&s=460" class="js-avatar">
</a>
<hgroup>
<h1 class="header-author"><a href="/">zhangandyhui</a></h1>
</hgroup>
<div class="switch-btn">
<div class="icon">
<div class="icon-ctn">
<div class="icon-wrap icon-house" data-idx="0">
<div class="birdhouse"></div>
<div class="birdhouse_holes"></div>
</div>
<div class="icon-wrap icon-ribbon hide" data-idx="1">
<div class="ribbon"></div>
</div>
<div class="icon-wrap icon-me hide" data-idx="3">
<div class="user"></div>
<div class="shoulder"></div>
</div>
</div>
</div>
<div class="tips-box hide">
<div class="tips-arrow"></div>
<ul class="tips-inner">
<li>Menu</li>
<li>Tags</li>
<li>About</li>
</ul>
</div>
</div>
<div class="switch-area">
<div class="switch-wrap">
<section class="switch-part switch-part1">
<nav class="header-menu">
<ul>
<li><a href="/">主页</a></li>
<li><a href="/archives">所有文章</a></li>
<li><a href="/">关于我</a></li>
</ul>
</nav>
<nav class="header-nav">
<div class="social">
<a class="github" target="_blank" href="https://github.com/zhangandyhui/zhangandyhui.io" title="github">github</a>
<a class="weibo" target="_blank" href="#" title="weibo">weibo</a>
<a class="rss" target="_blank" href="#" title="rss">rss</a>
<a class="zhihu" target="_blank" href="#" title="zhihu">zhihu</a>
</div>
</nav>
</section>
<section class="switch-part switch-part2">
<div class="widget tagcloud" id="js-tagcloud">
<a href="/tags/hexo-主题/" style="font-size: 10px;">hexo 主题</a> <a href="/tags/tomcat/" style="font-size: 10px;">tomcat</a>
</div>
</section>
<section class="switch-part switch-part3">
<div id="js-aboutme">我是谁,我从哪里来,我到哪里去?我就是我,是颜色不一样的吃货…</div>
</section>
</div>
</div>
</header>
</div>
</div>
<div class="mid-col">
<nav id="mobile-nav">
<div class="overlay">
<div class="slider-trigger"></div>
<h1 class="header-author js-mobile-header hide">zhangandyhui</h1>
</div>
<div class="intrude-less">
<header id="header" class="inner">
<div class="profilepic">
<img lazy-src="https://avatars1.githubusercontent.com/u/10860119?v=3&s=460" class="js-avatar">
</div>
<hgroup>
<h1 class="header-author">zhangandyhui</h1>
</hgroup>
<nav class="header-menu">
<ul>
<li><a href="/">主页</a></li>
<li><a href="/archives">所有文章</a></li>
<li><a href="/">关于我</a></li>
<div class="clearfix"></div>
</ul>
</nav>
<nav class="header-nav">
<div class="social">
<a class="github" target="_blank" href="https://github.com/zhangandyhui/zhangandyhui.io" title="github">github</a>
<a class="weibo" target="_blank" href="#" title="weibo">weibo</a>
<a class="rss" target="_blank" href="#" title="rss">rss</a>
<a class="zhihu" target="_blank" href="#" title="zhihu">zhihu</a>
</div>
</nav>
</header>
</div>
</nav>
<div class="body-wrap">
<article id="post-Tomcat几种部署方式" class="article article-type-post" itemscope itemprop="blogPost">
<div class="article-meta">
<a href="/2016/08/25/Tomcat几种部署方式/" class="article-date">
<time datetime="2016-08-25T02:02:41.000Z" itemprop="datePublished">2016-08-25</time>
</a>
</div>
<div class="article-inner">
<input type="hidden" class="isFancy" />
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2016/08/25/Tomcat几种部署方式/">Tomcat几种部署方式</a>
</h1>
</header>
<div class="article-entry" itemprop="articleBody">
<h1 id="引言"><a href="#引言" class="headerlink" title="引言"></a>引言</h1><p>以前学习的时候只知道在Eclipse或者MyEclipse中发布项目到Tomcat,最近实习时发现不同的项目还有不同的发布方式,所以特地学习了Tomcat发布项目的方式,在此记录下来。</p>
<h2 id="1-直接将web项目文件件拷贝到webapps目录中"><a href="#1-直接将web项目文件件拷贝到webapps目录中" class="headerlink" title="1 直接将web项目文件件拷贝到webapps目录中"></a>1 直接将web项目文件件拷贝到webapps目录中</h2><p> 这是最常用的方式,Tomcat的Webapps目录是Tomcat默认的应用目录,当服务器启动时,会加载所有这个目录下的应用。如果你想要修改这个默认目录,可以在conf下的server.xml文件里修改Host标签里的appBase值。</p>
<p>  这个方法实际上和在IDE开发环境里部署项目是一样的。</p>
<p>  用此方法的访问路径为<a href="http://localhost:8080/webname" target="_blank" rel="external">http://localhost:8080/webname</a></p>
<h2 id="2-修改Server-xml文件"><a href="#2-修改Server-xml文件" class="headerlink" title="2 修改Server.xml文件"></a>2 修改Server.xml文件</h2><p> 在conf下的server.xml文件里找到Host标签,在里面添加如下代码:<br> <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><Context path=<span class="string">"/jfinal_demo"</span> docBase=<span class="string">"F:\work\jfinal_demo\WebRoot"</span> reloadable =<span class="string">"true"</span> debug=<span class="string">"0"</span> privileged=<span class="string">"true"</span>></span><br><span class="line"></Context></span><br></pre></td></tr></table></figure></p>
<p> path:是访问时的根地址,表示访问的路径,可以自定义,如上述例子中,访问该应用程序地址如下:<a href="http://localhost:8080/jfinal_demo" target="_blank" rel="external">http://localhost:8080/jfinal_demo</a>;</p>
<p>  docbase:表示应用程序的路径,docBase可以使用绝对路径,也可以使用相对路径,相对路径相对于webapps ;</p>
<p>  reloadable:表示可以在运行时在classes与lib文件夹下自动加载类包。这个属性在开发阶段通常都设为true,方便开发;在发布阶段应该设置为false,提高应用程序的访问速度 ;</p>
<p>  其他属性参见相关文档。</p>
<h2 id="3-在conf-Catalina-localhost-目录下添加xml配置文件"><a href="#3-在conf-Catalina-localhost-目录下添加xml配置文件" class="headerlink" title="3 在conf\Catalina\localhost 目录下添加xml配置文件"></a>3 在conf\Catalina\localhost 目录下添加xml配置文件</h2><p> 新建名为jfinal_demo.xml文件,文件内容配置如下:<br> <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><Context path=<span class="string">"/jfinal_demo"</span> docBase=<span class="string">"F:\work\jfinal_demo\WebRoot"</span> reloadable =<span class="string">"true"</span> debug=<span class="string">"0"</span> privileged=<span class="string">"true"</span>></span><br><span class="line"></Context></span><br></pre></td></tr></table></figure></p>
<p> Catalina\localhost目录tomcat下载下来默认是没有的,首次启动会自动创建,也可以手动创建;</p>
<p> 配置中可以去掉path属性,因为访问项目时的根路径只取决于XML文件的名称,如上述例子中,访问该应用程序地址如下:<br> <a href="http://localhost:8080/jfinal_demo" target="_blank" rel="external">http://localhost:8080/jfinal_demo</a> ;</p>
<h1 id="推荐使用第三种方式,因为不需要修改tomcat默认配置,对Tomcat的侵入性最小,并且如果想取消部署,直接删除xml配置文件即可。"><a href="#推荐使用第三种方式,因为不需要修改tomcat默认配置,对Tomcat的侵入性最小,并且如果想取消部署,直接删除xml配置文件即可。" class="headerlink" title="推荐使用第三种方式,因为不需要修改tomcat默认配置,对Tomcat的侵入性最小,并且如果想取消部署,直接删除xml配置文件即可。"></a>推荐使用第三种方式,因为不需要修改tomcat默认配置,对Tomcat的侵入性最小,并且如果想取消部署,直接删除xml配置文件即可。</h1>
</div>
<div class="article-info article-info-index">
<div class="article-tag tagcloud">
<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/tomcat/">tomcat</a></li></ul>
</div>
<div class="clearfix"></div>
</div>
</div>
</article>
<article id="post-hexo-install" class="article article-type-post" itemscope itemprop="blogPost">
<div class="article-meta">
<a href="/2016/06/21/hexo-install/" class="article-date">
<time datetime="2016-06-21T06:25:21.000Z" itemprop="datePublished">2016-06-21</time>
</a>
</div>
<div class="article-inner">
<input type="hidden" class="isFancy" />
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2016/06/21/hexo-install/">Hexo安装</a>
</h1>
</header>
<div class="article-entry" itemprop="articleBody">
<h1 id="引言"><a href="#引言" class="headerlink" title="引言"></a>引言</h1><p>本工作的根本目的是在Github上搭建一个个人博客。其优点是免费,而且可以学习Git。因此本人从今天开始打算将博客平台转移到Github上来。</p>
<p>Github上可以用来搭建博客的工具大概有三个:Hexo, Jekyll, octopress等。但是经过研究发现最好的方式还是采用Github + Hexo的方式,因此这里介绍的方法正是基于该方法。</p>
<h2 id="安装前准备条件"><a href="#安装前准备条件" class="headerlink" title="安装前准备条件"></a>安装前准备条件</h2><p> node github(若没有可自己注册)</p>
<h2 id="github建立仓库"><a href="#github建立仓库" class="headerlink" title="github建立仓库"></a>github建立仓库</h2><p> 登录后新建仓库,命名必须为username.github.io.注:Github Pages的Repository名字是特定的,比如我Github账号是zhangandyhui,那么我Github Pages Repository名字就是zhangandyhui.github.io<br> <img src="/2016/06/21/hexo-install/1.png" alt="logo"></p>
<h2 id="Hexo安装"><a href="#Hexo安装" class="headerlink" title="Hexo安装"></a>Hexo安装</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">$ npm install -g hexo-cli</span><br><span class="line">$ npm install hexo --save</span><br></pre></td></tr></table></figure>
<h2 id="部署Hexo(node-v6-0以上需要卸载hexo-generator-feed-否则编译报错"><a href="#部署Hexo(node-v6-0以上需要卸载hexo-generator-feed-否则编译报错" class="headerlink" title="部署Hexo(node v6.0以上需要卸载hexo-generator-feed,否则编译报错)"></a>部署Hexo(node v6.0以上需要卸载hexo-generator-feed,否则编译报错)</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">$ hexo init blog</span><br><span class="line">$ <span class="built_in">cd</span> blog</span><br><span class="line">$ npm install</span><br></pre></td></tr></table></figure>
<h3 id="hexo插件安装"><a href="#hexo插件安装" class="headerlink" title="hexo插件安装"></a>hexo插件安装</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">npm install hexo-generator-index --save</span><br><span class="line">npm install hexo-generator-archive --save</span><br><span class="line">npm install hexo-generator-category --save</span><br><span class="line">npm install hexo-generator-tag --save</span><br><span class="line">npm install hexo-server --save</span><br><span class="line">npm install hexo-deployer-git --save</span><br><span class="line">npm install hexo-deployer-heroku --save</span><br><span class="line">npm install hexo-deployer-rsync --save</span><br><span class="line">npm install hexo-deployer-openshift --save</span><br><span class="line">npm install hexo-renderer-marked --save</span><br><span class="line">npm install hexo-renderer-stylus --save</span><br><span class="line">npm install hexo-generator-sitemap --save</span><br></pre></td></tr></table></figure>
<h3 id="测试本地效果"><a href="#测试本地效果" class="headerlink" title="测试本地效果"></a>测试本地效果</h3><pre><code>hexo g,hexo s登录localhost:4000查看效果
</code></pre><h2 id="Hexo主题Yilia"><a href="#Hexo主题Yilia" class="headerlink" title="Hexo主题Yilia"></a>Hexo主题Yilia</h2><h3 id="1-安装"><a href="#1-安装" class="headerlink" title="1.安装"></a>1.安装</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ git <span class="built_in">clone</span> https://github.com/litten/hexo-theme-yilia.git themes/yilia</span><br></pre></td></tr></table></figure>
<h3 id="2-配置"><a href="#2-配置" class="headerlink" title="2.配置"></a>2.配置</h3><p>修改hexo根目录下的<strong>_config.yml</strong> :<code>theme:yilia</code></p>
<h3 id="3-更新"><a href="#3-更新" class="headerlink" title="3.更新"></a>3.更新</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ <span class="built_in">cd</span> themes/yilia && git pull</span><br></pre></td></tr></table></figure>
<h3 id="4-配置theme-yilia-config-xml"><a href="#4-配置theme-yilia-config-xml" class="headerlink" title="4.配置theme/yilia/_config.xml"></a>4.配置theme/yilia/_config.xml</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br></pre></td><td class="code"><pre><span class="line"># Header</span><br><span class="line">menu:</span><br><span class="line"> 主页: /</span><br><span class="line"> 所有文章: /archives</span><br><span class="line"> # 随笔: /tags/随笔</span><br><span class="line"># SubNav</span><br><span class="line">subnav:</span><br><span class="line"> github: "https://github.com/zhangandyhui/zhangandyhui.io"</span><br><span class="line"> weibo: "#"</span><br><span class="line"> rss: "#"</span><br><span class="line"> zhihu: "#"</span><br><span class="line">rss: /atom.xml</span><br><span class="line"># Content</span><br><span class="line">excerpt_link: more</span><br><span class="line">fancybox: true</span><br><span class="line">mathjax: true</span><br><span class="line"></span><br><span class="line"># 是否开启动画效果</span><br><span class="line">animate: true</span><br><span class="line"></span><br><span class="line"># 是否在新窗口打开链接</span><br><span class="line">open_in_new: false</span><br><span class="line"></span><br><span class="line"># Miscellaneous</span><br><span class="line">google_analytics: ''</span><br><span class="line">favicon: /favicon.png</span><br><span class="line"></span><br><span class="line">#你的头像url</span><br><span class="line">avatar: "https://avatars1.githubusercontent.com/u/10860119?v=3&s=460"</span><br></pre></td></tr></table></figure>
<h2 id="插件"><a href="#插件" class="headerlink" title="插件"></a>插件</h2><p>图片插件<br> 安装 npm install <a href="https://github.com/CodeFalling/hexo-asset-image" target="_blank" rel="external">https://github.com/CodeFalling/hexo-asset-image</a> –save<br> 配置:blog根目录下<code>_config.yml</code>中<strong><code>post_asset_folder:true</code></strong><br> 使用如: <code>![logo](hexo-install/1.png)</code><br> 项目结构:<img src="/2016/06/21/hexo-install/2.png" alt="logo"></p>
<h2 id="部署"><a href="#部署" class="headerlink" title="部署"></a>部署</h2><p>修改blog根目录下的<code>_config.yml</code>文件<br> <img src="/2016/06/21/hexo-install/3.png" alt="logo"> </p>
</div>
<div class="article-info article-info-index">
<div class="article-tag tagcloud">
<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/hexo-主题/">hexo 主题</a></li></ul>
</div>
<div class="clearfix"></div>
</div>
</div>
</article>
</div>
<footer id="footer">
<div class="outer">
<div id="footer-info">
<div class="footer-left">
© 2016 zhangandyhui
</div>
<div class="footer-right">
<a href="http://hexo.io/" target="_blank">Hexo</a> Theme <a href="https://github.com/litten/hexo-theme-yilia" target="_blank">Yilia</a> by Litten
</div>
</div>
</div>
</footer>
</div>
<link rel="stylesheet" href="/fancybox/jquery.fancybox.css">
<script>
var yiliaConfig = {
fancybox: true,
mathjax: true,
animate: true,
isHome: true,
isPost: false,
isArchive: false,
isTag: false,
isCategory: false,
open_in_new: false
}
</script>
<script src="http://7.url.cn/edu/jslib/comb/require-2.1.6,jquery-1.9.1.min.js"></script>
<script src="/js/main.js"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {
inlineMath: [ ['$','$'], ["\\(","\\)"] ],
processEscapes: true,
skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
}
});
MathJax.Hub.Queue(function() {
var all = MathJax.Hub.getAllJax(), i;
for(i=0; i < all.length; i += 1) {
all[i].SourceElement().parentNode.className += ' has-jax';
}
});
</script>
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
</div>
</body>
</html>