Articles of apache 2.2

我如何将任何ServerAliasredirect到相应的ServerName?

我想301将所有example.orgredirect到www.example.org。 下面的例子就是这样做的,但是它有很多的噪音,因此很难维护和容易出错: <VirtualHost 192.0.2.123:80> ServerName example.org RedirectPermanent / http://www.example.org </VirtualHost> <VirtualHost 192.0.2.123:80> ServerName www.example.org DocumentRoot /usr/local/www/example </VirtualHost> 你碰巧知道上面的整个事情是否有一些较短的版本? 像这样的伪configuration : <VirtualHost 192.0.2.123:80> ServerName www.example.org ServerAlias example.org # Redirect-Every-ServerAlias-To-ServerName DocumentRoot /usr/local/www/example </VirtualHost> 那么这样我只需要提供每个应该在ServerAlias下redirect的子域呢?

在使用NameVirtualHosts并redirect到www时,如何configuration我的ELB健康检查?

我的ELB不断让我的实例退出服务,因为HTTP健康检查失败。 我们有一个DNS通配符,并将所有内容redirect到www: vhost.conf: ServerName www.example.com ServerAlias *.example.com RewriteEngine on RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC] RewriteRule ^ http://www.example.com/$1 [R=301,L] 这适用于实际的浏览器,但HTTP健康检查/失败,大概是因为它得到了302。 是使用TCP健康检查的最佳select,还是有办法让HTTP工作?

Letsencrypt – 我需要保持“知名”的证书更新吗?

我为我的Apache 2.4服务器创build了一个证书。 为了validation我的服务器,letsencrypt创build了.well-known的文件夹并访问它。 我是否需要保持此文件夹可用(用于证书更新)还是可以删除/阻止文件夹?

在中间使用Apache Proxy重写302 App ServerredirectURL

我有一个奇怪的设置。 它看起来像这样: Browser ———-> HTTPs Proxy ——> Apache HTTP —–> Tomcat AJP HTTPS HTTP AJP 在HTTPS代理(非常愚蠢的代理)上,URL看起来像https://proxy.domain.com/app。 然后通过http传输到Apache,就像http://apache.domain.com/app(通过主机proxy.domain.com传递)一样。 然后,Apache使用AJP协议在本地将请求隧道到ajp:// localhost:8009 / app /。 有时应用程序服务器要redirect请求的path。 例如,redirect/ app / to / app / webapp。 所以,它发送一个302回到Apacheredirectpath – 可能是像ajp:// localhost:8009 / app / webapp。 然后,Apache将redirectURL重写为http://proxy.domain.com/app/webapp。 HTTPS代理是愚蠢的,所以它不分析redirect并将http更改为https。 所以,我想知道是否可以configurationApache来重写302redirectURL来将用户发送到https。 这里是我在Apache的https.conf中的configuration: ProxyPreserveHost on RewriteEngine on RewriteRule ^/app$ /app/ [PT] ProxyPass /app ajp://localhost:8009/app 我尝试使用ProxyPassReverse […]

在htaccess中按照什么顺序排列规则是否重要?

我希望这是一个简单的YES或NO的答案(请说明为什么) 问题1:在htaccess中,规则是按什么顺序排列的? 因为它们是完全分开的项目:例如 Q2:如果是,我是否正确地申请? 为了加快htacces引擎,而不是用不必要的规则超载呢? 问题3:关于在这里禁用/添加的任何提示都非常欢迎+1! # DirectoryIndex index.php /index.php AddDefaultCharset UTF-8 RewriteEngine on # Options All # Options +FollowSymLinks # Options +FollowSymLinks -Indexes -ExecCGI # RewriteBase / ##################################################### <IfModule mod_headers.c> ExpiresActive On ExpiresDefault M172800 Header unset ETag FileETag None Header unset Pragma ##### STATIC FILES <FilesMatch "\\.(ico|jpg|png|gif|svg|swf|css|js|fon|ttf|eot|xml|pdf|flv)$"> ExpiresDefault M1209600 Header set Cache-Control "public, max-age=1209600" […]

如何设置Apache 2.2.3发送“最后修改”等

并告诉浏览器重新加载一个对象(和/或网页…网站上的所有内容)只有在自上次访问时间之后被修改的情况下 htaccess,httpd.conf …你有一个准备好的指令适合我的情况? 非常感谢你

Apache / PHP似乎正在caching符号链接60秒 – 如何阻止它,或发现什么是真正的caching符号链接,并停止?

我们有一个PHP web应用程序,我们正在部署到使用Capistrano运行CentOS 5.5的LAMP服务器。 Capistrano使用符号链接pipe理切换到最新版本(和回滚),所以我们的文档根目录必须指向符号链接。 不幸的是,我们已经看到,对PHP应用程序的web请求仍然指向符号链接更新之后的60秒的文档根目录的符号链接。 PHPconfiguration中的唯一设置我可以find可能与此有关的是realpath_cache_ttl设置,但是这被设置为120秒。 我在apache的configuration中找不到任何东西。 我们没有使用APC。 我甚至看在正确的地方?

Apache错误请求使用Kerberos SSO的“请求标头字段的大小超出服务器限制”

我正在通过运行在Apache(SLES 11.1上的Apache2)上的网站为Active Directory用户设置一个SSO,并且在使用Firefox进行testing时,它一切正常。 但是当我尝试在Internet Explorer 8(Windows 7)中打开网站时,我所得到的只是 “错误的请求 您的浏览器发送了此服务器无法理解的请求。 请求标头字段的大小超过服务器限制。 授权:协商[超长string]“ 我的vhost.cfg看起来像这样: <VirtualHost hostname:443> LimitRequestFieldSize 32760 LimitRequestLine 32760 LogLevel debug <Directory "/data/pwtool/sec-data/adbauth"> AuthName "Please login with your AD-credentials (Windows Account)" AuthType Kerberos KrbMethodNegotiate on KrbAuthRealms REALM.TLD KrbServiceName HTTP/hostname Krb5Keytab /data/pwtool/conf/http_hostname.krb5.keytab KrbMethodK5Passwd on KrbLocalUserMapping on Order allow,deny Allow from all </Directory> <Directory "/data/pwtool/sec-data/adbauth"> Require valid-user </Directory> […]

httpd_read_user_content和httpd_enable_homedirs有什么区别?

SELinux的apache模块有两个相似的布尔参数: httpd_read_user_content和httpd_enable_homedirs 。 手册页说,前者允许httpd读取用户内容 ,后者允许httpd读取主目录 。 他们有什么区别? 如果我想允许httpd读取/home/foo目录中的文件,我应该设置哪个参数为true?

我搞砸了为我的域购买错误的SSL证书?

我刚刚从Go Daddy购买了SSL证书。 我设置证书是: www.mydomainname.com(我改变了域名,你可以告诉。) 我设置了Apache,它正在工作。 所以当我inputhttps://www.mydomainname.com这一切工作。 然而: 当我键入http://www.mydomainname.com我从Apache得到这个错误: Bad Request Your browser sent a request that this server could not understand. Reason: You're speaking plain HTTP to an SSL-enabled server port. Instead use the HTTPS scheme to access this URL, please. 我希望能打字 http://www.mydomainname.com用于HTTP请求 和 https://www.mydomainname.com当我想要安全的请求。 我做错了什么? 这是我的Apacheconfiguration: 在网站启用(我正在使用Ubuntu的Apache设置) 我有文件称为ssl <IfModule mod_ssl.c>; SSLEngine On SSLCertificateFile /etc/apache2/ssl/www.mydomainname.com.crt […]