Articles of apache 2.2

如何使用apache2中的VirtualHosts移动子域名?

需要一些帮助来redirect到一个移动子域名。 目前,m.domain.com和domain.com都将转到var / www / html / mobile。 很明显,我需要domain.com指向var / www / html和m.domain.com到var / www / html / mobile 我已禁用ServerName和我的别名是正确的.. 目前我的虚拟主机是: <VirtualHost *:80> ServerName DOMAIN.com DocumentRoot "/var/www/html" </VirtualHost> #VirtualHost to redirect m.DOMAIN to mobile directory <VirtualHost m.DOMAIN.com:80> ServerName m.DOMAIN.com DocumentRoot "/var/www/html/mobile" </VirtualHost> 有人能指点我的方向吗?

将strace连接到100%CPU Apache进程 – 输出

我遇到了使用100%CPU的Apache2产卵进程的问题。 将strace连接到这样的进程之一,有时会产生输出,有时会给出这个结果: 2672 17:18:07 poll([{fd=14, events=POLLIN|POLLPRI}], 1, 0) = 0 (Timeout) 2672 17:18:07 write(14, "\236\3\0\0\3SELECT FLOOR(((price_index."…, 930) = 930 2672 17:18:07 read(14, "\1\0\0\1\2\33\0\0\2\3def\0\0\0\5range\0\f?\0\r\0\0\0\10\0"…, 16384) = 85 我会很感激任何想法来解释上述。

Apache和自定义HTTP方法

是否有可能使Apache接受自定义的HTTP方法? 假设我想发送DESCRIBE方法。 我试图启用它在限制指令,但Apache返回405方法不允许。 这是我的configuration,它在mod_userdir 。 <Directory /home/*/public_html> AllowOverride All Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec <Limit GET POST PUT DELETE OPTIONS DESCRIBE> Order allow,deny Allow from all </Limit> <LimitExcept GET POST PUT DELETE OPTIONS DESCRIBE> Order deny,allow Deny from all </LimitExcept> </Directory> 我也在该configuration中启用了PUT和DELETE方法,因为默认configuration不允许PUT和DELETE 。

如何导入Apache + LDAPS的证书?

我正试图让ldaps通过Apache 2.2.17(Windows Server 2008)工作。 如果我使用ldap(纯文本),我的configuration很好。 LDAPTrustedGlobalCert CA_DER C:/wamp/certs/Trusted_Root_Certificate.cer LDAPVerifyServerCert Off <Location /> AuthLDAPBindDN "CN=corpsvcatlas,OU=Service Accounts,OU=u00958,OU=00958,DC=hca,DC=corpad,DC=net" AuthLDAPBindPassword ..removed.. AuthLDAPURL "ldaps://gc-hca.corpad.net:3269/dc=hca,dc=corpad,dc=net?sAMAccountName?sub" AuthType Basic AuthName "USE YOUR WINDOWS ACCOUNT" AuthBasicProvider ldap AuthUserFile /dev/null require valid-user </Location> 我也尝试了CA_DER之外的其他encryption选项,以确保安全,没有运气。 最后,我还需要Apache Tomcat。 对于tomcat,我使用了tomcat JRE并运行了这样一行: keytool -import -trustcacerts -keystore cacerts -storepass changeit -noprompt -alias mycert -file Trusted_Root_Certificate.cer 在做了上面的行之后,ldaps通过tomcat工作了。 这让我知道我的证书是一个好的。 更新:两个ldap模块都打开,因为使用ldap而不是ldaps工作正常。 当我运行一个混帐克隆这是错误返回: C:\Temp>git […]

用phpmyadminlogin只能在Firefox下运行,不会产生错误信息

我已经设置了一个由htaccess文件保护的phpmyadmin网站。 该网站也设置为强制SSL连接。 问题是,一切工作正常,在Firefox下,而不是其他浏览器(Opera,Chrome,Midori,…)此外,与其他浏览器,我没有得到任何错误消息,使用好或不好的login只刷新login页面。 Apache / php日志中也没有任何东西。 我真的不明白为什么这只适用于Firefox。 我使用的是Debian Squeeze的最新版本的phpmyadmin 3.4.7.1和最新版本。 试用Debian仓库中的phpmyadmin版本也会导致这个错误,并且清理浏览器的cookies,甚至卸载并重新安装浏览器也无济于事。 提前感谢任何帮助!

django项目的apache + mod_wsgiconfiguration在四核上

我经常在nginx + apache2 + mod_wsgi + memcached(+ postgresql)上使用“典型”的django设置进行实验(阅读文档以及SO和SF上的一些问题,参见注释) 由于我仍然不满意的行为(绝对是因为我的一些错误configuration),我想知道这些假设是什么样子的好configuration: 四核至强2.8GHz 8演出记忆 几个django项目(与此有什么特别的关系?) 这些摘录形成我目前的confs: 编辑:我已经添加了更多的东西,使完成,但遵循格雷厄姆的build议,我将在wsgi邮件列表 apache 2(> apache2 -v) Server version: Apache/2.2.12 (Ubuntu) Server built: Nov 18 2010 21:16:51 Server's Module Magic Number: 20051115:23 Server loaded: APR 1.3.8, APR-Util 1.3.9 Compiled using: APR 1.3.8, APR-Util 1.3.9 Architecture: 64-bit Server MPM: Worker threaded: yes (fixed thread count) […]

服务器极其滞后并logging一堆“内部虚拟连接”

有一个networking服务器(实际上不知道它是什么,这是我的遗产)。 几个小时前,它开始工作非常(非常!)慢,mysqld通常失败的请求。 /var/log/mysqld.log是空的(好吧,它说,mysqld开始,等等,但没有关于今天) / var / log / apache2 / access_log中充满了这样的行: ::1 – – [30/Nov/2011:10:15:05 +0100] "GET / HTTP/1.0" 200 1 "-" "Apache/2.2.3 (Linux/SUSE) (internal dummy connection)" ::1 – – [30/Nov/2011:10:15:05 +0100] "GET / HTTP/1.0" 200 1 "-" "Apache/2.2.3 (Linux/SUSE) (internal dummy connection)" ::1 – – [30/Nov/2011:10:15:05 +0100] "GET / HTTP/1.0" 200 1 "-" "Apache/2.2.3 […]

设置Apache的PATH环境以匹配用户

在OS X 10.7上使用PHP 5.3作为Apache 2的Apache模块。 当我打开terminal并inputecho $PATH我得到: /opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/imagemagick/bin 但是当我在PHP中运行getevn('PATH') ,我得到: /usr/bin:/bin:/usr/sbin:/sbin 这意味着在PHP中exec()大部分调用无法find我想要的命令/二进制文件。 我已经在httpd.conf尝试了这两个: SetEnv PATH /opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/imagemagick/bin PassEnv PATH 没有任何效果。 如何获取PHP / Apache的PATHvariables来镜像我的用户PATHvariables? (理想情况下,如果我改变了Apache的话,也不需要手动改变。)

Passenger和ServerAlias不合作

我有一个运行在具有多个IP地址和多个虚拟主机的服务器上的ruby应用程序。 这是有问题的虚拟主机的configuration: <VirtualHost 10.0.0.10:80> ServerName realname.example.com ServerAlias alias.example.com DocumentRoot /var/www/sites/example/current/public <Directory /var/www/sites/example/current/public> AllowOverride all Options -MultiViews </Directory> ErrorLog /var/log/httpd/example_error_log CustomLog /var/log/httpd/example_access_log common RailsEnv production RackEnv production </VirtualHost> 当我拉起realname.example.com Ruby on Rails应用程序正常工作。 另一方面, alias.example.com只是给我Not Found: / 我相当确定正确的虚拟主机正在使用,因为alias.example.com在正确的日志文件中产生一个404。 我已经尝试将日志logging添加到Passengerconfiguration,它似乎表明Passenger正在获取请求。 注意:我无法将alias.example.comredirect到realname.example.com。 realname是使用CDN访问的,而别名是直接访问的。 任何人有任何想法,为什么这是行不通的? 我一直在b my我的头几天,而且我也有类似的QAconfiguration,按预期工作。

获取Apache2.2以隐藏正在编辑的Microsoft文档?

我有一个htdocs目录,我正在服务几个Microsoft Word文档。 当某人正在编辑文档时,文档的名称会变成如下所示:“ 〜$ my_document.doc ”,还会创build代表文档编辑的.tmp文件,直到文档closures。 所以,我希望Apache在用户完成编辑之前不要提供这些文件。 所以,我想隐藏以.tmp扩展名结尾的文件,同时隐藏以“ 〜$ ”开头的文件。 那么,任何人都可以帮助我提高这个Apache指令来完成这个? <Directory "C:/Apache2.2/htdocs"> <Files ~ "\.tmp$"> Order allow,deny Deny from all </Files> ….. </Directory> 这是一个正常的expression技巧,现在超出了我的能力。