用Apache VirtualHost保护Webmin

我试图设置我的webmin实例的地址https://webmin.example.com,但我得到一个内部服务器错误(500)。 任何想法为什么?

这是我的Apacheconfiguration:

<VirtualHost *:443> ServerName webmin.example.com ServerAlias webmin.example.com <Proxy *> Order deny,allow Allow from all </Proxy> ProxyRequests Off ProxyPreserveHost On ProxyPass / https://127.0.0.1:10000/ ProxyPassReverse / https://127.0.0.1:10000/ SSLEngine on SSLCertificateFile /etc/apache2/ssl/server.pem SSLCertificateKeyFile /etc/apache2/ssl/server.key </VirtualHost> 

这里是日志文件的内容:

 [ssl:error] [pid 21593] [remote 127.0.0.1:10000] AH01961: SSL Proxy requested for webmin.example.com:443 but not enabled [Hint: SSLProxyEngine] [proxy:error] [pid 21593] AH00961: HTTPS: failed to enable ssl support for 127.0.0.1:10000 (127.0.0.1) 

当您正在代理https请求时,您需要启用SSL代理

 <VirtualHost *:443> ServerName webmin.example.com SSLEngine on SSLCertificateFile /etc/apache2/ssl/server.pem SSLCertificateKeyFile /etc/apache2/ssl/server.key SSLProxyEngine On SSLProxyCheckPeerCN on SSLProxyCheckPeerExpire on ProxyRequests Off ProxyPreserveHost On ProxyPass / https://127.0.0.1:10000/ ProxyPassReverse / https://127.0.0.1:10000/ </VirtualHost> 

您还需要启用一些模块:

  • 了mod_ssl
  • mod_proxy的
  • mod_proxy_http

如果您的ServerAlias与您的服务器名称相同,则它变得无用,因此您可以将其删除

您可以删除这部分,默认情况下,您将有权访问:

 <Proxy *> Order deny,allow Allow from all </Proxy> 

如果您正在使用自签名证书,则需要删除SSLvalidation:

 SSLProxyEngine On SSLProxyVerify none SSLProxyCheckPeerCN off SSLProxyCheckPeerName off SSLProxyCheckPeerExpire off 

代替

 SSLProxyEngine On SSLProxyCheckPeerCN on SSLProxyCheckPeerExpire on 

更多信息在这里https://httpd.apache.org/docs/trunk/mod/mod_ssl.html