Articles of apache 2.2

apache:绝对的ErrorDocument相对/ var / www /?

我的apache VirtualHost包含一个ErrorDocument指令: <VirtualHost *:80> ServerName test DocumentRoot /var/www/html/test/ ErrorDocument 404 /error/404.txt </VirtualHost> 文件/var/www/html/test/error/404.txt确实存在。 当试图访问一个不存在的文件时,我从apache得到一个错误的错误消息: 在此服务器上找不到请求的URL / foo。 此外,尝试使用ErrorDocument处理请求时遇到404 Not Found错误。 错误日志包含: [error]文件不存在:/ var / www / html / test / foo [error]文件不存在:/var/www/error/404.txt 为什么apache的错误文档path相对于/var/www (apache用户的家目录),而不是相对于虚拟主机的DocumentRoot ,如文档中所述 ? URL可以以斜杠(/)开始,用于本地Webpath(相对于DocumentRoot),… 在CentOS 6.7上,Apache 2.2发生这种情况。

为什么我的apache2崩溃? Althoought在我的服务器上获得更多的空间和内存

我的网站停止加载浏览器,并重新工作后,我重新启动apache2。 我使用的Amazon AWS ububuntu服务器在3个月前从t2.micro移动到了t2.large(vCPU:2,CPU Credits /小时:36,Mem(GiB)8)。 这是apache2的日志: [Tue Dec 15 09:04:41.976924 2015] [autoindex:error] [pid 31049] [client 66.66.66.666:53331] AH01276: Cannot serve directory /var/www/html/wp-content/themes/twentyfifteen-child/images/: No matching DirectoryIndex (index.html,index.cgi,index.pl,index.php,index.xhtml,index.htm) found, and server-generated directory index forbidden by Options directive, referer: http://www.example.com/blog/ [Tue Dec 15 18:28:59.565037 2015] [autoindex:error] [pid 31987] [client 50.115.68.210:13697] AH01276: Cannot serve directory /var/www/html/wp-content/themes/twentyfifteen-child/images/: No matching DirectoryIndex […]

如何正确使用php与多个域的sendmail

我在服务器上托pipe两个使用wordpress创build的网站。 这些网站应该能够发送邮件给用户,但几乎接收器(除了可能是Gmail)失败。 我发现问题是邮件是由用户www-data@myserver ,并被拒绝。 我想configuration我的php.ini使用/usr/sbin/sendmail -f提供一个值,以便电子邮件将有一个有效的域。 我的问题是如何能够在这里指定多个域,以便每个网站将发送邮件与地址[email protected]与mydomain匹配到每个网站的一个。 我看到我可以使用PHP的mail()并提供了一个参数与-f但它已被弃用之前,WordPress的wp_mail()函数。 我怎样才能达到我想要的?

禁用Apache中的匿名密码不起作用

我们有一个带有OpenSSL 0.9.8e-fips-rhel5的Apache 2.2.3服务器。 我正在VirtualHost中运行以下SSLconfiguration。 我找不到任何其他configuration文件与任何SSL指令。 SSLProtocol all -SSLv2 -SSLv3 SSLHonorCipherOrder on SSLCipherSuite CDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS 但是,我仍然无法通过以下消息进行SslLabs扫描: 该服务器支持匿名(不安全)套件 为什么如果我只使用强密码并且无法在任何地方find任何压倒一切的configuration,它仍然失败?

dynamic/静态页面上的间歇性巨大的TTFB

我们有一个VPS(2GB RAM / 2个vCPU)。 这是在PHP 5.6,Centos 6,Apache 2.2上的phpBB论坛。 不过有时候这个论坛的响应速度很慢。 使用Chromenetworking浏览器,我发现TTFB有时会长达30秒。 奇怪的是,caching项目也有这个问题。 (见截图) 我已经尝试过了: 服务器在发布期间的负载不高于.20,并且有空闲的内存。 我ping服务器:大约10ms 安装zend opcache(99.9%的点击率) 安装memcached( 统计 ) 我安装了mytop,看看MySQL是否是问题,但据我了解,MySQL并没有太多的工作 (0/0)00/00/00 / 00关键效率:99.4%Bpsinput/输出:4.4k / 51.1k现在进出:48.4 / 7.5k 由于情况并非总是如此,复制这个问题的唯一方法就是发送F5垃圾邮件,尽pipe我不确定是否真的在复制这个问题。 我可以在较小的扩展(2s ttfb)复制这与在html中复制相同的页面(删除dynamic部分)。 http://s21.postimg.org/ql6eywn3b/ttfb.png 我保持活跃(最大100秒,15秒),maxclients 30.我从哪里去?

禁用Apache的虚拟主机的IP,但不是(子)域

我configuration了一个域名和两个子域名,并redirect到相应的https版本: <VirtualHost *:80> ServerName domain.com Redirect permanent / https://domain.com </VirtualHost> <VirtualHost *:80> ServerName a.domain.com Redirect permanent / https://a.domain.com </VirtualHost> <VirtualHost *:80> ServerName b.domain.com Redirect permanent / https://b.domain.com </VirtualHost> 现在,我做一些testing: curl http://domain.com/ gives me the redirect to https://domain.com/ curl http://a.domain.com/ gives me the redirect to https://a.domain.com/ curl http://b.domain.com/ gives me the redirect to https://b.domain.com/ 大。 最后一个testing,只使用IP(abcd): […]

小型查询等待大型查询来parsingCentos 6.5上的MYSQL PHP

我有一个Centos 6.5,而且我在Tomcat上运行Vaadin,这个应用程序对报表和东西的查询非常重要。 我的问题是,当我从PHP连接到MYSQL时,当我做了一个小的查询时,来自PHP的查询总是等待在Tomcat上请求Vaadin的大量查询。 我尽我所能来解决这个问题。 我认为这可能是一个Apache的问题,我和Apache一起安装和configurationnginx,尝试在nginx上进行php查询(当然,端口改变了,在81上),单独的为Vaadin分开Apache。 有任何想法吗 ???

是否有可能发送相同的域到Apache上的另一个虚拟主机?

我需要将我的本地用户访问mydomain.com,然后将访问mydomain.com的外部访问者redirect到虚拟主机B.原因是: 我想用kerberos之类的东西无缝login我的本地用户,外部访问者必须通过表单login。 这可能吗。 我正在使用Apache 2.2

mod_rewrite问题在Nginx后面的Apache

我有nginx代理到Apache作为后端为了nginx处理静态资产。 不幸的是,当我试图访问一个“漂亮的url”,它只是显示索引页面。 nginxconfiguration server { listen 80; root /var/www/example.com; index index.php index.html index.htm; server_name example.com www.example.com a.example.com b.example.com c.example.com; location / { try_files $uri $uri/ /index.php; } location ~ \.php$ { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header Host $host; proxy_pass http://127.0.0.1:8080; } location ~ /\.ht { deny all; } } Apache vhostconfiguration <VirtualHost 127.0.0.1:8080> […]

Apache2和nginx每周都会随机地消耗所有的内存

我想在此前言说我已经阅读了至less10个相关的Serverfault问题,然后才决定自己做… 我目前正在运行带有2GB内存的Ubuntu 14.04.3服务器,以及大约5个有效的WordPress安装,全部在Vesta CP控制面板下进行pipe理。 通常情况下,它消耗了大约700MB的2GB。 但是每个星期左右,所有的RAM都会被神奇地消耗掉,服务器的速度几乎停顿下来。 如果我SSH进入并重新启动Apache,以及清除内存( echo 3 > /proc/sys/vm/drop_caches ),它再次开始正常工作。 这里是我的prefork模块设置,我觉得是非常合理的: <IfModule mpm_prefork_module> StartServers 5 MinSpareServers 1 MaxSpareServers 5 ServerLimit 10 MaxClients 10 MaxRequestsPerChild 1000 </IfModule> 我甚至启用了mod_status,并试图查看哪些PHP文件花了太长时间,但没有发现任何可疑的东西。 当然,当我查看服务器停机的日志时,由于大量的内存消耗而无法运行,因此至less有200个PHP文件被淹没。 我甚至启用了一个8GB的SWAP文件,但似乎只是推迟了不可避免的。 以下是free -m命令每次提取的内容: root@apache2-ps7881:/home/dhc-user# free -m total used free shared buffers cached Mem: 2001 1943 57 35 1 59 -/+ buffers/cache: 1883 118 Swap: 8191 […]