Docker容器利用Apache httpd部署前端静态页面

岁酱吖の 提交于 2019-12-17 17:05:39

1. 拉取centos镜像

docker search centos

docker  pull  centos :centos7

2.运行镜像将容器跑起来

docker run -d -it -p 10.20.10.153:83:80 --privileged centos:centos7 /usr/sbin/init

注意:端口映射、httpd.service服务注册

3.进入容器 

4. yum install httpd

5. 将前端代码frond_end.tar.gz 解压到/var/www/html目录下 httpd.conf配置文件documentroot

  的默认目录

注意:查看解压的文件是否正确解压和路径权限够不够

6.不要修改http.conf默认配置

7.启动httpd服务

systemctl  start httpd.service

  systemctl  status httpd.service -l  查看服务状态是否正常启动

8.本地访问宿主机 10.20.10.153:83 verify网站是否正常能访问

 /var/log/httpd/error_log

 

 

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!