Articles of apache 2.4

Apache 2.4代理服务器获取客户端身份validation,但不传递给Tomcat

我以前已经有Apache 2.2.17作为反向代理运行,它将请求客户端authentication(使用SSLVerifyClient),并将authentication传递给jetty / tomcat应用程序servlet引擎。 然后我的Java应用程序会从请求中读取这个信息(x509Certificate)。 当升级到新服务器时,我们决定迁移到最新版本的Apache,但这个过程似乎不再起作用。 Apache仍然要求客户端身份validation,但似乎没有传递给Tomcat。 以下是工作(v2.2.17)httpd.conf文件的相关位: <VirtualHost _default_:443> ServerName xxxxxxxx SSLEngine On SSLCertificateFile conf/ssl-prod/xxxxxxxx.crt SSLCertificateKeyFile conf/ssl-prod/xxxxxxxx.key SSLCACertificatePath conf/ssl.certs/ <Location /> ProxyPass http://xxxxxxxx:8009/ ProxyPassReverse http://xxxxxxxx:8009/ Order deny,allow Allow from all </Location> <Location /login/> SSLVerifyClient optional SSLVerifyDepth 10 ProxyPass http://xxxxxxxx:8009/ ProxyPassReverse http://xxxxxxxx:8009/ Order deny,allow Allow from all </Location> </VirtualHost> 所以,这只是一个标准的SSL代理,直到用户转到“login”文件夹中的一个页面,此时apache要求客户端进行身份validation。 我已经尝试设置一些其他variables,看看是否会导致它ProxyAddHeaders ProxyPreserverHost上(和closures),但没有成功的工作。 我们在移植到2.2.23分支的最新版本时也遇到了同样的问题,但是当我们复制旧版本的时候,我们正在使用新的服务器。 唯一的区别是我们正在从32位服务器转移到64位服务器(都使用ApacheLounge可执行文件的Windows)。 有任何想法吗?

Apache上的永久redirect不起作用

我在Windows 2008上有一个Apache 2.4服务器,作为一个反向代理工作得很好。 它提供在Glassfish 3.0上运行的LifeRay 6.0安装的内容。 最初,当我们实施https永久性redirect时,我们不能再loginLifeRay,但是现在我已经解决了这个问题。 一旦我们login到Liferay,连接是安全的,但仍然可以将https更改为http,页面将显示为http连接,而不会恢复为https。 而且,到站点的初始连接可以使用http,如果用户没有login,站点将继续使用http连接。 再次,我虽然redirect永久会强制所有HTTPstream量为https。 Apache向用户提供SSL连接,proxypass指令在不安全的端口上连接到LifeRay,这不是问题,因为内部连接是虚拟的,不能从Internet访问。 所以,我虽然有configuration钉在这个,但我必须失去一些东西,因为我似乎能够访问该网站与http时,我认为永久redirect会阻止。 ProxyPassReverse应该是https而不是http? 这是configuration: testing服务器 <VirtualHost *:443> ServerName test.myexternalserver.org # ProxyPreserveHost On SetEnv proxy-sendchunked SSLEngine on ProxyPass / http://192.168.80.196:8080/ ProxyPassReverse / http://192.168.80.196:8080/ </VirtualHost> <VirtualHost *:80> ServerName test.myexternalserver.org ProxyPreserveHost On SetEnv proxy-sendchunked Redirect permanent / https://test.myexternalserver.org/ ProxyPass / http://192.168.80.196:8080/ ProxyPassReverse / http://192.168.80.196:8080/ </VirtualHost>

Apache永久redirect从path中删除斜杠

我使用Apache 2.4,并设置了两个虚拟目录。 一个需要SSL,另一个redirect到它。 如果用户尝试访问不存在/ derp的https://www.derp.com/derp ,则他们会正确获得404。但是,当用户访问http://www.derp.com/derp ,Apache会错误地redirect用户到https://www.derp.comderp ,删除path和域名之间的斜线。 我不知道是什么原因造成的。 以下是我的虚拟主机的设置。 <VirtualHost *:443> ServerAdmin [email protected] ServerName www.derp.com ServerAlias derp.com DocumentRoot "C:\Users\derp\Documents\Web Projects\derp" SSLEngine on SSLCertificateFile "C:\Apache24\certs\cert.cer" SSLCertificateKeyFile "C:\Apache24\certs\key.key" </VirtualHost> <VirtualHost *:80> ServerAdmin [email protected] ServerName www.derp.com ServerAlias derp.com Redirect permanent / https://www.derp.com/ </VirtualHost> <Directory "C:\Users\derp\Documents\Web Projects\derp"> Options Indexes FollowSymLinks Includes ExecCGI AllowOverride All Require all granted SSLRequireSSL […]

HHVM通过debian上的Apache mod_fastcgi

我已经可以很容易地让facebook hhvm从预编译的debian包开始工作,并编译它,然后在apache后面运行它作为代理。 代理设置的问题是,虽然我不能得到除了http状态码200以外的响应标题 – 例如304,通过。 这不是apache的代理configuration,而是hhvm和apache交互的东西,甚至是hhvm。 无论如何,HHVM正式停止支持独立的服务器,他们正在转向fastcgi,并且由于我们所有的服务器都在运行Debian,所以我没有编译mod_proxy_fastcgi的权限(我find的只有apache 2.4的唯一的backports不幸的mod_proxy_fastcgi backported)。 所以我目前正试图让HHVM运行在Apache 2.2之后的旧mod_fastcgi之后。 但目前我只是在Apache的错误日志中获得“connect()失败”,而hhvm正在侦听:::1080 我的apacheconfiguration的重要部分是 RemoveHandler application/x-httpd-php FastCgiExternalServer /home/www/hhvm/hostname/htdocs/php5.fcgi -flush -host ip6-localhost:1080 AddType application/x-hhtpd-fastphp5 .php Action application/x-httpd-fastphp5 /php5.fcgi Alias /php5.fcgi /home/www/hhvm/hostname/htdocs/php5.fcgi netstat也列出hhvm作为监听::: 1080,我可以通过telnet连接到它 任何想法,我需要改变,所以它的作品? PS:不幸的是我没有足够的代表在这里创build一个hhvm标签 PPS:最初张贴在这里stackoverflow: https : //stackoverflow.com/questions/20410432/hhvm-through-apache-mod-fastcgi-on-debian

正好90秒重新启动Apache httpd

我有一个openSUSE 13.1虚拟机(主机运行Virtualbox 4.2.18,也在openSUSE 13.1上),重新启动httpd(Apache / 2.4.6)总是需要1.5分钟: foobar:~ # time /etc/init.d/apache2 restart redirecting to systemctl restart apache2.service real 1m30.778s user 0m0.004s sys 0m0.000s 随即重启是正常的(非常快): foobar:~ # time /etc/init.d/apache2 restart redirecting to systemctl restart apache2.service real 0m1.023s user 0m0.004s sys 0m0.000s 5分钟后,重新启动时间又回到正好90秒: foobar:/tmp # time /etc/init.d/apache2 restart redirecting to systemctl restart apache2.service real 1m30.684s user 0m0.000s sys […]

Apache在特定的文件夹覆盖身份validation

如何更改/重写在Apache的身份validation到子文件夹中的不同? 我试过这个,但是没有奏效。 我该如何解决? <Directory "/"> AuthName "Front End Access" AuthType Basic AuthBasicProvider file AuthUserFile "xxxxxxx/.htpasswd_frontend" Require valid-user </Directory> <Directory "/backend/"> AuthName "Back End Access" AuthType Basic AuthBasicProvider file AuthUserFile "xxxxxxx/.htpasswd_backend" Require valid-user </Directory> 我已经做了search,他们展示了如何禁用身份validation,但我不想禁用它:我想将AuthUserFile更改为不同的身份(并可能更改AuthName) 先谢谢你

我不能正确configuration到期的标头为Apache

我正在尝试在apache2上configuration静态js / css / img的caching(我正在使用ubuntu )。 由于这个答案,我不想使用.htaccess 。 所以我尝试了以下几点: 启用modexpires 通过添加以下内容修改/etc/apache2/sites-available/000-default.conf ExpiresActive On ExpiresByType image/gif "access plus 1 months" ExpiresByType image/jpg "access plus 1 months" ExpiresByType image/jpeg "access plus 1 months" ExpiresByType image/png "access plus 1 months" ExpiresByType image/vnd.microsoft.icon "access plus 1 months" ExpiresByType image/x-icon "access plus 1 months" ExpiresByType image/ico "access plus 1 months" […]

在openSUSE上进行TEX Live更新后,为Apache(wwwrun)和所有用户添加PATH环境variables的path

在安装TEX Live 2013之后(我承认已经过时了)openSUSE 11.3(x86_64)我需要将path /usr/local/texlive/2013/bin/x86_64-linux到PATH环境variables中: 全部用户 阿帕奇 几小时的谷歌search结束了: 使用内容export PATH=$PATH:/usr/local/texlive/2013/bin/x86_64-linux创build文件/etc/profile.d/texlive.sh export PATH=$PATH:/usr/local/texlive/2013/bin/x86_64-linux在计算机重新启动后为用户做了一些技巧 。 添加(作为最后一行) export PATH=$PATH:/usr/local/texlive/2013/bin/x86_64-linux到/etc/sysconfig/apache2为Apache工作 。 它工作,但我不确定2件事情: 将文件添加到/etc/profile.d后真的有必要重新启动服务器吗? 有没有什么办法来重新加载环境? PATH环境variables更改时更改Apache的configuration文件是正确的吗? 没有办法在Apache启动前简单地改变这个variables吗? 感谢任何答案!

使用ProxyPassMatch复制mod_fastcgi(PHP-FPM设置)

我想从Apache 2.2移动到Apache 2.4,但是没有mod_fastcgi ,推荐的升级path是mod_proxy_fcgi 但是我不知道如何完成以下内容: <IfModule mod_fastcgi.c> Alias /php5.fcgi /usr/local/www/fastcgi/php5.fcgi FastCGIExternalServer /usr/local/www/fastcgi/php5.fcgi -flush -host 127.0.0.1:9000 AddType application/x-httpd-fastphp5 .php Action application/x-httpd-fastphp5 /php5.fcgi <Directory "/usr/local/www/fastcgi/"> Order deny,allow Deny from all <Files "php5.fcgi"> Order allow,deny Allow from all </Files> </Directory> </IfModule> 这允许所有的虚拟主机和所有需要PHP使用一个PHP-FPM进程,新的ProxyPassMatch要求我为每个虚拟主机设置一个单独的条目,这是耗时且容易出错的… ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/path/to/vhost/$1 现在我已经恢复到了Apache 2.2,但我很想find解决这个问题的方法。

WebSocket连接在收到握手响应之前closures

由于WebSocket连接,我面临的问题,并由于这个其他的反应,停止接收。 我configuration了BIMServer来响应我的应用程序,并渲染3D视图加载个别组件在查看器(popup窗口)。 我在谷歌浏览器中收到以下错误。 连接到'wss://?/ bimserver / stream'的WebSocket失败:连接在收到握手响应之前closures 我曾经试过 我试图通过使用proxyPass在apache 2.4.7中redirect这个请求,并redirect到IP的实际地址。 我想知道如何configurationapache2.4.7忽略wss请求。