Docker部署网站之后映射域名

  • 时间:
  • 浏览:0
  • 来源:大发pk10_pk10最高邀请码_大发pk10最高邀请码

Docker中部署tomcat相信当我们都都 也都知道,真不知道的还可否 google 肯能bing 一下。这里主要是我为了记录在当我们都都 启动容器日后,tomcat必须直接定位到网站信息,而都在打开域名日后,还得加个blog后缀才能访问到当我们都都 的网站首页。

Docker exec -it [容器id] bash

进到/usr/local/tomcat/conf/ 修改 server.xml。

在当我们都都 安装完docker容器,第一次进到容器内控 的日后,是没人vi命令的,必须当我们都都 进行安装。

执行apt-get install vi/vim会报以下什么的问题。

root@4c1100951c197:/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

执行apt-get update,这个 命令的作用是:同步 /etc/apt/sources.list 和 /etc/apt/sources.list.d 中列出的源的索引,曾经 才能获取到最新的软件包。

root@4c1100951c197:~# 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/vim100/doc/help.txt to /usr/share/vim/vim100/doc/help.txt.vim-tiny by vim-runtime'
Adding 'diversion of /usr/share/vim/vim100/doc/tags to /usr/share/vim/vim100/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.100) ...
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@4c1100951c197:~# cd /usr/local/tomcat/conf/

修改/usr/local/tomcat/conf/server.xml

...
<!--修改defaultHost-->
<Engine name="Catalina" defaultHost="life-runner.com">
... 
<!--改变appBase对应的目录-->
<Host name="life-runner.com"  appBase="webapps"
            unpackWARs="true" autoDeploy="true">

        <!-- SingleSignOn valve, share authentication between web applications
             Documentation at: /docs/config/valve.html -->
        <!--
        <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
        -->

        <!-- Access log processes all example.
             Documentation at: /docs/config/valve.html
             Note: The pattern used is equivalent to using pattern="common" -->
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="localhost_access_log" suffix=".txt"
               pattern="%h %l %u %t &quot;%r&quot; %s %b" />
             <!--加在文件appBase对应的目录-->
       <Context path="" docBase ="../webapps/blog/"/>
      </Host>

...

重启blog容器

# [root@sxzhongf-test tmp]# docker run -d -p 100:100100 isaac-blog:1.0 启动容器
[root@sxzhongf-test tmp]# docker restart [容器id]

猜你喜欢

TechWeb.com.cn

华天科技预计今年前三季度盈利16,461.02万元至17,761.02万元,同比下降45.75%至49.72%。华天科技上年同期盈利3.27亿元。Libra(天秤币)學會成员将

2019-10-14

忆捷 G50 USB3.0(500G)好不好,优缺点,是否值得买

关于大伙儿儿儿儿|广告服务|使用条款|联系大伙儿儿儿儿北京盛拓优讯信息技术有限公司.版权所有中华人民共和国增值电信业务经营许可证编号:京B2-20170206北京市公安局海淀分

2019-10-14

港超足球联赛\愉园“小虎队”今硬碰杰志

图:左起:由车路士足校培训的愉园小将张俊轩、袁世杰、黄浩然、朱伟钧、黄智康与翁煦涛,齐集港超舞台【大公报讯】记者李恒基报道:拖累本地顶级足球赛事舞台十个 球季,老牌球队愉园今

2019-10-14

人物專訪\黃洋:爭取出場不放鬆

圖:黃洋(前)將在十月滿36歲,但仍以年輕球員初到球隊的心態去競爭正選十年人事幾番新,港超足球隊傑志近10年6次在香港頂級組別聯賽稱霸,如今進入新舊交替期,當年的冠軍功臣仍在陣

2019-10-14

王者荣耀2018年度评选活动之王者最会玩投票地址

王者荣耀2018年度评选活动现在不可能 开启了投票活动,玩家可不时需为买车人最喜欢的精彩瞬间进行投票了,下面我们来看下这次活动的投票地址吧。本次的活动一共有4个奖项评选:年度

2019-10-14