我有…
<VirtualHost example.com:80> ServerAdmin webmaster@localhost ServerName example.com Redirect permanent / https://example.com/ </VirtualHost>
立即去…
<IfModule mod_ssl.c> <VirtualHost example.com:443> ServerAdmin webmaster@localhost ServerName example.com ServerAlias example.com DocumentRoot /home/klyde/ror/exampledev/public SSLCertificateFile /etc/apache2/ssl/certs/123abc.crt SSLCertificateChainFile /etc/apache2/ssl/certs/gd_bundle-g2-g1.crt SSLCertificateKeyFile /etc/apache2/ssl/private/examplekey.key BrowserMatch ".*MSIE.*" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0 SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL SSLEngine on SSLProxyEngine On ProxyRequests On <Proxy *> AddDefaultCharset off #Options Indexes FollowSymLinks AllowOverride none <RequireAny> #<RequireAll> # Require all granted #</RequireAll> <RequireAll> Require host example.com </RequireAll> <RequireAll> Require local # Require ip 127.0.0.1 </RequireAll> </RequireAny> </Proxy> ProxyPassReverseCookiePath / / ProxyPass /errors/ ! ProxyPass /websockets ws://127.0.0.1:8675/ ProxyPassReverse /websockets ws://127.0.0.1:8675/ ProxyPass / ajp://localhost:8009/ ProxyPassReverse / ajp://localhost:8009/ </VirtualHost> </IfModule>
当我启用…
Require all granted
一切正常。 但该网站被networking钓鱼超过。 我想要…
Require host example.com
但是这会导致日志错误…
access check of 'example.com' to / failed, reason: unable to get the remote host name
我select了这个configuration,因为我想停止Apache和ajp中的SSL到Torquebox。 这工作正常,除非试图保护网站。 当然,使用Torquebox的Apache可能不是完全可取的,可取的,等等。相反的build议是受欢迎的。
主要问题 – 为什么“远程主机名”错误。 有任何想法吗?
按名称确定远程主机只在远程IP地址具有PTRlogging时才起作用,并非所有IP地址都是。 如果可以,请在Require语句中使用IP地址。
您也可以使用基本身份validation(最好通过https)来限制访问。
如果你想要的只是proxypassfunction,你不需要定义一个proxy 。
如果您需要代理,请尝试限制您的代理到您的域名。
<Proxy http://www.example.com/*> .... </Proxy>