Articles of apache 2.2

禁用apache 2虚拟主机中的ProxyPass规则

我在httpd.conf中有一个全局的proxypass规则 全球一级的规则 ProxyPass /test/css http://myserver:7788/test/css ProxyPassReverse /test/css http://myserver:7788/test/css 我有一个虚拟主机 Listen localhost:7788 NameVirtualHost localhost:7788 <VirtualHost localhost:7788> Alias /test/css/ "C:/jboss/server/default/deploy/test.ear/test-web-app.war/css/" </VirtualHost> 我想禁用在这个虚拟主机上应用的所有全局代理通行证规则? NoProxy似乎不工作。 (我想这样做的原因是我有以下的全局规则,如果在这个虚拟主机中应用,创build一个502代理循环 #pass all requests to application server ProxyPass /test http://localhost:8080/test ProxyPassReverse /test http://localhost:8080/test ) 我想要做的是,使用apache服务所有静态内容(如css),同时仍然代理其余的请求到应用程序服务器。

Apache与Kerberos身份validation性能差

我有一个Apache实例,使用kerberos SSO与我们已经运行的内部应用程序。 但是performance非常差。 我相信从一个tcp转储,当用户点击我们的一些我们的dojoforms的应用程序,Apache正在打电话给我们的KDC,以确保用户有权限这些文件。 由于道场图书馆相当繁重,这是需要很长时间才能运行,严重影响了基于道场的表格加载的性能。 我们正在使用mod_auth_kerb ,目前我们的httpd.conf文件是这样的。 <Directory "/opt/myapp/public"> AllowOverride All Order allow,deny Allow from all AuthType Kerberos AuthName KerberosLogin KrbServiceName HTTP/[email protected] KrbMethodNegotiate On KrbMethodK5Passwd On KrbAuthRealms MYDOMAIN.COM Krb5KeyTab /etc/krb5.keytab require valid-user </Directory> 有没有一个命令,我可以放在httpd.conf文件或一个.htaccess文件,我把它放在保存了dojo库的javascript目录,告诉Apache不要validation目录访问? 我相信这会使网站性能提高100倍。 (是的,这真的很糟糕) 谢谢

mod_rewrite:重写/到CGI脚本

我有一个虚拟主机,我想重写/像/ cgi-bin / script?123。 我认为这样的事情会起作用,但是这会重写为“/index.html/”。 RewriteEngine On RewriteRule ^/$ /cgi-bin/script.cgi?123 [L] 你怎么能这样做?

Apache使用公共文件设置多个站点

刚刚意识到我发布了这个错误堆栈溢出,所以这里是在正确的地方! 我有大约50个网站,所有使用CSS和IMAGES以外完全相同的文件,我目前每次创build一个新的网站和上传不同的CSS和图像复制文件。 我想要做什么,所以设置每个虚拟主机有相同的DocumentRoot然后添加的CSS和图像文件夹的AliasMatch例如: #Common Files VHOST <VirtualHost xxx.xxx.xxx.xxx:80> ServerName commonfiles.com ServerAlias www.commonfiles.com DocumentRoot /home/commonfiles/public_html </VirtualHost> #Sample vhost for 1 of the 50 sites. <VirtualHost xxx.xxx.xxx.xxx:80> ServerName mytest.com ServerAlias www.mytest.com DocumentRoot /home/commonfiles/public_html …… AliasMatch /css/(.*) /home/ftpuser/public_html/mycss/$1 </VirtualHost> 这个别名对于定制的文件来说是完美的,但是由于许可错误,通用文件不能被访问: [Mon Nov 16 09:31:01 2009] [crit] [client xxx.xxx.xxx.xxx] (13)Permission denied: /home/commonfiles/public_html/.htaccess pcfg_openfile: unable to check htaccess file, ensure […]

在Mac OS X 10.6上运行多个SSL证书

我已经跑了一段时间的墙壁,所以我张贴在stackoverflow,我被指出在这里… 我正在尝试在Snow Leopard上设置多个IP地址,以便我可以使用SSL证书进行开发。 我正在运行XAMPP – 我不知道是否是这个问题,但我想我会遇到同样的问题,考虑到内置的Apache被closures。 所以首先,我开始研究启动IP。 我启动了一个运行正确的新的StartupItem,因为我可以ping通ip地址: ping 127.0.0.2 ping 127.0.0.1 而且他们都工作。 所以现在我有IP地址,你可能知道在OSx上不是标准的。 我编辑了/etc/hosts文件以包含新的网站: 127.0.0.1 site1.local 127.0.0.2 site2.local 我已经改变了httpd.conf使用httpd-vhosts.conf – 因为我有一个IP地址上运行几个站点。 我已经编辑了vhosts文件,所以一个网站看起来像这样: <VirtualHost 127.0.0.1:80> DocumentRoot "/Users/jim/Documents/Projects/site1/web" ServerName site1.local <Directory "/Users/jim/Documents/Projects/site1"> Order deny,allow Deny from All Allow from 127.0.0.1 AllowOverride All </Directory> </VirtualHost> <VirtualHost 127.0.0.1:443> DocumentRoot "/Users/jim/Documents/Projects/site1/web" ServerName site1.local SSLEngine On SSLCertificateFile "/Applications/XAMPP/etc/ssl-certs/myssl.crt" SSLCertificateKeyFile "/Applications/XAMPP/etc/ssl-certs/myssl.key" […]

.htaccess允许从主机名?

Ubuntu 9.10 Apache2 嗨,大家好, 长话短说,我需要基于dynamic的IP源地址来限制对我网站某个部分的访问。 从历史上看,我刚刚将以下内容添加到htaccess … order deny,allow deny from all # allow my dynamic IP address allow from <dynamic ip> 但问题是每次IP更改时都必须手动进行更改。 理想情况下,我想指定一个主机名,而不是…类似于: order deny,allow deny from all # allow my host allow from hostname.whatever.local 这似乎并没有奏效。 我得到一个错误403 – 访问被禁止。 .htaccess不支持主机名?

mod_rewrite将文件添加到url

以下重写将http://example.com/redirect到http://example.com/www/www.example.com/public_html,而不是http://www.example.com/ 。 /www/www.example.com/public_html是DocumentRoot 。 # Rewrite Rules for Example RewriteEngine On RewriteBase / # Redirect from example.com to www.example.com RewriteCond %{HTTP_HOST} !^www\.example\.com [NC] RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L] 这个redirect是在一个VirtualHost *:80的设置: ServerName example.com ServerAlias www.example.com ServerAdmin [email protected] Options +FollowSymLinks DocumentRoot /www/www.example.com/public_html and the rewrite is inside <Directory /> 任何想法,为什么会这样做? 我查看了Apache手册 ,它说在你的RewriteCond中使用$ {HTTP_HOST}会把主机添加到RewriteRule而不是URL-Path 。 那么这是一个非常常见的重写,我从来没有见过这种情况发生。

清理Apacheconfiguration中的怪物重写列表(mod_rewrite)

你将如何去清理多年积累的大量重写清单? 这个想法是摆脱所有重写和未使用的redirect语句,同时保留所有的工作。 我正在考虑启用RewriteLog并将RewriteLogLevel设置为3或4一天左右,然后parsing整个日志并识别“死”重写,注释掉它们,然后检查日志中是否有新的404。 你必须做一个这样的mod_rewrite清理和/或你有任何其他的想法?

基于Apache名称的虚拟主机 – configurationhttpd.conf文件

我在我的服务器上的以下位置上运行Tomcat上的Web应用程序。 在/ var / tomcat的/ webapps /目录SoccerApp 我正在寻找更新Tomcat httpd.conf文件与以下虚拟主机… <VirtualHost *:80> DocumentRoot /var/tomcat/webapps/SoccerApp/MyTeam ServerName www.mysoccerapp.com </VirtualHost> 这给我一个404错误,因为目录MyTeam不存在。 但是,我的应用程序的行为方式是使用此URL目录作为显示数据的足球队的名称,因此它永远不会成为服务器上的物理文件夹。 无论如何,我想要www.mysoccerapp.com解决到webapps / SoccerApp / MyTeam,即使目录不存在。 这有意义吗? 任何想法如何得到这个工作。 在一天结束的时候,我想要做以下事情… www.teamone.com -> runs /webapps/SoccerApp/TeamOne www.teamone.com -> runs /webapps/SoccerApp/TeamTwo TeamOne和TeamTwo不是物理目录,而是仅由我的SoccerApp应用程序作为当前足球队进行处理以显示数据。 非常感谢! 戴夫。

如何获得validation身份 在多个域?

所以我有两个域,都使用相同的htdigest设置和密码等。问题是,它不使用相同的身份validation在另一个。 我的两个最佳位置是: http ://svn.kylehotchkiss.com和http://apps.kylehotchkiss.com/codex 。 这里是我的svn.kylehotchkiss.com域的configuration: <Directory /> DAV svn SVNParentPath /srv/svn.kylehotchkiss.com/repo SVNListParentPath On AuthType Digest AuthName "KHP Code Repository" AuthDigestDomain / http://svn.kylehotchkiss.com/ http://apps.kylehotchkiss.com/codex/ AuthDigestProvider file AuthUserFile /srv/svn.kylehotchkiss.com/auth/passwd Require valid-user </Directory> 和我的代码为apps.kylehotchkiss.com/codex/是在.htaccess文件那里,这是怎么回事: AuthType Digest AuthName "KHP Code Repository" AuthDigestDomain / http://apps.kylehotchkiss.com/codex/ http://svn.kylehotchkiss.com/ AuthDigestProvider file AuthUserFile /srv/svn.kylehotchkiss.com/auth/passwd Require valid-user 那么,我在AuthDigestDomain设置中错过了什么,不允许两者一起工作呢? .htaccess文件是否在错误的位置?