Articles of Apache的2.2

closuresApache连接(HTTP下载)

我有一个服务器,承载大型文件,用户可以通过网站下载。 我的问题是,如果我禁用用户帐户,而用户正在下载文件,浏览器仍然会完成下载。 这就是我想要做的: 1. Find the active process responsible for the current (download) connection 2. Kill the process – so that users browser fails to download the file. 我怎样才能完成第一步? Apache,PHP或其他东西是否负责文件传输本身? 我真的无能为力,从这里走了。谢谢!

在Apache2上像GET一样处理PUT

当我请求PUT ,我得到405 Method Not Allowed 。 我在互联网上看到, PUT是用于DAV的。 但是我不想使用DAV,我想让PUT像GET一样工作。 我在Linux和Windows上尝试使用Limit , LimitExcept , Rewrite 。 我得到了PHP5(我认为这不是过滤的),APACHE 2.2和Ubuntu服务器12.04。 感谢帮助。

如何阻止在Apache的IP地址?

到目前为止,我只能够阻止每个主机的IP地址,我想阻止所有主机在Apache的IP地址。 我试过了各种各样的组合 <Directory /var/www/html> Options FollowSymLinks AllowOverride All Order allow,deny Allow from all deny from aa.bb.cc.dd deny from ee.ff.gg.hh </Directory> 目录,位置等…但是我所尝试的所有选项都不做任何事情,或者导致其他.htaccess文件被忽略,导致我的站点的私有区域被打开。

在CentOS 6.4上使用远程MySQL的LAMP服务器

我是相当新的Linux和LAMP设置。 我想在一台Linux服务器上设置AP的LAMP环境,在另一台Linux服务器上设置M。 我很难用这样的configurationfind相关的文档。 到目前为止,我已经完成了以下步骤: server1的: yum install -y httpd /sbin/service httpd restart yum install -y php php-mysql sed -i "s/Listen 80/#Listen 80/g" /etc/httpd/conf/httpd.conf yum install -y mod_ssl openssl /sbin/service httpd restart service iptables stop 我从/etc/httpd/conf/httpd.conf中更改了ServerName #ServerName www.example.com:80 至 ServerName 172.32.35.14 (ip address of server1) /sbin/service httpd restart 服务器2: yum install -y mysql-libs yum install -y […]

即使提供了身份validation,也拒绝访问位置

我们有一些Apache服务器,包括各级密码保护。 例如,对于testing/登台系统,我们有/密码保护,并要求具体的用户名: <Location /> AuthType Basic AuthName "By Invitation Only" AuthUserFile /etc/httpd/conf/passwd Require user staging demo test </Location> 在相同的设置,我们也保护其他地点: <Location /api/billing> AuthType Basic AuthName "Billing" AuthUserFile /etc/httpd/conf/billingpasswd Require user billing </Location> 我现在被要求限制另一个基于IP地址的位置。 在这种情况下,以前的所有密码都应该像原来那样工作,但是即使提供了密码,我们也希望仅基于IP来拒绝对新位置的访问。 <Location /newlocation> Order Deny,Allow Deny From All Allow From 1.2.3.4/24 </Location> 如果这个新的Location指令包含Satisfy All则即使尝试连接,即使从一个允许的子网连接,也会得到403(禁止)错误。 如果我将其更改为“ Satisfy Any则无论是否允许,我都可以从任何IP地址连接到/ newlocation。 无论其他身份validation可能成功,限制基于IP的新位置访问的正确方法是什么? 这些Apache服务器只是Tomcat应用程序的前端,所以没有可以放入.htaccess文件的实际目录结构。

Apache 2.2不会启动

百胜更新后,我的Apache不会启动,我得到了以下错误: # service httpd restart Stopping httpd: [FAILED] Starting httpd: httpd: Syntax error on line 13 of /etc/httpd/conf/httpd.conf: Cannot load modules/mod_authn_alias.so into server: /etc/httpd/modules/mod_authn_alias.so: cannot open shared object file: No such file or directory [FAILED] 第13行如下: Header: PidFile run/httpd.pid # MR — must be disable here because can not overrite! — importance for proxy-to-apache # […]

Apache替代模块来replace主机的URL

我试图用(https:\ / \ / test1.com \ /)replace脚本中的url(http:\ / \ / test.com \ /)。 有人可以给我的替代规则来识别和replace的url

使用Apache将子域中的请求路由到端口

我有一个域(例如example.net ),运行在端口443上的Apache实例。在与example.com相同的主机上,我有一个运行在端口9000上的web应用程序,所以我可以访问它,如果我去https://example.net:9000在我的浏览器中。 我想要的是添加一些条目到我的Apacheconfiguration,使我可以通过一个更好的链接访问端口9000上运行的应用程序,如http://example.net/my-app 。 我努力了 <Location /my-app/> ProxyPass http://localhost:9000/ ProxyPassReverse http://localhost:9000/ </Location> 我确实可以检索my-app程序my-app程序的索引,但它混淆了页面上的所有Javascript和CSS引用。 我想要的东西,将完全模仿当我去example.net:9000时会发生什么。

将所有查询redirect到apache中的子域

我有一个HTTPS网站,我想将所有的根请求redirect到www子域。 我尝试了一些命令,但它是404的服务器,因为它是为.htaccess。 这是我的网站可用的configuration: <VirtualHost 10.10.10.11:80> ServerName *.mydomain.com DocumentRoot /srv/production/www/my_app/current/public/ RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} </VirtualHost> <VirtualHost 10.10.10.11:443> ServerName www.mydomain.com DocumentRoot /srv/production/www/my_app/current/public/ <Directory /srv/production/www/my_app/current/public/> Allow from all Options -MultiViews </Directory> SSLEngine on SSLCertificateFile /********** SSLCertificateKeyFile /************** SSLCertificateChainFile /************* </VirtualHost>

Apache服务器状态不显示“服务器负载”

Apache的服务器状态页面显示来自mod_status的信息。 它不显示服务器负载: 但是您会注意到, Apache.org/ server- status状态页面确实显示了 服务器负载 : 在以前的服务器上,我用它总是显示。 为什么是这样? 如何启用服务器负载 ?