我在Tomcat实例之前运行Apache。 Apache代理每一个通过的请求,并把它传递给Tomcat。 目前的configuration是Apache把一个ProxyPass放在根(/)上。 然而,有新的要求,这些要求指定对域根目录的调用应该返回一个静态的启动页面,并且任何其他的调用都应该被代理。 意即: www.domain.com -> static page www.domain.com/username – proxy to Tomcat 制作多个ProxPass指令不是一个好主意,因为Tomcat实例必须支持许多path,而且其中许多path都会改变。
我有glassfish 4.1运行,并检查http-listener-2上的JK-Listener选项: 我也已经安装了Apache( sudo yum install httpd )并在/etc/httpd/conf.d上创build了以下文件: /etc/httpd/conf.d/ajp.conf ProxyPass / painel ajp:// localhost:8181 / painel ProxyPassReverse / painel ajp:// localhost:8181 / painel 但所有我试图使用ajp协议是503 http错误。 我错过了什么? 如果我将协议从ajp更改为http和端口8080,它的工作原理。 但是这个想法是使用ajp。 任何帮助是受欢迎的。
我有一个Web服务器(Apache反向代理)在我的应用程序服务器(Apache)前,我试图通过公共名称的SSL。 我的Web服务器(Apache反向代理)设置为保留主机名(ProxyPreserveHost开) 在我的应用程序服务器(Apache)上,如何configuration我的虚拟主机以使代理服务器传递的主机名可以被启动? 我得到这样的错误: [warn] RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?) [warn] RSA server certificate CommonName (CN) `appserver01' does NOT match server name!? 我是否需要通过我的应用程序服务器(Apacheconfiguration)进行额外的转换? 这是我的虚拟主机的样子: NameVirtualHost *:80 Header always append X-Frame-Options SAMEORIGIN <VirtualHost *:80> DocumentRoot /var/www/app ServerName www.app.com ServerAlias app.com ServerAlias appserver01.domain.com <Directory /var/www/app> Options All AllowOverride All </Directory> […]
我有一个Web应用程序,第一个请求可能需要几秒钟,因为一些单身人士被初始化。 我已经使用了这个问题中提到的mod_proxy和jsvc构造,并且在这个页面上描述了使用tomcat连接apache(数据通过SSL提供) 对于示例Tomcat应用程序,一切正常。 但是,使用我的应用程序时,我在我的apache日志中得到以下错误: [Wed Feb 10 09:48:29 2010] [error] [client 130.12.1.26] (70014)End of file found: proxy: error reading status line from remote server localhost [Wed Feb 10 09:48:29 2010] [error] [client 130.12.1.26] proxy: Error reading from remote server returned by /MyWebApp/MyWebApp.faces 并在我的tomcat输出中出现以下错误: 10/02/2010 09:48:29 9947 jsvc.exec error: Service exit with a return value of […]
(在Mac OS X 10.6上,Apache 2.2.11) 遵循经常性的googlesearchbuild议,我在我的Mac上设置了mod_proxy,作为http请求的转发代理。 我的httpd.conf包含这个: <IfModule mod_proxy> ProxyRequests On ProxyVia On <代理*> 全部允许 </代理> (是的,我意识到这并不理想,但我在防火墙后面试图弄清楚为什么这个东西根本不起作用) 所以,当我将浏览器的代理设置指向本地服务器(ip_address:80)时,会发生以下情况: 我浏览到http://www.cnn.com 我通过嗅探器看到,这是发送到Mac上的Apache Apache响应它的默认主页(“It works!”就是这个页面所说的) 所以… Apache并没有像预期的那样做 – 它不会将我的浏览器的请求转发到Internet的cnn。 日志文件中没有显示任何错误或问题,Apache向浏览器返回200头。 显然有一些非常基本的configuration步骤,我不理解…但是什么?
有没有可能使用htaccess来做到这一点? 用户访问 – > http:// mydomaina.com/dir/filename 它将显示 – > http:// mymainsite.com/anydir/mydomaina-filename的内容 我有一个htaccess的代码,但它不能正常工作,可能是缺less的东西 <IfModule mod_rewrite.c> RewriteRule ^dir/(.*)\.xml$ http://mymainsite.com/dir/%{HTTP_HOST}-$1.xml [P] </IfModule> 谢谢
我们有Apache服务器代理应用程序服务器的内容,也从旧的Web服务器。 我们使用负载平衡器启用caching,但caching不像我们预期的那样。 这是我们的设置: 我们正在设置caching标题,专门用于从我们的应用程序服 <Location ~ /(appDir1|appDir2|appDir3)> Header set Cache-Control max-age=3600,public </Location> 这工作正常。 在传统服务器上,系统pipe理员已经在运行其遗留站点的Apache虚拟主机中设置了这一点: Header set Cache-Control max-age=0,private,no-cache 但是,我们的负载均衡器仍在caching我们所代理的旧版内容。 当我们访问http:// appHost / legacyDir1 – 我们看到caching的内容。 当我们访问http:// legacyHost / legacyDir1 – 我们看到非caching的内容。 至less从理论上讲,我们期望在http:// appHost / legacyDir1上看到非caching。 任何想法,我们可能会错过…? KM
我必须通过mod_rewrite从apache代理所有请求到另一个。 加载mod_proxy和mod_rewrite,我configuration了如下的Apache: <VirtualHost *:8009> Options +FollowSymLinks -Multiviews …… RewriteEngine on RewriteRule ^/abc/(.*) http://anotherhost/abc/$1 [P,L] …. </VirtualHost> 但阿帕奇返回我505。 这是Apache在重写日志上写的内容: – – [16/Sep/2010:14:13:06 +0200] [myhost/sid#7f9472e763b8][rid#7f94731a6c78/initial] (2) forcing proxy-throughput with http://otherhost/abc/ – – [16/Sep/2010:14:13:06 +0200] [myhost/sid#7f9472e763b8][rid#7f94731a6c78/initial] (1) go-ahead with proxy request proxy:http://otherhost/abc/ [OK] 这在错误日志上: [warn] proxy: No protocol handler was valid for the URL /abc/. If you are […]
我试图使用mod_rewrite和mod_proxy一起通过一个(假)子目录“foo”( http://example.com/foo )从不同的内部web服务器( http://webserver.internal.com/foo )提供内容)。 使用mod_proxy和ProxyPass指令我已经可以在/etc/apache2/mods-enabled/proxy.conf中使用这个configuration ProxyPass /foo http://webserver.internal.com/foo ProxyPassReverse /foo http://webserver.internal.com/foo 现在我有额外的要求来强制重写从http://example.com到https:// example.com的dynamic资源的所有请求,它们也是独立运行的,但不能与上面提到的ProxyPass规则一起使用。 看来代理configuration总是优先于重写规则。 就我的研究显示,在我的重写规则中使用mod_proxy应该像添加一样简单 RewriteCond%{REQUEST_URI} ^ / foo RewriteRule ^ / foo(。*) http://webserver.internal.com/foo $ 1 [P] 到我的重写规则和重写的URI将自动通过mod_proxy传递。 我打开了一个LogLevel为9的RewriteLog,但之后我无法看到^ / foo的匹配和下面的Proxy-RewriteRule的执行情况。 没有什么比预先代理,或任何提及的代理,甚至没有在RewriteLog中的错误条目。 我有我的apache2configuration中激活以下代理模块 proxy proxy_connect proxy_http 我试图用另一个例子来testing我的RewriteCondition – 这次匹配^ / foo并redirect到www.google.com RewriteCond %{REQUEST_URI} ^/foo RewriteRule ^(.*)$ http://www.google.com/ [R=302,L] 这是按预期工作的,在RewriteLog中有以下结果: RewriteCond:input ='/ foo'pattern ='^ / […]
我运行lighttpd 1.5刚刚编译closuressvn。 我有一个Trac守护进程监听8000端口,我想代理所有匹配^http://xx.xx.xx.xx/trac(*.)请求到守护进程。 这是它在我的.conf中的样子: $HTTP["host"] == "xx.xx.xx.xx" { $HTTP["url"] =~ "^/trac" { proxy-core.balancer = "round-robin" proxy-core.protocol = "http" proxy-core.backends = ( "127.0.0.1:8000" ) proxy-core.rewrite-response = ( "Location" => ( "^http://xx\.xx\.xx\.xx/(.*)" => http://xx.xx.xx.xx/trac/$1" ), ) proxy-core.rewrite-request = ( "_uri" => ( "^/trac/?(.*)" => "/$1" ), "Host" => ( ".*" => "xx.xx.xx.xx" ), ) } xx.xx.xx.xx是可以公开访问的IP,在端口80上。 部分原因是因为当我浏览到http://xx.xx.xx.xx/trac我在Trac中看到了我的可用项目(即由127.0.0.1:8000/服务的页面),而其他任何不以/ […]