Articles of apache 2.2

别名目录中的mod_rewrite不能正常工作

我有一个wp博客,它位于/var/www/mysite.com/blog,可通过www.mysite.com/blog访问 当访问www.mysite.com/blog/我看到索引页面,但子目录上的所有链接不再工作,例如:www.mysite.com/blog/my-great-article正在抛出(apache日志): File does not exist: /var/www/mysite.com/web/blog/my-great-article, referer: http://www.mysite.com/blog/ 虚拟主机: Alias /blog "/var/www/mysite.com/web/blog" <Location "/blog"> Allow from all AddType application/x-httpd-php php php4 php3 html htm </Location> .htacess in / blog dir: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /blog/ RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /blog/index.php [L] </IfModule> […]

NameVirtualHost *:80没有虚拟主机

当我启动httpd它说: NameVirtualHost *:443 has no VirtualHosts NameVirtualHost *:80 has no VirtualHosts 但是我configuration了一个虚拟主机,如下所示: httpd.conf中: Listen 80 NameVirtualHost *:80 NameVirtualHost *:443 Include /etc/httpd/conf/sites-enabled/ 在启用网站的目录中有一个符号链接: 900-tennisconnect.eu.vhost -> /etc/httpd/conf/sites-available/tennisconnect.eu.vhost 错误可能是在这里(在tennisconnect.eu.vhost文件中): # Apache did not start after modifying this vhost file. # Please check file /etc/httpd/conf/sites-available/tennisconnect.eu.vhost.err for syntax errors. 它说,Apache没有启动? 但是当我做“服务httpd状态”它说服务正在运行 最后但并非最不重要的,tennisconnect.eu.vhost.err文件: <Directory /var/www/tennisconnect.eu> AllowOverride None Order Deny,Allow Deny from […]

ScriptAlias使请求匹配太多的位置块。 到底是怎么回事?

我们希望将我们的开发服务器上的访问权限限制为拥有有效的SSL客户端证书的用户。 我们在Debian 6上运行Apache 2.2.16。 但是,对于某些部分(主要是git-http,在https://my.server/git/上使用gitolite进行设置),我们需要一个例外,因为许多git客户端不支持SSL客户端证书。 我已经成功地为服务器要求客户端证书authentication,并为某些位置添加了例外情况。 但是,似乎这不适合git。 目前的设置如下: SSLCACertificateFile ssl-certs/client-ca-certs.crt <Location /> SSLVerifyClient require SSLVerifyDepth 2 </Location> # this works <Location /foo> SSLVerifyClient none </Location> # this does not <Location /git> SSLVerifyClient none </Location> 我也尝试了一种替代解决scheme,结果相同: # require authentication everywhere except /git and /foo <LocationMatch "^/(?!git|foo)"> SSLVerifyClient require SSLVerifyDepth 2 </LocationMatch> 在这两种情况下,没有客户端证书的用户可以完全访问my.server / foo /,但不能访问my.server / […]

从lsof和Apache strace追踪难以捉摸和缓慢的anon_inode

遇到一个LAMP应用程序的间歇性问题,其中Apache分叉到它的ServerLimit和研磨到(近)停止。 任何httpd进程的strace都会显示很多慢的epoll_wait调用。 1.254721 epoll_wait(14, {{EPOLLIN, … 3.296430 epoll_wait(14, {{EPOLLIN, … 1.018047 epoll_wait(14, {{EPOLLIN, … 1.279721 epoll_wait(14, {{EPOLLIN, … 1.145649 epoll_wait(14, {{EPOLLIN, … 1.269836 epoll_wait(14, {{EPOLLIN, … 1.094779 epoll_wait(14, {{EPOLLIN, … 1.205911 epoll_wait(14, {{EPOLLIN, … 9.052785 epoll_wait(14, {{EPOLLIN, … 1.116279 epoll_wait(14, {{EPOLLIN, … 1.027709 epoll_wait(14, {{EPOLLIN, … 1.178679 epoll_wait(14, {{EPOLLIN, … 1.336032 epoll_wait(14, {{EPOLLIN, … 2.541861 […]

如何只允许Apache中的某些文件

我想过滤访问某些文件在Apache。 我只想要CGI访问。 所以我试着把vhost文件放进去: <FilesMatch "\.cgi$"> Order allow,deny Allow from all </FilesMatch> <FilesMatch "."> # All other files Order allow,deny Deny from all </FilesMatch> 但是后者压倒一切。 谢谢

Apache2configuration为ReverseProxy隐藏Cookie由后端服务器设置?

我使用Apache 2.2.16作为反向代理。 对于静态网站,我没有任何问题。 但是,当开始使用cookie时,我注意到浏览器正在接收不同于后端服务器发送的cookie。 我用Wireshark证实了这一点。 这是我的configuration的一个片段: <VirtualHost *:80> ServerName app.somewhere.com:80 ServerAlias app ProxyRequests Off ProxyPreserveHost On <Proxy *> Order deny,allow Allow from all </Proxy> ProxyPass /app http://10.xxx/app ProxyPassReverse /app http://10.xxx/app <Location /> Order allow,deny Allow from all </Location> </VirtualHost> 但是,当我尝试直接访问应用程序服务器,我收到cookies确定。 这是Apache2的预期行为吗? 我正在使用HAProxy的另一个应用程序发送cookie到客户端,我得到他们所有人。

configurationSSL主机能够访问多个域上的HTTP / HTTPS?

我有麻烦configuration我的Apache服务器(CentOS)上的多个SSL主机。 最初我以为问题只有一个IP,所以一旦发现这个问题,我要求我们的服务器提供商添加他们所做的另一个IP。 不过,我仍然有问题。 我们希望能够对我们的域名domain1.com&domain2.com以及各个子域名拥有http和https访问权限。 我有机器上的证书,密钥和中级证书(对于这两个域),这些似乎没有问题。 情况是,所有的HTTP网站工作正常,第一个SSL域正在工作,但当我尝试通过HTTPS访问第二个域时,我得到一个安全错误(说错误的证书,如显示域1的证书! 另外,服务到domain2的页面不是正确的oes(即不是DocumentRoot所说的!)。 它看起来好像是默认的所有域/ IPS的第一个SSLconfiguration。 configuration文件: THis is an excerpt from httpd.conf #### NameVirtualHost **.**.**.27:80 <VirtualHost **.**.**.27:80> DocumentRoot /var/www/html/ADDIR ServerName domain1.com ErrorDocument 404 /var/www/html/404.html </VirtualHost> # # There are other virtualhosts for other ServerNames & DocumentRoots too but they're otherwise identical to above. ### <Location "/usage"> </Location> NameVirtualHost **.**.**.41:80 <VirtualHost **.**.**.41:80> […]

OS X 10.8中的Apache服务器唤醒function

Mac OS X Mountain Lion在共享系统首选项菜单中没有Web共享框。 在Web上彻底讨论了Apache服务器是可用的,并且可以在命令行中手动打开,或者使用一个方便的Prefs窗格。 这在电脑醒着的时候起作用。 但是,当我的电脑进入睡眠状态时,即使在节能程序窗格中选中了唤醒networking访问,服务器也将停止工作。 从关于Bonjour的讨论中,我发现这个问题可能是由于Apache没有在Bonjour注册的事实造成的。 这听起来可能吗? 如果没有,请提出一些build议。 连接是通过硬连线的以太网。 如果注册与Bonjour是问题,我想知道如何注册。 你给了一个很好的dns-sd的描述,命令描述是dns-sd -R Name Type Domain Port [TXT …](注册一个服务)“,但是我不知道”Name“或“types”,或域的格式。我尝试了一些dns-sd -Bsearch,并没有发现任何我可以用作模型的东西,并且它不会显示在Bonjour Browser中。 任何build议,将不胜感激。

nginx:未知的“script_filename”variables

我尝试使用script_filename时收到此错误 nginx: [emerg] unknown "script_filename" variable nginx: configuration file /etc/nginx/nginx.conf test failed 但是script_filename在fastcgi_params定义 fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_NAME $fastcgi_script_name; fastcgi_param REQUEST_URI $request_uri; fastcgi_param DOCUMENT_URI $document_uri; fastcgi_param DOCUMENT_ROOT $document_root; fastcgi_param SERVER_PROTOCOL $server_protocol; fastcgi_param GATEWAY_INTERFACE CGI/1.1; fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; fastcgi_param REMOTE_ADDR $remote_addr; fastcgi_param REMOTE_PORT $remote_port; […]

Phusion Passenger设置PassengerPreStart不会使用服务httpd start来激活

我在RHEL上运行Phusion Passenger,托pipe一个Rails应用程序。 我可以在Apache启动时使用PassengerPreStart设置成功启动一个乘客实例,但只有当我使用apachectl start启动Apache apachectl start 。 如果我使用service httpd start的RHEL约定启动Apache,则不会执行PassengerPreStart 。 也就是说,没有乘客实例在Apache启动时加载。 我比较了两个脚本( apachectl和service httpd脚本)的差异,但找不到任何不同的行为之间的差异。 我可以编写一个init脚本来使用apachectl来启动Apache,但是首先我想问一下,如果有人看到apachectl和service http如何与Apache模块交互,特别是使用Passenger的PassengerPreStart设置并解释它的话。