摘要:中部署相信大家也都知道,不知道的可以或者一下。這里主要是為了記錄在我們啟動(dòng)容器之后,需要直接定位到網(wǎng)站信息,而不是打開域名之后,還得加個(gè)后綴才能訪問到我們的網(wǎng)站首頁。
Docker中部署tomcat相信大家也都知道,不知道的可以google 或者bing 一下。這里主要是為了記錄在我們啟動(dòng)容器之后,tomcat需要直接定位到網(wǎng)站信息,而不是打開域名之后,還得加個(gè)blog后綴才能訪問到我們的網(wǎng)站首頁。
Docker exec -it [容器id] bash
進(jìn)到/usr/local/tomcat/conf/ 修改 server.xml。
在我們安裝完docker容器,第一次進(jìn)到容器內(nèi)部的時(shí)候,是沒有vi命令的,需要我們進(jìn)行安裝。
執(zhí)行apt-get install vi/vim會(huì)報(bào)以下問題。
root@4c160951c197:/usr/local/tomcat/conf# apt-get install vi Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package vi
執(zhí)行apt-get update,這個(gè)命令的作用是:同步 /etc/apt/sources.list 和 /etc/apt/sources.list.d 中列出的源的索引,這樣才能獲取到最新的軟件包。
root@4c160951c197:~# apt-get install vim Reading package lists... Done Building dependency tree Reading state information... Done The following additional packages will be installed: libgpm2 vim-common vim-runtime xxd Suggested packages: gpm ctags vim-doc vim-scripts The following NEW packages will be installed: libgpm2 vim vim-common vim-runtime xxd 0 upgraded, 5 newly installed, 0 to remove and 3 not upgraded. Need to get 6769 kB of archives. After this operation, 31.2 MB of additional disk space will be used. Do you want to continue? [Y/n] y Get:1 http://deb.debian.org/debian stretch/main amd64 libgpm2 amd64 1.20.4-6.2+b1 [34.2 kB] Get:2 http://security.debian.org/debian-security stretch/updates/main amd64 xxd amd64 2:8.0.0197-4+deb9u3 [132 kB] Get:3 http://security.debian.org/debian-security stretch/updates/main amd64 vim-common all 2:8.0.0197-4+deb9u3 [159 kB] Get:4 http://security.debian.org/debian-security stretch/updates/main amd64 vim-runtime all 2:8.0.0197-4+deb9u3 [5409 kB] Get:5 http://security.debian.org/debian-security stretch/updates/main amd64 vim amd64 2:8.0.0197-4+deb9u3 [1034 kB] Fetched 6769 kB in 3min 54s (28.8 kB/s) debconf: delaying package configuration, since apt-utils is not installed Selecting previously unselected package xxd. (Reading database ... 12446 files and directories currently installed.) Preparing to unpack .../xxd_2%3a8.0.0197-4+deb9u3_amd64.deb ... Unpacking xxd (2:8.0.0197-4+deb9u3) ... Selecting previously unselected package vim-common. Preparing to unpack .../vim-common_2%3a8.0.0197-4+deb9u3_all.deb ... Unpacking vim-common (2:8.0.0197-4+deb9u3) ... Selecting previously unselected package libgpm2:amd64. Preparing to unpack .../libgpm2_1.20.4-6.2+b1_amd64.deb ... Unpacking libgpm2:amd64 (1.20.4-6.2+b1) ... Selecting previously unselected package vim-runtime. Preparing to unpack .../vim-runtime_2%3a8.0.0197-4+deb9u3_all.deb ... Adding "diversion of /usr/share/vim/vim80/doc/help.txt to /usr/share/vim/vim80/doc/help.txt.vim-tiny by vim-runtime" Adding "diversion of /usr/share/vim/vim80/doc/tags to /usr/share/vim/vim80/doc/tags.vim-tiny by vim-runtime" Unpacking vim-runtime (2:8.0.0197-4+deb9u3) ... Selecting previously unselected package vim. Preparing to unpack .../vim_2%3a8.0.0197-4+deb9u3_amd64.deb ... Unpacking vim (2:8.0.0197-4+deb9u3) ... Processing triggers for mime-support (3.60) ... Setting up xxd (2:8.0.0197-4+deb9u3) ... Setting up libgpm2:amd64 (1.20.4-6.2+b1) ... Processing triggers for libc-bin (2.24-11+deb9u4) ... Setting up vim-common (2:8.0.0197-4+deb9u3) ... Setting up vim-runtime (2:8.0.0197-4+deb9u3) ... Setting up vim (2:8.0.0197-4+deb9u3) ... update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vim (vim) in auto mode update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vimdiff (vimdiff) in auto mode update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rvim (rvim) in auto mode update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rview (rview) in auto mode update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vi (vi) in auto mode update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/view (view) in auto mode update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/ex (ex) in auto mode update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/editor (editor) in auto mode root@4c160951c197:~# cd /usr/local/tomcat/conf/
修改/usr/local/tomcat/conf/server.xml
...... ...
重啟blog容器
# [root@sxzhongf-test tmp]# docker run -d -p 80:8080 isaac-blog:1.0 啟動(dòng)容器 [root@sxzhongf-test tmp]# docker restart [容器id]
奔跑的人生 | 博客園 | segmentfault | spring4all | csdn | 掘金 | OSChina | 簡(jiǎn)書 | 頭條 | 知乎 | 51CTO
文章版權(quán)歸作者所有,未經(jīng)允許請(qǐng)勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。
轉(zhuǎn)載請(qǐng)注明本文地址:http://systransis.cn/yun/76154.html
摘要:在主機(jī)輸入框中輸入自己的云服務(wù)器分配的公網(wǎng),其他設(shè)置不變,點(diǎn)擊連接之后會(huì)出現(xiàn)安全警告,如果是在自己的電腦上操作的話,接受并保存即可。 基于DiscuzX系列構(gòu)建的論壇可以說是大家在日常瀏覽各類BBS網(wǎng)站中接觸最多的論壇類型了。本教程旨在引導(dǎo)讀者通過簡(jiǎn)單明確的一些步驟就打造出自己的論壇網(wǎng)站,做一個(gè)實(shí)實(shí)在在的站長(zhǎng)。 工具/原料 騰訊云服務(wù)器 CentOS 7.2 64位;遠(yuǎn)程控制程序 ...
摘要:在主機(jī)輸入框中輸入自己的云服務(wù)器分配的公網(wǎng),其他設(shè)置不變,點(diǎn)擊連接之后會(huì)出現(xiàn)安全警告,如果是在自己的電腦上操作的話,接受并保存即可。 基于DiscuzX系列構(gòu)建的論壇可以說是大家在日常瀏覽各類BBS網(wǎng)站中接觸最多的論壇類型了。本教程旨在引導(dǎo)讀者通過簡(jiǎn)單明確的一些步驟就打造出自己的論壇網(wǎng)站,做一個(gè)實(shí)實(shí)在在的站長(zhǎng)。 工具/原料 騰訊云服務(wù)器 CentOS 7.2 64位;遠(yuǎn)程控制程序 ...
摘要:作為互聯(lián)網(wǎng)工作者,相信對(duì)這個(gè)全球最大的同性交友網(wǎng)站一定不會(huì)陌生,使用的是目前如日中天的分布式版本控制系統(tǒng)。等這個(gè)狀態(tài)變成時(shí)則說明已經(jīng)部署完成,可以訪問了。修改完成后,輸入命令使配置生效,然后重啟即可。 showImg(https://segmentfault.com/img/remote/1460000018991664); 作為互聯(lián)網(wǎng)工作者,相信對(duì) GitHub 這個(gè) 全球最大的同性...
摘要:三部署架構(gòu)說明這個(gè)方案僅適用于小公司敏捷項(xiàng)目團(tuán)隊(duì)聯(lián)調(diào)測(cè)試環(huán)境的部署,同時(shí)也可以作為學(xué)習(xí)入門的,并不適用于有一定規(guī)模的生產(chǎn)環(huán)境。另外,建議把測(cè)試域名泛解析到部署這臺(tái)服務(wù)的機(jī)器。模塊配置部署腳本業(yè)務(wù)模塊的配置基本是通過部署腳本來操作的。 項(xiàng)目地址: https://github.com/xiongwilee...基本特性: 快捷部署多人nginx+php的開發(fā)測(cè)試環(huán)境,也可以擴(kuò)展構(gòu)建其...
閱讀 1422·2023-04-26 01:58
閱讀 2297·2021-11-04 16:04
閱讀 1789·2021-08-31 09:42
閱讀 1776·2021-07-25 21:37
閱讀 1075·2019-08-30 15:54
閱讀 2083·2019-08-30 15:53
閱讀 3059·2019-08-29 13:28
閱讀 2700·2019-08-29 10:56