Articles of apache 2.2

如何通过.htaccess启用Gzip或Deflate压缩?

如何通过.htaccess启用Gzip或Deflate压缩,以及哪一个最好? 代码示例需要。

替代阿帕奇基准?

我想用Ubuntu的一些工具来testing我的服务器,它可以处理多less。 有什么build议么? 我之前使用过apache的基准testing,但是我想尝试一下其他的东西。 (作为一个侧面的问题,如果我只使用nginx,apache基准testing工作吗?)

我如何得到Apache2parsing(没有错误)在.htaccess的头指令?

我正在加载500内部服务器错误的页面,因为我相信一个指令,Apache尚未configuration为允许。 我有AllowOverride设置为全部,一个.htaccess文件,包括: <FilesMatch "\.(eot|ico|pdf|flv|jpg|jpeg|png|gif|svg|swf|ttf|woff)$"> Header set Cache-Control "max-age=31536000, public" Header set Expires "Wed, 23 Apr 2014 17:00:01 UTC" </FilesMatch> /var/log/apache2/error.log有: [Sat Jul 20 15:12:36 2013] [alert] [client 24.15.83.241] /home/jonathan/.htaccess: Invalid command 'Header', perhaps misspelled or defined by a module not included in the server configuration 我需要指定什么,以便Apache2将正确处理“Header”指令?

如何将HTML代码注入到每个交付的HTML页面?

我有一个提供静态HTML页面的Apache web server 。 出于某种原因,我不能自己改变这些文件,但是我仍然希望在每一个被提供的页面中注入一些HTML。 这是可能的mod_proxy ? 如果没有,任何人都可以推荐一个提供这样的function的软件? 编辑:我必须插入某种横幅广告(例如一个javascript )和一个跟踪像素。

如何在CentOS上安装Apache Benchmark?

我试图安装Apache基准使用是否有一种方法来安装Apache Bench(ab)没有在我的yumdownloader httpd上安装Apache解决scheme,但是当我运行yumdownloader httpd ,我得到错误: root@local [~/httpd]# yumdownloader httpd Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: yum.phx.singlehop.com * elrepo: repos.lax-noc.com * extras: centos.tcpdiag.net * updates: mirror.stanford.edu No Match for argument httpd Nothing to download 它是什么? 我该如何修复它? 编辑1:我尝试使用迈克尔汉普顿的方式,但我得到这个错误: root@local [~]# yum provides /usr/bin/ab Loaded plugins: fastestmirror, security Loading mirror speeds from cached […]

是authorized_keys的中心位置是个好主意吗?

我正在configuration云服务器来运行以下堆栈:Ruby,Passenger,Apache; 在Ubuntu 10.04(Lucid Lynx)下。 在想让服务器更容易pipe理的过程中,我在root上设置了RSA密钥,并在www-data上设置了ssh密钥,这样我就可以进入服务器了。 我不喜欢的是www-data的.ssh目录位于/var/www这是默认的apache目录设置。 我担心的是,如果Apacheconfiguration不正确,那么.ssh目录可能被暴露。 我遇到了解决scheme,通过更改/etc/ssh/sshd_config AuthorizedKeysFile将~/.ssh/authorized_keys文件移动到中央位置。 这有2个优点:一个键位置,而不必担心一个糟糕的Apacheconfiguration。 我能想到的单一的骗局是,现在每个用户都可以在服务器上login(显然是中央密钥文件的双刃剑)。 有没有什么我在这个configuration错过了? 我是否暴露自己,或者这是一个比个人authorized_keys文件更好的解决scheme? 在服务器pipe理方面,我是绿色的 ,但是完全可以被称为坏名字来做坏事。 :d

我应该将Rails应用程序部署到什么目录?

什么是在Linux系统上部署我的生产Rails应用程序的合理和合理的目录? 一些候选人… /var/rails <= There's a /var/www so this would be consistent with that pattern. But IT guys have complained about stuff in /var before. /home/my_home_dir/rails <= OK, not /var, but I'm not the only developer. Seems like it really ought to be a systemwide location. /home/rails <= I don't know. That just seems weird. […]

Subversion错误:Repository永久移动请重新定位

我在我的服务器上设置了subversion和apache。 如果我通过我的浏览器浏览它,它工作正常( http://svn.host.com/reposname )。 但是,如果我在我的机器上签出,我得到以下错误: Command: Checkout from http://svn.host.com/reposname, revision HEAD, Fully recursive, Externals included Error: Repository moved permanently to 'http://svn.host.com/reposname/'; please relocate 我检查了Apache的错误日志,但它什么也没说。 (现在呢 – 看看编辑) 我的存储库存储在:/ var / www / svn / repos / 我的网站存储在:/ var / www / vhosts / x / … 这里是子域的conf文件: <Location /> DAV svn SVNParentPath /var/www/svn/repos/ AuthType Basic […]

我怎样才能看到每个Apache虚拟主机使用多less带宽?

我已经build立了Apache服务几个虚拟主机,我想看看每个站点使用多less带宽。 我可以看到整个服务器使用了多less,但是我想要更详细的报告。 我发现的大部分事情都是为了限制虚拟主机的带宽,但我不想这么做。 我只想看看哪些网站正在使用多less带宽。 这不是用于计费的目的,仅供参考。 有我应该使用的apache模块? 还是有其他的方法来做到这一点?

使用mod-proxy和SSL的Apache VirtualHost

我试图设置一个服务器与多个Web应用程序,这将通过Apache的VirtualHost(在同一台服务器上运行的Apache)服务。 我的主要限制是每个Web应用程序都必须使用SSLencryption。 在googlesearch了一会儿之后,在stackoverflow上查看其他问题,我为VirtualHost编写了以下configuration: <VirtualHost 1.2.3.4:443> ServerName host.domain.org <Proxy *> Order deny,allow Allow from all </Proxy> SSLProxyEngine On ProxyRequests Off ProxyPreserveHost On ProxyPass / https://localhost:8443/ ProxyPassReverse / https://localhost:8443/ </VirtualHost> 即使https://host.domain.org:8443可以访问,但是https://host.domain.org不是,这打破了我的虚拟主机configuration的目的。 Firefox抱怨说,即使成功连接到服务器,连接也被中断。 我也在apache error.log中得到以下警告: proxy: no HTTP 0.9 request (with no host line) on incoming request and preserve host set forcing hostname to be host.domain.org for uri […]