简体   繁体   English

如何从 ubuntu/apache2 迁移到 httpd docker 映像?

[英]How to migrate from ubuntu/apache2 to httpd docker image?

So far I used the ubuntu/apache2:2.4-22.04_beta to run a apache2 reverse proxy.到目前为止,我使用ubuntu/apache2:2.4-22.04_beta运行apache2反向代理。

I added ssl certs to /etc/apache2/ssl , and site configuration to /etc/apache2/sites-available/000-default.conf .我将 ssl 证书添加到/etc/apache2/ssl ,并将站点配置添加到/etc/apache2/sites-available/000-default.conf

With configuration like:配置如下:

<VirtualHost *:443>
        SSLEngine On
        SSLCertificateFile ...
        SSLCertificateKeyFile ...
        SSLProtocol all -SSLv3 -TLSv1 -TLSv1.1
        SSLCipherSuite  ...

        ProxyRequests Off
        ProxyPreserveHost On

        <Location /my-api>
                ProxyPass ...
                ProxyPassReverse ...
                RequestHeader set X-Forwarded-Prefix ...
        </Location>
</VirtualHost>

Question: I now would like to switch to https://hub.docker.com/_/httpd/ But how would I have to migrate those settings?问:我现在想切换到https://hub.docker.com/_/httpd/但是我必须如何迁移这些设置? Is the image exchangeable while keeping all configurations?在保留所有配置的同时,图像是否可交换?

The key concept was to migrate all a2enmod to LoadModule statements, into httpd.conf .关键概念是将所有a2enmod迁移到LoadModule语句,到httpd.conf The VirtualHost config could be migrated 1:1. VirtualHost配置可以 1:1 迁移。 That's it.而已。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM