有人知道如何使用Squid来代理maven仓库吗? 什么是configuration文件? 主要的问题是,Maven客户端发出HTTP请求与头控制caching行为(我想绕过)。 这是一个典型的要求: GET /maven/proxy/jboss-public/org/richfaces/richfaces-bom/4.2.0.Final/richfaces-bom-4.2.0.Final.pom HTTP/1.1 Cache-control: no-cache Cache-store: no-store Pragma: no-cache Expires: 0 Accept-Encoding: gzip User-Agent: Apache-Maven/3.0.4 (Java 1.6.0_26; Linux 2.6.32-38-generic) Host: 192.168.2.171 Connection: Keep-Alive 我已经在使用Apache HTTPD(并启用了disk_cache proxy_http模块),但我正在创build一个镜像,而不是代理。 这里是configuration(基于该网站 ): <Proxy *> Order deny,allow Allow from all </Proxy> # central ProxyPass /maven/proxy/central http://repo1.maven.org/maven2 ProxyPassReverse /maven/proxy/central http://repo1.maven.org/maven2 CacheEnable disk /maven/proxy/central # jboss-public-repository-group ProxyPass /maven/proxy/jboss-public […]
短篇故事 尔加! 我希望做过pipe理界面的开发者会暴露一个“webroot = / myAppAppearsHere”选项,或者使所有的链接都是相对的。 很长的故事 我有一个pipe理门户网站的客户,基本上是一个Apache的mod_authlogin,然后一系列链接到后端pipe理页面就像这样; https://portal.mysite.com/login https://portal.mysite.com/ 然后像这样的一堆链接 https://portal.mysite.com/monitoring -> https://nagios.localdomain/nagios https://portal.mysite.com/munin -> https://munin.localdomain/nagios https://portal.mysite.com/bacukups -> https://backups.localdomain/backups 然而有几个应用程序真的不满意被反向代理到一个子目录,例如chef-server-webui和logstash web界面。 ProxyPassReverse将重新映射头,但所有内部的绝对URL需要被改变,如果在应用configuration中没有这个选项,那么这个必须被强制到HTML响应中。 明显的策略是创build子域或通配符子域来映射到这样的应用程序, https://chef.mysite.com/ -> https://chefserver.localdomain:4040/ https://logstash.mysite.com/ -> https://logstash.localdomain/ https://*.mysite.com/ -> https://($1).localdomain/ 但不幸的是,我不能控制域名的pipe理,获得这些添加是可能的,但是一个痛苦。 (但我更喜欢一个解决scheme,不需要第三方参与每个新的链接)(我知道一个通配符会解决这个问题,但我有兴趣看到基于HTTP和Apache的替代scheme。 ..为了学习等;-) 所以我已经转向使用类似于mod_proxy_html的Apache2 :: ModProxyPerlHtml ,并允许在文档中dynamic重新映射string。 这实际上确实与LocationMatch和ProxyHTMLRewrite的一些组合工作,我甚至可以让JavaScript发挥很好。 然而,每个人做一个巨大的痛苦,特别是对于任何非web 1.0应用程序。 例如,下面几乎可以修复logstash在/ logstash下正常工作; <LocationMatch "^/logstash/"> RequestHeader unset Accept-Encoding PerlSetVar ProxyHTMLVerbose "On" PerlInputFilterHandler Apache2::ModProxyPerlHtml […]
我最近更新了我的.htaccess文件来隐藏URL的.php扩展名 。 它工作的很好,当我试图达到domain.com/index ,它显示的PHP文件。 当我键入domain.com/index.php时,它会将我redirect到domain.com/index url并显示.php文件。 我想将所有其他扩展名redirect到没有扩展名的url,出于安全原因显示.php文件。 我的问题是,我不能configuration我的.htaccess来redirect像.html .asp这样的众所周知的扩展。 aspx.shtml等转换为非扩展名的url,并获取显示为内容的.php文件。 我的.htaccess文件如下所示: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / # php extension to no extension url RewriteCond %{THE_REQUEST} ^[AZ]+\s.+\.php\sHTTP/.+ RewriteRule ^(.+)\.php $1 [R=301,L] # no extension to the .php file RewriteCond %{REQUEST_FILENAME}.php -f RewriteCond %{REQUEST_URI} !/$ RewriteRule (.*) $1\.php [L] # this is for the index RewriteRule […]
我有一个需要确保我的url,称为www.domain.com总是至less通过基本的HTTP身份validation保护。 此外,我想使用mod_rewrite将我的用户发送到我的服务器上运行的两个OC4j实例之一。 我也想用这个相同的authentication保护我的OC4jpipe理面板(和其他pipe理types的function)。 我将有2个用户,称他们pipe理员(pipe理员将有权访问OC4j实例和OC4jpipe理面板)和来宾(来宾将只能够到达OC4j实例)。 所以,假设我有两个OC4j实例 – instance_a和instance_b。 instance_a将在端口8888上运行,而instance_b将在端口8889上运行。当用户inputwww.domain.com/instance_a时,我想首先确认它们已经通过服务器authentication,然后我想使用mod_rewrite将请求代理到www .domain.com:8888 / instance_a。 这将遵循instance_b。 同样,任何用户,pipe理员或访客都可以访问这些实例。 如果用户试图直接访问OC4jpipe理面板,如果他们不是pipe理员用户,我想把它们踢出去。 我有一个像这样的VirtualHost条目: <VirtualHost *:80> ServerName www.domain.com CustomLog "/var/log/httpd/ic/access_log" "combined" ErrorLog "/var/log/httpd/ic/error_log" RewriteEngine on RewriteLogLevel 9 RewriteLog "/var/log/httpd/rewrite_log" RewriteCond %{REMOTE_USER} !^guest$ [OR] RewriteCond %{REMOTE_USER} !^admin$ RewriteCond %{REQUEST_URI} ^/instance_a.*$ RewriteRule ^.*$ – [F,L] <LocationMatch "^/.*$"> AuthType Basic AuthName "Please Login" AuthBasicProvider file AuthUserFile /usr/local/apache/passwd/passwords […]
我已经在apacheconfiguration中使用这样的代码来保护密码的位置 <Location ~ "/admin.*"> AuthType Basic AuthName "Protected Area" AuthUserFile /home/user/public_html/.htpasswd Require valid-user </Location> 有没有办法使用htaccess文件做同样的事情? 我想要保护的位置在文件系统上并不存在,这是由mod_rewrite提供的可用位置
我在我的apache访问日志中发现了这个 access.log:555.555.555.555 – – [05/May/2011:12:12:21 -0400] "GET /somedir/ HTTP/1.1" 403 291 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:5.0) Gecko/20100101 Firefox/5.0" access.log:555.555.555.555 – – [05/May/2011:12:12:29 -0400] "GET /somedir/ HTTP/1.1" 200 7629 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:5.0) Gecko/20100101 Firefox/5.0" 所以/ somedir /具有.htaccess文件,看起来像 Order Deny,Allow Deny from all Allow from 333.333.333.333 Allow from 444.444.444.444 htaccess在时间范围内没有被修改(12:12:21和12:12:29之间的8秒) 任何想法如何这可能击中403禁止,然后8秒后200 OK; 我感到困惑
我运行一个debian压缩标准的Apache安装(2.2),并使用SSLClientCertificates来授权用户。 这工作很好迄今。 但是我们注意到一些并行请求的缓慢,并试图检查我的SSLSessionCache是否正在工作。 所以我检查了我的本地主机/服务器状态,它是这样读的: SSL/TLS Session Cache Status: cache type: SHMCB, shared memory: 512000 bytes, current sessions: 0 subcaches: 32, indexes per subcache: 133 index usage: 0%, cache usage: 0% total sessions stored since starting: 0 total sessions expired since starting: 0 total (pre-expiry) sessions scrolled out of the cache: 0 total retrieves since starting: […]
最近我们遇到了Varnish(3x) – > Apache(3x)安装的问题,导致SYN_SENT连接数量猛增。 这个峰值本身是由于新的stream量触及网站(而不是任何types的DDOS),而且似乎我们的Varnish机器在将stream量转发到后端服务器时出现问题(Apachestream量下降与清漆上的尖峰相关),拥塞SYN_SENT的可用端口池。 保持活动在Apache(15s)上启用。 哪一方是错的? stream量很大,但是不应该导致这样的设置(3x Varnish前端机器,3x后端Apache服务器)停顿。 请帮忙。 Munin截图通过防火墙连接在这里 。 varnish〜 ~$ netstat -an|awk '/tcp/ {print $6}'|sort|uniq -c 9 CLOSE_WAIT 12 CLOSING 718 ESTABLISHED 39 FIN_WAIT1 1714 FIN_WAIT2 76 LAST_ACK 12 LISTEN 256 SYN_RECV 6124 TIME_WAIT /etc/sysctl.conf(Varnish) net.ipv4.netfilter.ip_conntrack_max = 262144 net.ipv4.netfilter.ip_conntrack_tcp_timeout_syn_recv = 60 net.ipv4.ip_local_port_range = 1024 65536 net.core.rmem_max = 16777216 net.core.wmem_max = 16777216 […]
我们的组织正在重build它的网站。 有人在新的服务器上build立了新的站点。 可以在/ etc / hosts中input条目后访问它。 当以这种方式访问时,完美的作品。 但是由于大多数参与者都不太擅长电脑,所以我决定设置一个反向代理。 我没有访问该网站,也没有服务器女巫主办。 我有一个WordPress的编辑器帐户安装在那里。 我已经在我的私人服务器的/ etc / hosts中设置了一个条目,并使用以下configuration设置了反向代理服务器,我的服务器在Debian stable下运行apache-2.2: <VirtualHost *:80> ServerName xxx.xxx.xxx.xxx ProxyRequests off ProxyPass /some/prefix/ http://site.example.com/ ProxyPassReverse /some/prefix/ http://site.example.com/ ProxyHTMLURLMap http://site.example.com/ http://xxx.xxx.xxx.xxx/some/prefix/ <Location /some/prefix/> SetOutputFilter INFLATE;proxy-html;DEFLATE ProxyHTMLURLMap http://site.example.com/ /some/prefix/ </Location> ProxyPassReverseCookieDomain site.example.com xxx.xxx.xxx.xxx ProxyPassReverseCookiePath / /some/prefix/ ProxyHTMLExtended On </VirtualHost> 几乎一切正常。 我无法创build新post(文本编辑器无法正常加载)。 Iceweasel的(Firefox)开发者模式说: (…) [00:13:33.365] GET http://xxx.xxx.xxx.xxx/some/prefix/wp-includes/js/tinymce/langs/pl.js?wp-mce-4107-20141130 [HTTP/1.1 […]
似乎我的一些PHP应用程序需要PHP 5.2和一些需要PHP 5.3。 有没有办法configurationApache(V2.2.14),一个虚拟主机将与一个PHP库和一个不同的虚拟主机将需要一个不同的? 目前唯一的解决办法是安装两个apaches和两个phps,每个apache将驻留在不同的端口。 谢谢