亚洲激情专区-91九色丨porny丨老师-久久久久久久女国产乱让韩-国产精品午夜小视频观看

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

Docker部署網站之后映射域名

發布時間:2020-08-06 10:36:43 來源:網絡 閱讀:480 作者:zhangpan0614 欄目:編程語言

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@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

執行apt-get update,這個命令的作用是:同步 /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

...
<!--修改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 80:8080 isaac-blog:1.0 啟動容器
[root@sxzhongf-test tmp]# docker restart [容器id]

Docker部署網站之后映射域名


奔跑的人生 | 博客園 | segmentfault | spring4all | csdn | 掘金 | OSChina | 簡書 | 頭條 | 知乎 | 51CTO

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

临夏县| 望奎县| 洱源县| 白山市| 湖南省| 宁阳县| 台南县| 施甸县| 当阳市| 黄陵县| 托克托县| 镇雄县| 蚌埠市| 贡山| 承德县| 桑植县| 汪清县| 通化市| 铅山县| 营山县| 通江县| 沂水县| 固始县| 广饶县| 浦城县| 论坛| 墨脱县| 吴川市| 枞阳县| 龙江县| 广平县| 富源县| 沁水县| 龙陵县| 石林| 英吉沙县| 沾益县| 漠河县| 大竹县| 沈阳市| 鄂托克旗|