Articles of apache 2.4

Apache 2.2到2.4升级,服务器限制似乎被忽略

我最近从apache 2.2升级到2.4(作为从Debian wheezy升级到debian jessie的一部分),我从拥有足够的空闲时隙来处理需求激增几乎没有。 Apache似乎忽略了我的configuration设置。 根据https://httpd.apache.org/docs/trunk/upgrading.html一些选项已被重新命名,但旧名称应仍然工作。 我尝试改变名称到新的名称,但没有任何区别。 我也试着评论一下围绕指令的“模块”,但没有什么区别。 我目前在我的apache2.conf #<IfModule mpm_worker_module> ServerLimit 24 StartServers 10 MinSpareThreads 25 MaxSpareThreads 75. ThreadLimit 64 ThreadsPerChild 64 MaxRequestWorkers 1536 MaxConnectionsPerChild 0 #</IfModule> 目前apache2ctl显示。 Apache Server Status for localhost (via 127.0.0.1) Server Version: Apache/2.4.10 (Debian) mod_mirrorbrain/2.18.1 Server MPM: worker Server Built: Nov 28 2015 14:05:48 ———————————————————————- Current Time: Thursday, 02-Jun-2016 […]

如何用Apache mod_proxy_fcgi指定FastCGI参数?

PHP-FPM文档说可以从Web服务器传递自定义的php指令, 这里有一个Nginx的例子 。 是否有可能,以及如何使用Apache-2.4和mod_proxy_fcgi来做同样的事情? 作为一个例子,我想为不同的虚拟主机设置一个不同的open_basedir ,它们都运行在同一个PHP-FPM池中。

Nginx作为运行WordPress的Apache服务器的代理

我正在面对一个类似的问题,在这里我使用Nginx作为运行WordPress的Apache服务器(Ubuntu)的代理。 网站的内部链接都给301本地主机redirect。 例如,链接: wwww.example.com/internal-linkredirect到localhost/internal-link ,它给出了错误404。 Apache的configuration如下: <VirtualHost *:80> <Directory /var/www/html> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all Require all granted </Directory> ServerAdmin [email protected] ServerName example.com ServerAlias www.example.com ServerAlias *.example.com DocumentRoot /var/www/html … Nginxconfiguration文件如下: server { # Where IP is server IP and example is the domain name listen IP:80; server_name static.example.com; […]

无法删除Apache2 Ubuntu默认页面

已经完成了: a2dissite 000-default.conf 和 service apache2 restart 所以符号链接已成功从站点启用的目录中删除。 但是我仍然可以看到testing页面。 怎么了? 我不应该看到一个错误吗?

如何判断哪个Web节点正在提供内容?

我有一个负载均衡器,将stream量分配给5个Web节点中的1个。 是否有一种简单的方法可以告诉我正在谈论什么Web节点,当它服务于我的内容。 例如,我是否在Apache中实现了一个Header? 在每个页面上添加一个隐藏的HTML元素? 奖励要点:人们做什么来强制自己到一个特定的networking节点?

尽pipe有重写规则,Apache还是会添加尾随斜线

我正在使用一个简单的.htaccess来处理一切与PHP脚本: RewriteEngine on RewriteRule . index.php 我的index.php只是回应服务器variables(使用print_r($_SERVER) ); 一切工作正常,我在URL中input任何东西,并显示index.php内容。 但是,考虑到这种结构: test/ # document root folder/ # empty folder index.php .htaccess 我注意到访问[site]/folder首先将浏览器redirect到[site]/folder/ ,然后显示正确的index.php内容。 为什么发生这种情况? 是不是重写规则应该redirect一切“原样”? 这与虚拟主机一起使用,以在本地testing网站。 configuration与最低限度。 在我的.htaccess之前是否可以加载其他的apache文件? <VirtualHost *:80> ServerName test.local DocumentRoot /Library/WebServer/Documents/test/ </VirtualHost> 目前使用OS X 10.10。

无法加载mod_rewrite Apache模块

我正在尝试使用Apache24 server mod_rewrite模块,但我无法加载它。 我知道有很多关于这个话题的问题,我经历了所有这些,但似乎没有任何工作。 这些是我一直沿用的步骤— CHANGED httpd.conf文件进行了这些更改: 一个。 LoadModule rewrite_module modules/mod_rewrite.so 湾 将AllowOverride None更改为AllowOverride All 重新启动Apache服务器 使用命令提示符命令httpd -M检查加载的模块。 我可以看到那里的mod_rewrite模块已经加载。 我附上下面的图片。 但执行所有这些步骤后,我看不到mod_rewrite作为加载模块在phpinfo 。 如上图所示,没有装载mod_rewrite模块。 另外作为一个狂野的黑客,我甚至尝试使用.htaccess文件重写url,但这是行不通的。 Apache似乎忽略了.htaccess文件,尽pipe我把这个文件放在我的根目录下。 Note: I am running `PHP` as an apache module Using `WAMP` stack Using `localhost` as server 我需要这个模块严重的URL重写的目的。 你们可以build议一些其他的方式来加载这个模块? 编辑 我试图从虚拟主机重写URL,因为答案表明模块已加载,它不依赖于.htaccess和info.php 。但stil不是redirect。 我在下面添加Virtual host设置— <VirtualHost *:80> <Directory "/Apache24/htdocs"> Options FollowSymLinks AllowOverride […]

添加SSLRequireSSL指令后,HTTPS不再起作用

我有一台Mac Mini Server,运行macOS Sierra(10.12.2)和macOS Server(5.2)。 这是一个内置的Apache服务器,它被设置为监听端口80和443。 文档可以通过HTTP和HTTPS访问。 但是,只要在.htaccess文件中使用SSLRequireSSL指令,就会停止工作。 在浏览器中,当访问https://www.example.com/path/document ,我看到以下内容: 被禁止 您无权访问此服务器上的/path/文档。 Apache服务器在www.example.com端口80 请注意,错误消息提到端口80,即使它通过HTTPS /端口443服务(我用curl检查了这一点 – 所以浏览器redirect不是一个问题在这里)。 但这可能与问题的根源有关。 在Apache错误日志中,显示以下内容: [Sun Jan 29 16:38:07.674342 2017] [ssl:error] [pid 82204] [client 127.0.0.1:50195] AH02219:访问/ Users / Glorfindel / wwwroot / path / document失败,原因:需要SSL连接 .htaccess文件中的其他指令也可以工作(例如Options -Indexes )。

反向代理到Cloudfront CDN

我们希望将所有请求转发到domain.com/foo到Cloudfront前面的S3 Bucket。 这个想法是我们的​​域名是在从S3 / Cloudfront加载内容的时候使用的。 我有Apache安装程序将代理请求反向地转换为/foo : <Location /foo> RequestHeader set X-Forwarded-Proto "https" ProxyPassReverseCookiePath / /foo ProxyPass http://bar.cloudfront.net/ ProxyPassReverse http://bar.cloudfront.net/ </Location> 但是,当我点击domain.com/foo我得到了来自Cloudfront的403 Forbidden 。 我试着添加头RequestHeader set Host "bar.cloudfront.net" ,页面加载,我看到在s3桶中的内容,但是,然后该域显然是CDN域。 更新: 我将Apacheconfiguration中的云端URLreplace为s3存储区的公用URL,并在保留主机名的情况下工作。 所以我相信这证实了Cloudfront的一个问题。 我在CloudFront上将我们的域名添加为CNAME。 然后使用/foo将RequestHeader set Host为我们的域名。 这会保留主机名称,但会导致CloudFront发生400错误。

502当上游服务错误时,“从远程服务器读取错误”

我有一个Apache设置为反向代理。 当上游服务有错误(例如500)时,错误不会返回给客户端,而是apache提供502“从远程服务器读取错误”。 我想将原始错误返回给客户端。 注意,当上游服务正常工作(200 OK),然后Apache返回预期的响应。 500回应被掩盖。 直接调用上游服务返回正确的500响应和内容没有问题。 这就是我们现在所拥有的: ProxyPass "/path" "http://host:port/path" ProxyPassReverse "/path" "http://host:port/path" 而服务返回500时的回应 Bad Gateway! The proxy server received an invalid response from an upstream server. The proxy server could not handle the request GET /path/to/resource. Reason: Error reading from remote server If you think this is a server error, please contact the […]