Articles of Apache的2.4

累积的嵌套(警告)/ Apacheconfigurationmacros

我有一个像这样使用macros的虚拟主机configuration: <Macro vhost_begin $host> <VirtualHost *:80> Use vhost_root $host </Macro> <Macro vhost_end> </VirtualHost> </Macro> <Macro vhost_root $host> ServerName $host ServerAlias www.$host DocumentRoot /srv/http/$host/docroot # … more other common config … </Macro> 然后,我使用这样的站点可用的configuration中的macros: vhost_begin example.com # … other virtualhost-specific config here if needed vhost_end 它会让事情变得很糟糕,因为如果一个简单的虚拟主机不需要任何特殊的configuration,那么它只是两行,但是如果需要的话,它不会限制可能性(就像我将整个虚拟主机定义从开始结束于一个macros)。 它工作(看起来像),但启动Apache后,它会在daemon.log中引发以下和类似的警告。 AH02795: bad cumulated nesting (+1) in macro "vhost_begin" AH02793: bad […]

Apache在使用公共IP时崩溃/不启动

我的登台服务器公网IP – 12.91.183.66 (以此为例) 192.155.0.2服务器系统IP(本地) – 192.155.0.2 (以此为例) 当我使用IP 100.12.13.14访问登台服务器上的magento时,它工作正常,我在base_url下的core_config_data更改了相同的IP。 在http.conf也提到过 – Listen 100.12.13.14:80 但是,如果我将本地IP更改为公网IP,即100.200.300.400 ,在base_url下的core_config_data以及http.conf ,apache不断崩溃http.conf启动。 如何在http.conf绑定我的登台服务器IP来公开访问magento? PS Staging服务器同时运行IIS和Xampp。 IIS服务器运行公共IP与端口8080,它是公开的访问。 即使我停止该服务器并运行Magento,它不适用于Apache

其中redirect永久规则需要添加

我想redirect我的网站http请求到https我的网站是 https://开头testing 我的apache版本是2.4,而ssl configration是(ssl.conf)在httpd.conf的单独文件中,我没有使用.htaccess文件,所以我应该追加。 我已经试过这两个文件,但没有工作。 redirect永久/ https://testing 是应该在我的httpd.conf或ssl.conf或我错过了别的东西。 我更喜欢重写重写。 Rewrite.log 10.10.86.1 – [05 / Apr / 2012:15:10:19 – 0700] [test / sid#7ce00] [rid#277448 / initial / redir#1](2)init请求的uri / error /HTTP_BAD_REQUEST.html.var 10.10.86.1 – – [05 / Apr / 2012:15:10:19 – 0700] [test / sid#7ce00] [rid#277448 / initial / redir#1](3)应用模式'^(。*) $'to uri'/error/HTTP_BAD_REQUEST.html.var' 10.10.86.1 – – [05 / […]

Apache正在响应一个空白的白页

我有以下情况: 一个用apache 2.4托pipe的网站,用了一段时间就可以起作用,但是在没有修改的情况下,apache开始提供随机的空白页面。 解决方法是删除浏览器的Cookie或重新启动浏览器。 我已经切换了vitualhostlogindebugging模式,但没有得到我的任何地方。 这里是失败的页面加载的debugging日志: [Wed Oct 24 10:57:35.762547 2012] [ssl:info] [pid 27854:tid 140617706374912] [client 192.168.10.150:58917] AH01964: Connection to child 147 established (server xxx.com.br:443) [Wed Oct 24 10:57:35.762739 2012] [ssl:debug] [pid 27854:tid 140617706374912] ssl_engine_kernel.c(1966): [client 192.168.10.150:58917] AH02043: SSL virtual host for servername xxx.com.br found [Wed Oct 24 10:57:35.777479 2012] [ssl:debug] [pid 27854:tid 140617706374912] ssl_engine_kernel.c(1899): […]

无法使用强encryption

所以我正在探索Apache来创build一个简单的例子:默认页面和一个目录“安全”。 我每个人都可以访问服务器,但是,当一个人想访问“安全”的目录,我的连接使用强大的encryption。 我正在使用apache2.4。 然而,这是行不通的,我不知道为什么! 我已经做了就像在Apache教程: LoadModule ssl_module /usr/lib/apache2/modules/mod_ssl.so <VirtualHost *:443> SSLEngine on SSLCertificateFile /home/vitorpereira/Desktop/cert.cer SSLCertificateKeyFile /home/vitorpereira/Desktop/key.key </VirtualHost> SSLCipherSuite ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL <Location /var/www/html/secure> SSLCipherSuite HIGH:!aNULL:!MD5 </Location> 但是这不起作用:/而且,我可以用http访问安全文件夹,但是当我写https时,它说没有find!

Apache服务器状态请求/秒

现在想知道什么请求/秒实际上意味着什么。 它是实际的Apache处理速度上限? 或者是当前stream量正在处理的实际速度? 看到下面的图片: 那么按照上面的说法,大概8.94个请求/秒的速度和21个请求被处理,这是否意味着每个请求花费21 / 8.94 = 2.34秒? 这不可能是正确的,因为我的网站加载不到半秒钟… 我解释正确吗? 谢谢。

防止在Apache中的文件访问,而不是显示他们的存在

我试图阻止在Apache上直接访问的几个文件和文件夹。 在这里看几个答案,我做了以下几点: 在apache2.conf我添加了: <Location /folder1/folder2> Order deny,allow deny from all </Location> <FilesMatch /folder3/file1> Order deny,allow deny from all </FilesMatch> 第一部分工作部分正确:当我从http:// xxxx / folder1 / folder2 / (文件或文件夹)访问任何文件时,我得到: Forbidden You don't have permission to access … on this server. 但是,当我访问的东西是这样的: http:// xxxx / nonExistingFolder /我得到Not Found ,因此它看起来像我泄漏信息folder1 / folder2 /中存在的东西,这是非常重要的。 有没有办法显示那里还没有find。 另一个问题是,我仍然可以访问/folder3/file1我在做什么错了FilesMatch? 我在Apache 2.4.10

无法启动Apache服务器

我将我的服务器操作系统从Ubuntu 12.04升级到了Ubuntu 14.04。 但是现在我无法启动我的apache服务器。 我的命令: solutionglobe:/home/solutionglobe/public_html# service apache2 restart sh: 0: getcwd() failed: No such file or directory * Restarting web server apache2 AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using solutionglobe.com. Set the 'ServerName' directive globally to suppress this message …fail! * The apache2 instance did not start within […]

当url不完整时,Apache给css或者js

如果我浏览: http://example.com/ : http://example.com/或http://example.com/index.php我得到所需的页面,但如果我浏览http://example.com/index (或没有扩展名的任何页面)它会显示我的CSS或有时JS在普通的txt文件视图。 Apache 2.4.7 Ubuntu 14.04 LTS。 任何想法为什么这种行为正在进行? 我有一个很好的search – 没有运气。 我添加了AddType application/x-httpd-php .php .html到mimetypes,但是它似乎没有影响这个问题。 inheritance人我的default.conf: <VirtualHost *:80> ServerAdmin [email protected] ServerName example.com ServerAlias www.example.com DocumentRoot /srv/www/html <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /srv/www/html> AddType audio/ogg .oga AddType video/ogg .ogv AddType application/ogg .ogg AddType audio/mpeg .mp3 AddType application/x-httpd-php .php .html Options […]

Apache的ProxyPassMatch王牌重写规则?

我在虚拟主机部分有以下内容: ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/var/www/local.mysite/wordpress/$1 在我的testing中,我发现添加一个RewriteRule ^/wordpress/wp-content/(.*)$ /wp-content/$1 [L]的重写规则对于像下面这样的URL没有任何影响: http://local.mysite/wordpress/wp-content/plugins/simple-post-thumbnails/timthumb.php?src=…. 这是因为名称中包含.php所有请求都传递给fcgi,因此所有重写规则都将被忽略?