Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/reporting-services/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
docker虚拟主机apache2_Docker_Virtualhost - Fatal编程技术网

docker虚拟主机apache2

docker虚拟主机apache2,docker,virtualhost,Docker,Virtualhost,我想用我的容器创建一个虚拟主机,但它不起作用 在我的容器中执行的操作: 我已将/etc/hosts设置为127.0.0.1资产。o 我已经创建了可用的站点assets.o.conf <VirtualHost *:80> ServerName assets.o ServerAdmin webmaster@localhost DocumentRoot "/var/www/html/o/statics/assets/" <Directory "/var

我想用我的容器创建一个虚拟主机,但它不起作用

在我的容器中执行的操作:

  • 我已将/etc/hosts设置为127.0.0.1资产。o

  • 我已经创建了可用的站点assets.o.conf

    <VirtualHost *:80>
    ServerName assets.o
    ServerAdmin webmaster@localhost
    DocumentRoot "/var/www/html/o/statics/assets/"
    <Directory "/var/www/html/o/statics/assets/">
            Options Indexes FollowSymLinks Multiviews
            AllowOverride None
            Require all granted
    </Directory>
    
    ErrorLog ${APACHE_LOG_DIR}/assets.error.log
    LogLevel notice
    CustomLog ${APACHE_LOG_DIR}/assets.access.log combined
    
    
    ServerName资产
    服务器管理员webmaster@localhost
    DocumentRoot“/var/www/html/o/statics/assets/”
    选项索引跟随符号链接多视图
    不允许超限
    要求所有授权
    ErrorLog${APACHE_LOG_DIR}/assets.error.LOG
    日志级别通知
    CustomLog${APACHE_LOG_DIR}/assets.access.LOG组合
    
  • 所有这些都设置为站点启用

    我的容器使用本地机器的端口8080作为容器的端口80

    当我http://localhost:8080/etc... 它起作用,但不是资产。 链接示例如下。考虑到“图像”是“资产”的子文件夹

    如果我对assets.o进行卷曲,我将获得assets文件夹的正确内容

    当我在我的资产容器中进行跟踪路由时,我获得 本地主机(127.0.0.1)0.193毫秒0.167毫秒0.158毫秒 所以我的vhost被容器考虑。 当我在本地浏览器中本地更改图像的src以进行如下测试时 http://localhost:8080/o/statics/assets/... 它起作用了!我看到了图像

    我的问题是为什么“http://assets.o“如果此URL的卷曲在我的容器中起作用,链接中是否不考虑

    我很确定这是个端口问题…但我真的不知道ton把它放在哪里了

    提前感谢您的帮助