Articles of apache 2.4

嵌套的path中的Apache不同的AuthType

我有一个使用mod_auth_form运行Apache / 2.4.6的网站。 但是,我需要支持特定path上的基本身份validation来支持传统应用程序。 使用下面的configuration,网站将始终默认为表单身份validation,并且不会提示进行基本身份validation/遗留。 <Location "/"> AuthType form AuthFormProvider ldap … </Location> <Location "/legacy"> AuthType basic AuthBasicProvider dbm … </Location> 有没有一种方法来configuration网站提示只在该目录中的基本身份validation没有这样做? <Location "/forms"> AuthType form AuthFormProvider ldap … </Location> <Location "/legacy"> AuthType basic AuthBasicProvider dbm … </Location> 上面的选项将需要对当前网站进行更改,我想根据需要授权。

为一个IP地址托pipe的两个基于名称的网站之一禁用HTTPS

我有一个本地Apache2服务器,在一个IP上托pipe两个基于名字的网站。 第一个网站仅托pipe在端口80上。第二个网站托pipe在端口80和443上。如果在端口80上访问,用户将redirect到端口443。 one.local(仅限HTTP): <VirtualHost *:80> ServerName one.local ServerAlias www.one.local DocumentRoot /var/www/html/one </VirtualHost> two.local(http和https): <VirtualHost *:80> DocumentRoot /var/www/html/two ServerName two.local ServerAlias www.two.local Redirect permanent / https://two.local </VirtualHost> <VirtualHost *:443> DocumentRoot /var/www/html/two ServerName two.local ServerAlias www.two.local SSLEngine on SSLCertificateFile /etc/apache2/ssl/apache.pem SSLCertificateKeyFile /etc/apache2/ssl/apache.key </VirtualHost> 这两个网站都可以访问,使用域名和two.local获得redirect就好了。 我遇到的问题是,当访问https://one.local ,用户已连接并提示Your connection is not secure因为尝试使用two.local的自签名证书。 我已经阅读了这个问题,似乎解决scheme是再次使用相同的证书,并从httpsredirect到http。 这个问题已经在三年前问过了,这个问题有没有更好的解决办法呢?

Apache作为负载平衡器

我有一台装有操作系统(Windows 7)的机器,在端口8080,8081和8082上有三个Tomcat 7实例。我在端口88上安装了Apache 2.4,我想用它作为Tomcat的三个实例的负载平衡器。 请,我想要非常详细的说明,因为我尝试了一次以上,但是我失败了。 提前致谢。 我的httpd.conf文件: # # This is the main Apache HTTP server configuration file. It contains the # configuration directives that give the server its instructions. # See <URL:http://httpd.apache.org/docs/2.4/> for detailed information. # In particular, see # <URL:http://httpd.apache.org/docs/2.4/mod/directives.html> # for a discussion of each configuration directive. # # Do NOT simply […]

虚拟主机具有与hostnamectl设置的系统主机名相同的ServerName时出现错误Http 404

所以,我试图在我的Centos 7 Cloud VPS中为phpMyAdmin创build一个虚拟主机,但是当我尝试查看它时,出现错误http 404,如果NameServer与hostnamectl set-hostname webserver.exampledomain.tld 这里是configuration文件: /etc/httpd/conf/httpd.conf中: # This is the main Apache HTTP server configuration file. It contains the # configuration directives that give the server its instructions. # See <URL:http://httpd.apache.org/docs/2.4/> for detailed information. # In particular, see # <URL:http://httpd.apache.org/docs/2.4/mod/directives.html> # for a discussion of each configuration directive. # # Do NOT […]

Apache 2.4:未在<Location>中设置标题不起作用

我们正在运行apache 2.4为了服务我们typo3生成的网站。 一般来说,我们希望所有请求都具有X-Frame-Options SAMEORIGIN标题。 有一个例外。 对于特定的URL,这个Header应该是未设置的,因为它必须在另一个域的iFrame中使用。 所以我加了这样的东西: Header always set X-Frame-Options SAMEORIGIN <Location /anotherURL> Header always unset X-Frame-Options </Location>` 当我尝试请求给定的URL https://www.example.com/我在响应中看到X-Frame-Options -Header,但在https://www.example.com/anotherURL此标题仍然存在。 我已经检查了Location指令实际上是通过向Location指令添加一个Require all denied来处理的。 在这种情况下,如预期的那样,URL /anotherURL的访问被拒绝。 如果我将位置从/anotherURL为/typo3则取消设置按预期工作。 我在这两个URL之间唯一的差别是/typo3存在于htdocs下的目录结构中/anotherURL是由Typo3处理的URL。 我现在的问题是,为什么Apache会忽略我的Header unset命令? 从Apaches的angular度来看,一旦Typo3产生了Location-Directive应该匹配的响应头(显然是这样做的)和处理内部命令,它应该不知道Typo3正在做什么。 我浏览了一些关于HTTP标头未设置问题的其他问题,但没有任何build议解决了我的具体问题。

apache2.4上的多个虚拟主机获取AH00959:ap_proxy_connect_backend禁用worker(主机)60秒

我们在Win 2012服务器上为Apache2.4configuration了多个虚拟主机。 如果其中一个端口正在提高AH00959: ap_proxy_connect_backend disabling worker (host) for 60s它AH00959: ap_proxy_connect_backend disabling worker (host) for 60s会阻止Apache服务器在同一个时隙向其他端口发送请求?

Apache RewriteRule为每个用户目录

我在每个用户的主文件夹中有两个目录: .html-data和.cgi-bin 。 第一个包含静态(.html)文件,第二个包含dynamic文档生成的文件。 每个用户应该能够发布http://myhost.com/~<username>/上的.html-data文件夹的内容和http://myhost.com/~<username>/上的.cgi-bin文件夹的内容。 http://myhost.com/~<username>/cgi-bin/ 。 创builddynamic内容的脚本应该像提供它们的用户那样执行 (例如~steve/cgi-bin/test.cgi应该以用户steve的forms执行)。 为此,我为Apache 2.4的userdir模块configuration了以下configuration: UserDir .html-data UserDir disabled root <Directory "/home/*/.html-data"> RewriteEngine On RewriteBase /~username/ RewriteRule "^/cgi-bin/(.*)" "../../.cgi-bin/$1" AllowOverride FileInfo AuthConfig Limit Indexes Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec Require method GET POST OPTIONS </Directory> <Directory "/home/*/.cgi-bin"> Options ExecCGI SetHandler cgi-script Satisfy any </Directory> 但是,这不起作用。 RewriteRule似乎是错误的。 我怎样才能引用用户的.cgi-bin目录? 这是错误日志: [Thu […]

是否有可能通过Apache HTTP Web服务器代理\ tunnle TCP?

客户使用Apache HTTP Web服务器( AW )将HTTP请求redirect到Apache Tomcat( AT )。 我需要为AT服务的当前应用程序添加一个特殊的servlet。 这个servlet只会启动一个线程而不做任何事情。 这个线程的唯一目的是侦听传入的TCP连接。 是否有可能将通过AW收到的入站TCP连接redirect到AT ? 所以AW只会作为一个TCP代理。 我更喜欢代理解决scheme,隧道是不可取的,但如果没有其他解决scheme,我会考虑。 我无法控制客户端,期望我遵循严格的基于文本的自定义协议。 [传入连接] Client -> AW -> AT [响应] Client <- AW <- AT

使用linux容器隔离Apache虚拟主机

我有一个Web服务器主机(Linux上的Apache),它运行许多虚拟主机,它们使用“chroot”来提供CGI和FastCGI来彼此分离进程。 由于多种原因,我正在考虑用Linux容器来replace每个chroot环境。 令人惊讶的是,我几乎找不到这个想法! 我是唯一一个有这个想法的人吗? 这是一个坏主意吗? (用户可以从容器中逃脱吗?)有人有兴趣与我分享他的想法(或链接)吗? 不幸的是,容器只能用于CGI和FastCGI,因为一个进程/线程(在这个例子中是Apache)不能进入一个容器,而是工作并离开。 他必须在这个阶段退出,对吗? 还是有一个窍门?

Apache默认虚拟主机未按正确顺序加载

Apache / 2.4.6(CentOS) 有一段时间了,我已经为我的Apache服务器设置了一个catchall页面设置,所以漫游器不会抓取我的主站点,除非他们有我的域名。 不过最近,我注意到这不再适用于我的configuration。 当通过IP地址(比如10.20.20.10)加载页面时,我得到主站点(比如说mysite.net)而不是catchall。 configuration看起来像这样: <VirtualHost _default_:80> ServerName default # More config … </VirtualHost> <VirtualHost _default_:443> ServerName default # More config … </VirtualHost> <VirtualHost 10.20.20.10:80> ServerName mysite.net # More config … </VirtualHost> <VirtualHost 10.20.20.10:443> ServerName mysite.net # More config … </VirtualHost> 运行apachectl -S向我透露,它没有被加载为默认值: 10.20.20.10:443 is a NameVirtualHost default server mysite.net (/etc/httpd/sites-enabled/01-mysite.conf:24) port 443 […]