-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploying3.html
More file actions
973 lines (430 loc) · 27.6 KB
/
deploying3.html
File metadata and controls
973 lines (430 loc) · 27.6 KB
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
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
<!DOCTYPE HTML>
<html lang="" >
<head>
<meta charset="UTF-8">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>源码部署 · GitBook</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="description" content="">
<meta name="generator" content="GitBook 3.2.3">
<link rel="stylesheet" href="gitbook/style.css">
<link rel="stylesheet" href="gitbook/gitbook-plugin-highlight/website.css">
<link rel="stylesheet" href="gitbook/gitbook-plugin-search/search.css">
<link rel="stylesheet" href="gitbook/gitbook-plugin-fontsettings/website.css">
<meta name="HandheldFriendly" content="true"/>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
<link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">
<link rel="next" href="install.html" />
<link rel="prev" href="deploying2.html" />
</head>
<body>
<div class="book">
<div class="book-summary">
<div id="book-search-input" role="search">
<input type="text" placeholder="Type to search" />
</div>
<nav role="navigation">
<ul class="summary">
<li class="header">第一节 MRCMS介绍</li>
<li class="chapter " data-level="1.1" data-path="./">
<a href="./">
MRCMS 简介
</a>
</li>
<li class="chapter " data-level="1.2" data-path="features.html">
<a href="features.html">
MRCMS 特性
</a>
</li>
<li class="chapter " data-level="1.3" data-path="images.html">
<a href="images.html">
MRCMS 界面
</a>
</li>
<li class="chapter " data-level="1.4" data-path="history.html">
<a href="history.html">
MRCMS 历史
</a>
</li>
<li class="header">第二节 MRCMS安装</li>
<li class="chapter " data-level="2.1" data-path="deploying1.html">
<a href="deploying1.html">
快速体验
</a>
</li>
<li class="chapter " data-level="2.2" data-path="deploying2.html">
<a href="deploying2.html">
发布文件部署
</a>
</li>
<li class="chapter active" data-level="2.3" data-path="deploying3.html">
<a href="deploying3.html">
源码部署
</a>
</li>
<li class="chapter " data-level="2.4" data-path="install.html">
<a href="install.html">
安装步骤
</a>
</li>
<li class="header">第三节 网站模板开发</li>
<li class="chapter " data-level="3.1" data-path="templatedev1.html">
<a href="templatedev1.html">
模板开发目录结构
</a>
</li>
<li class="chapter " data-level="3.2" data-path="globalVariable.html">
<a href="globalVariable.html">
系统内置变量
</a>
</li>
<li class="chapter " data-level="3.3" >
<span>
数据内容模型
</span>
<ul class="articles">
<li class="chapter " data-level="3.3.1" data-path="article.html">
<a href="article.html">
文章内容模型
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="3.4" data-path="taglibs.html">
<a href="taglibs.html">
系统内置标签
</a>
<ul class="articles">
<li class="chapter " data-level="3.4.1" data-path="taglib01.html">
<a href="taglib01.html">
URL绝对路径标签
</a>
</li>
<li class="chapter " data-level="3.4.2" data-path="taglib02.html">
<a href="taglib02.html">
子栏目遍历标签
</a>
</li>
<li class="chapter " data-level="3.4.3" data-path="taglib03.html">
<a href="taglib03.html">
执行时间标签
</a>
</li>
<li class="chapter " data-level="3.4.4" data-path="taglib04.html">
<a href="taglib04.html">
时间格式化标签
</a>
</li>
<li class="chapter " data-level="3.4.5" data-path="taglib05.html">
<a href="taglib05.html">
条件判断标签
</a>
</li>
<li class="chapter " data-level="3.4.6" data-path="taglib06.html">
<a href="taglib06.html">
遍历集合标签
</a>
</li>
<li class="chapter " data-level="3.4.7" data-path="taglib07.html">
<a href="taglib07.html">
遍历栏目下的内容标签
</a>
</li>
<li class="chapter " data-level="3.4.8" data-path="taglib08.html">
<a href="taglib08.html">
插件调用标签
</a>
</li>
<li class="chapter " data-level="3.4.9" data-path="taglib09.html">
<a href="taglib09.html">
在线人数标签
</a>
</li>
<li class="chapter " data-level="3.4.10" data-path="taglib10.html">
<a href="taglib10.html">
执行SQL标签
</a>
</li>
<li class="chapter " data-level="3.4.11" data-path="taglib11.html">
<a href="taglib11.html">
字符串截取标签
</a>
</li>
<li class="chapter " data-level="3.4.12" data-path="taglib12.html">
<a href="taglib12.html">
URL重写标签
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="3.5" data-path="taglibh.html">
<a href="taglibh.html">
高级指令
</a>
<ul class="articles">
<li class="chapter " data-level="3.5.1" data-path="taglibh01.html">
<a href="taglibh01.html">
@Nav
</a>
</li>
<li class="chapter " data-level="3.5.2" data-path="taglibh02.html">
<a href="taglibh02.html">
@NavChild
</a>
</li>
<li class="chapter " data-level="3.5.3" data-path="taglibh03.html">
<a href="taglibh03.html">
@Boostrap3Nav
</a>
</li>
<li class="chapter " data-level="3.5.4" data-path="index2.html">
<a href="index2.html">
@JSONPaserDirective
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="3.6" data-path="extends.md">
<span>
扩展支持
</a>
<ul class="articles">
<li class="chapter " data-level="3.6.1" data-path="ext/extpage.html">
<a href="ext/extpage.html">
栏目分页查询数据
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="3.7" data-path="intenational.html">
<a href="intenational.html">
网站国际化
</a>
<ul class="articles">
<li class="chapter " data-level="3.7.1" data-path="intenational01.html">
<a href="intenational01.html">
国际化语言数据
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="3.8" data-path="index2.html">
<a href="index2.html">
模板优化
</a>
<ul class="articles">
<li class="chapter " data-level="3.8.1" data-path="seo.html">
<a href="seo.html">
SEO 关键字优化
</a>
</li>
<li class="chapter " data-level="3.8.2" data-path="static.html">
<a href="static.html">
页面静态化
</a>
</li>
<li class="chapter " data-level="3.8.3" data-path="gzip.html">
<a href="gzip.html">
Gzip代码压缩
</a>
</li>
</ul>
</li>
<li class="header">第四节 URL重写规则</li>
<li class="chapter " data-level="4.1" data-path="rules.html">
<a href="rules.html">
规则引擎介绍
</a>
</li>
<li class="header">第四节 插件</li>
<li class="chapter " data-level="5.1" data-path="index2.html">
<a href="index2.html">
留言插件模块
</a>
</li>
<li class="header">第四节 高级部署</li>
<li class="chapter " data-level="6.1" data-path="nginx.html">
<a href="nginx.html">
Nginx配置
</a>
</li>
<li class="chapter " data-level="6.2" data-path="index2.html">
<a href="index2.html">
Redis做Session存储
</a>
</li>
<li class="chapter " data-level="6.3" data-path="index2.html">
<a href="index2.html">
Docker部署
</a>
</li>
<li class="header">文档贡献者</li>
<li class="chapter " data-level="7.1" data-path="marker.html">
<a href="marker.html">
marker
</a>
</li>
<li class="divider"></li>
<li>
<a href="https://www.gitbook.com" target="blank" class="gitbook-link">
Published with GitBook
</a>
</li>
</ul>
</nav>
</div>
<div class="book-body">
<div class="body-inner">
<div class="book-header" role="navigation">
<!-- Title -->
<h1>
<i class="fa fa-circle-o-notch fa-spin"></i>
<a href="." >源码部署</a>
</h1>
</div>
<div class="page-wrapper" tabindex="-1" role="main">
<div class="page-inner">
<div id="book-search-results">
<div class="search-noresults">
<section class="normal markdown-section">
<h1 id="源码部署">源码部署</h1>
<blockquote>
<p> 本节将带领大家源码方式部署MRCMS系统, 适合专业的开发人员操作。</p>
</blockquote>
<p>从github下载最新版本编译好的zip包</p>
<p><a href="https://github.com/wuweiit/mushroom/releases" target="_blank">https://github.com/wuweiit/mushroom/releases</a></p>
<p>文件较大,耐心等待下载....</p>
<h3 id="执行打包命令">执行打包命令</h3>
<p>进入到源码根目录,目录结构如下所示</p>
<pre><code> MRCMS/
├── src/ 源代码。
├── database/ 数据库sql文件
├── pom.xml/ maven配置文件。
</code></pre><p>执行以下命令</p>
<pre><code>mvn package -DskipTests=true
</code></pre><p>打包完成后输出target目录里war包与编译后的mrcms字节码。新手不推荐使用war包部署方式,因为重复部署会导致在Web界面操作的数据恢复到原始状态。</p>
<h3 id="mysql数据库导入系统数据">mysql数据库导入系统数据</h3>
<p>sql文件在 <code>database</code>目录里,将最新版本的sql在mysql
数据库中执行。</p>
<h3 id="修改数据库配置文件路径">修改数据库配置文件路径</h3>
<p>修改spring配置文件 <code>/resources/config/spring/application-config.xml</code> ,在文件中指定数据库配置加载路径<code>/etc/mrcms/config.properties</code>,具体配置如下所示</p>
<pre><code><beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
">
<!-- 提供该propertyConfigurer bean支持把properties文件中的信息读取到XML配置文件的表达式中 -->
<!-- 将配置文件读取到Spring环境里 -->
<bean id="propertyPlaceholderConfigurer"
class="org.springframework.beans.factory.config.PreferencesPlaceholderConfigurer">
<property name="properties" ref="configProperties"/>
</bean>
<!-- 加载配置文件(可提供给代码调用读取) 文件不存在则忽略-->
<bean id="configProperties" class="org.springframework.beans.factory.config.PropertiesFactoryBean">
<property name="ignoreResourceNotFound" value="true"/>
<property name="locations">
<list>
<value>file:/etc/mrcms/config.properties</value>
</list>
</property>
</bean>
</beans>
</code></pre><p>接下来,配置<code>/etc/mrcms/config.properties</code>文件,具体怎么改看配置文件应该很清楚。</p>
<pre><code># power by marker 2018
#------------------------------ COMMON ---------------------------------------
# 环境名称 0 - develpo & local, 1 - preproduction, 2 - production
env.name = 0
#connection links pool
# druid 配置
mushroom.druid.maxActive = 20
mushroom.druid.initialSize = 10
# database config
mushroom.db.host=192.168.1.4
mushroom.db.port=3306
mushroom.db.demo=db_mrcms
mushroom.db.char=utf-8
mushroom.db.debug=true
mushroom.db.prefix= mr_
mushroom.db.driver=org.gjt.mm.mysql.Driver
mushroom.db.user=db_mrcms
mushroom.db.pass=123456
# redis config (不用管,普通版本没有使用redis)
mrcms.redis.host=192.168.1.4
mrcms.redis.port=6379
mrcms.redis.password=
mrcms.redis.timeout=2000
</code></pre><h3 id="主题与上传文件路径配置">主题与上传文件路径配置</h3>
<p>配置 <code>WEB-INF/conf/site.properties</code>文件,一下配置只列出了可配置的项</p>
<pre><code>themes_path=
themes_active=flatweb
file_path=
</code></pre><table>
<thead>
<tr>
<th>配置项</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>themes_path</td>
<td>主题集合的路径</td>
</tr>
<tr>
<td>themes_active</td>
<td>激活的模板名称</td>
</tr>
<tr>
<td>file_path</td>
<td>上传文件存储的路径,需要做Nginx代理(默认为当前项目中)</td>
</tr>
</tbody>
</table>
<p>flatweb是系统自带的模板项目,界面比较简单。具体模板开发文档请浏览后续文档。</p>
<p><code>注意:配置主题路径的好处是升级代码不会覆盖自己的代码,目前线上的MRCMS官网采用主题分离方式部署。</code></p>
<p>file_path 配置的上传文件存储路径,若没有配置升级系统可能会导致文件被覆盖或者丢失,建议采用Tomcat运行目录的外部存储,使用Nginx代理访问图片。具体配置方法参考高级部署文档。</p>
<h3 id="启动项目">启动项目</h3>
<p>将编译好的文件夹拷贝到Tomcat 的 <code>ROOT</code>目录中启动Tomcat。</p>
<p>该部署方式不能删除install.lock文件,直接启动就可使用系统,密码需要自己生成去修改数据库。</p>
</section>
</div>
<div class="search-results">
<div class="has-results">
<h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
<ul class="search-results-list"></ul>
</div>
<div class="no-results">
<h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
</div>
</div>
</div>
</div>
</div>
</div>
<a href="deploying2.html" class="navigation navigation-prev " aria-label="Previous page: 发布文件部署">
<i class="fa fa-angle-left"></i>
</a>
<a href="install.html" class="navigation navigation-next " aria-label="Next page: 安装步骤">
<i class="fa fa-angle-right"></i>
</a>
</div>
<script>
var gitbook = gitbook || [];
gitbook.push(function() {
gitbook.page.hasChanged({"page":{"title":"源码部署","level":"2.3","depth":1,"next":{"title":"安装步骤","level":"2.4","depth":1,"path":"install.md","ref":"install.md","articles":[]},"previous":{"title":"发布文件部署","level":"2.2","depth":1,"path":"deploying2.md","ref":"deploying2.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"deploying3.md","mtime":"2018-08-12T00:48:51.000Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2018-09-04T01:50:53.778Z"},"basePath":".","book":{"language":""}});
});
</script>
</div>
<script src="gitbook/gitbook.js"></script>
<script src="gitbook/theme.js"></script>
<script src="gitbook/gitbook-plugin-search/search-engine.js"></script>
<script src="gitbook/gitbook-plugin-search/search.js"></script>
<script src="gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
<script src="gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
<script src="gitbook/gitbook-plugin-sharing/buttons.js"></script>
<script src="gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
</body>
</html>