问题: 我试图configurationapache作为一个反向代理,其中在查询string参数中指定删除服务器。 假设我正在mywebapp.com上提供一个站点。 如果你导航到http://mywebapp.com/proxy?url=http://www.someothersite.com ,那么Apache应该作为反向代理http://www.someothersite.com 。 同样,如果您导航到http://mywebapp.com/proxy?url=https://login.notmysite.com ,那么apache应该作为https://login.notmysite.com的反向代理。 注意事项: 1.在响应html中重写相关url以通过代理 2.重写来自远程服务器的redirect响应。 例如,如果用户请求mywebapp.com/proxy?url= https://login.notmysite.com ,并且远程服务器以https://login.notmysite.com/redirect,则用户的浏览器应该会看到redirect到mywebapp.com/proxy?url= https://login.notmysite.com/ 。 3.支持http和https 4.支持cookies 5.合理的安全。 我不想为世界上的任何人打开一个代理服务器,只能在mywebapp.com网站上的iframe中使用。 环境: 我使用Apache 2.2.24,但我可以升级,如果这将使问题更容易解决。 当前configuration: <VirtualHost 127.0.0.1:8081> ServerName www.mywebapp.com SSLProxyEngine On RewriteEngine on RewriteCond %{QUERY_STRING} ^url=(.*)$ RewriteRule ^/proxy – [E=url:%1] RewriteCond %{QUERY_STRING} ^url=(https?://[^:/]+)/? RewriteRule ^/proxy – [E=url_host:%1] RewriteCond %{QUERY_STRING} ^url=(.*)$ RewriteRule ^/proxy %1 [P] ProxyPassInterpolateEnv On […]
我有一个Drupal Web服务器vps在6.3以下,自二月份以来一直运行良好。 在过去的几天里,网站已经开始closures:tcp连接,然后等待无限期。 如果我重新启动httpd,那么站点会在响应几分钟之前再次停止。 有足够的磁盘空间,CPU空闲,大约一半的系统内存在缓冲区和caching中。 Mysqld保持响应。 如果我在httpd工作进程上运行pstack,它们似乎陷在了同一个地方: #0 0x00007f568d9c3a28 in poll () from /lib64/libc.so.6 #1 0x00007f568deb6717 in apr_wait_for_io_or_timeout () from /usr/lib64/libapr-1.so.0 #2 0x00007f568deb1a28 in apr_socket_sendv () from /usr/lib64/libapr-1.so.0 #3 0x00007f568f3d3083 in ?? () #4 0x00007f568f3d4035 in ap_core_output_filter () #5 0x00007f568f3e6194 in ap_http_chunk_filter () #6 0x00007f568f3e46db in ap_http_header_filter () #7 0x00007f568f3c8fd0 in ap_content_length_filter () #8 0x00007f568f3e6443 […]
我今天configuration了一些AuthnProviderAliases,我想添加Kerberos。 问题是,当我添加Kerberos Apache不会重新启动,我的系统日志中出现以下错误: 5月3日15:27:09姬路内核:[18882.364760] apache2 [13774]:segfault at 4 ip b72dacdd sp bfd4f5f0 error 4 in mod_authn_alias.so [b72da000 + 2000] 我已经遵循http://httpd.apache.org/docs/2.2/mod/mod_authn_alias.html#authnprovideralias上的语法,我有以下ldap不给错误: <AuthnProviderAlias ldap ldapa> AuthLDAPBindDN cn=apache,cn=Users,dc=samba,dc=my,dc=domain AuthLDAPBindPassword Test123 AuthLDAPURL "ldaps://192.168.142.1:636/dc=samba,dc=my,dc=domain?sAMAccountName" AuthType Basic </AuthnProviderAlias> 以下为kerberos: <AuthnProviderAlias kerberos kerb> AuthType Kerberos KrbMethodNegotiate on KrbMethodK5Passwd off KrbSaveCredentials off KrbAuthRealms SAMBA.MY.DOMAIN Krb5Keytab /etc/apache2/http.keytab </AuthnProviderAlias> 但是kerberos部分不起作用。 是否因为kerberos不是baseProvider?
我已经通过mod_proxy和mod_proxy_balancer设置了Apache 2.2的负载平衡器。 负载平衡工作得很好,但有一种情况我找不到任何configuration选项,即,当使用到后端服务器的持久连接,当其中一个死亡(closures,崩溃等),现有的连接仍然尝试访问它。 有没有办法configurationApache的负载平衡器,以便它退出或重新创build到死的后端服务器的连接? 在LVS领域,Ldirector在Proc FS下有一个选项, /proc/sys/net/ipv4/vs/expire_quiescent_template 当这被设置persisten会话/连接一个死的后端服务器将刷新,以便下一个客户端请求,他们可以重新创build。 在Apache世界里有没有类似的东西? 非常感谢! 干杯,康斯坦丁Boyanov PS Apache以什么方式检查后端服务器的状态? 它尝试连接到一些端口或类似的东西? 如果有人可以解释一下这个问题,那将会很棒! 这是我的虚拟主机configuration文件: ServerAdmin [email protected] ServerName myapp.mysite.com DocumentRoot /srv/www/vhosts/myapp.mysite.com ErrorLog /var/log/apache2/myapp.mysite.com-error_log CustomLog /var/log/apache2/myapp.mysite.com-access_log combined HostnameLookups Off UseCanonicalName Off ServerSignature On ScriptAlias /cgi-bin/ "/srv/www/vhosts/myapp.mysite.com/cgi-bin/" <Location /balancer-manager> SetHandler balancer-manager Order Deny,Allow Deny from all Allow from all </Location> <Location /server-status> SetHandler server-status Order deny,allow […]
在我的networking服务器上,我想阻止除了一些合理的例外之外的所有文件。 我有以下Filesmatch指令是这样做的工作: <FilesMatch "(?<!\.txt|\.htm|\.html|\.css|\.php|\.js|\.jpg|\.png|\.gif|\.ico|\.svg|\.eot|\.ttf|\.woff|\.otf)$"> Order Allow,Deny Deny from All </FilesMatch> 请注意,这个FilesMatch使用负面的后视正则expression式:请参阅http://www.regular-expressions.info/lookaround.html 。 它会阻止除了那些扩展名的文件之外的所有文件。 这也导致目录默认文档(index.html)的403 Forbidden。 这不是我想要的。 有人可以帮忙吗? 默认文档查找工作如何? 是否有另一种解决scheme阻止除了一些? 我使用LogLeveldebugging查看了Apache2的错误日志,但是在请求默认文档时,唯一的消息是“客户端被服务器configuration拒绝”。 (明确要求index.html作品) 编辑:有一个解决scheme通过使用位置指令。 请参阅使用FilesMatch来提高安全性因此,我的问题已解决,但我仍然想知道为什么它不适用于FilesMatch。
我试图设置redirect到特定的服务器名称上的https,但在重做之前,我希望它匹配一个位置path和反向代理到一个单独的服务器,而不是redirect到https URL。 下面是我认为它会工作,但似乎它做反向代理之前redirect。 显然,我的Apache技能是缺乏的。 也许,我需要两个独立的VirtualHosts? 任何帮助,将不胜感激。 <VirtualHost *:80> ServerName domain.com <Location /console> ProxyPass http://internal.server.com:8000/console ProxyPassReverse http://internal.server.com:8000/console </Location> <Location /> Redirect permanent / https://internal.server2.com </Location> </VirtualHost>
在我的Ubuntu 10.04.4服务器上安装apache2 2.2.14。 几个月前在开机启动apache2工作正常。 现在我已经发现,重新启动后,apache2不会自动启动。 init.d脚本存在,应该是默认安装的脚本: root@ser:~# ls /etc/init.d | grep apache apache2 运行级别的启动也被设置(使用update-rc.d apache2 defaults ): root@ser:~# find /etc/rc* -name *apache* /etc/rc0.d/K20apache2 /etc/rc1.d/K20apache2 /etc/rc2.d/S20apache2 /etc/rc3.d/S20apache2 /etc/rc4.d/S20apache2 /etc/rc5.d/S20apache2 /etc/rc6.d/K20apache2 在重新启动后检查状态将导致: root@ser:~# service apache2 status Apache is NOT running. ps aux | grep apache ps aux | grep apache也是空的。 调查/var/log/apache/error.log在启动时没有条目。 cat /var/log/syslog | grep apache cat […]
有没有办法让Apache支持SSHA密码? 我在OpenLDAP服务器上有几十个用SSHAencryption的用户密码(即,盐腌的SHA1)。 将来不会有更多的用户被添加,所以我想将所有凭据移到.htpasswd文件中以简化维护。 问题是Apache只支持unsalted(因此不安全)SHA1密码。 有没有任何国防部添加对Apache的SSHA密码的支持? 如果一个模块专门用于这个不存在,这个function可以通过mod-authnz-external和一些外部工具来实现吗?
我们有一种情况,一个网站开始服务502坏的网关,但似乎没有恢复上游服务器反弹后。 nginx服务器被设置为针对两个上游服务器的代理/负载均衡请求。 看起来数据库服务器将开始获得高负载平均值,导致Web服务器(上游服务器)缓慢地提供内容并超时(根据nginx服务器)。 然后Nginx会服务502,这是有道理的。 奇怪的是,似乎nginx在Web服务器反弹时没有启动,我们必须重新启动nginx才能重新启动服务器。 有没有解决这个问题的好方法? 我正在通过代理设置来查看是否有设置,但没有太多的运气find任何东西。 看看nginx的日志,我们看到的条目就像(只是在这个时间框架中提取三个错误的例子): 2013/06/12 13:53:40 [error] 29840#0: *258391 upstream timed out (110: Connection timed out) while reading response header from upstream, client: nnnn, server: www.example.org, request: "GET / HTTP/1.1", upstream: "http://nnnn:80/", host: "www.example.org" 2013/06/12 13:54:11 [error] 29840#0: *261105 no live upstreams while connecting to upstream, client: nnnn, server: www.example.org, request: […]
今天早上,我被警告,这两个服务我的应用程序的Apache实例没有响应来自我的负载平衡器的请求。 我试图apachectl restart ,它说Apache没有运行。 所以,我在这两个实例上启动了apache,并重新获得了服务。 然后我跟踪了这些日志,发现两者在停止响应之前都通过无人值守升级包进行了升级。 /var/log/unattended-upgrades/unattended-upgrades.log 2013-07-02 06:30:51,875 INFO Starting unattended upgrades script 2013-07-02 06:30:51,875 INFO Allowed origins are: ['o=Ubuntu,a=precise-security'] 2013-07-02 06:33:57,771 INFO Packages that are upgraded: accountsservice apache2 apache2-mpm-prefork apache2-utils apache2.2-bin apache2.2-common apparmor apport apt apt-transport-https apt-utils bind9-host binutils dbus dnsutils gnupg gpgv isc-dhcp-client isc-dhcp-common krb5-locales libaccountsservice0 libapt-inst1.4 libapt-pkg4.12 libbind9-80 libc-bin libc-dev-bin libc6 […]