Articles of apache 2.4

将apache mpm更改为CentOS7的mpm-itk

我试图在CentOS上运行mpm-itk模块。 不幸的是,这需要Apache 2.4.7,而目前的版本是2.4.6,所以编译模块是不可能的。 另外,centos现在提供了httpd-itk包,它创build了另一个apache二进制文件(/usr/sbin/httpd.itk)。 根据这篇文章,可以在/ etc / sysconfig / httpd中设置HTTPD参数来通过itk运行apache。 但是,CentOS 7不再是这种情况,而是使用/etc/httpd/conf.modules.d/00-mpm.conf来加载你想要的模块。 除了这个例子,它不是一个模块,而是一个可执行文件! 在这种情况下,如何在httpd.itk中使用httpd进行切换? 谢谢!

apache如何使用或允许浏览/ usr / share? (linux / Ubuntu)

默认的apache.conf(ubuntu服务器)包含以下块: # Sets the default security model of the Apache2 HTTPD server. It does # not allow access to the root filesystem outside of /usr/share and /var/www. # The former is used by web applications packaged in Debian, # the latter may be used for local directories served by the web server. If # your […]

Apache随机停止提供HTTPS,但HTTP工作得很好

我们在Windows Server 2012上有这个Apache: Server version: Apache/2.4.9 (Win32) Apache Lounge VC10 Server built: Mar 17 2014 10:48:43 大多数情况下,它可以很好地工作,但是不时地(每周3-4次)随时停止在端口443上提供HTTPS,但是继续在端口80上提供HTTP服务。当HTTPS停止服务时,解决问题的唯一方法是重新启动Apache。 这似乎是与这里一样的问题: Apache停止响应http请求–HTT继续工作,除了在我们的情况下HTTPS停止工作,HTTP是一直工作的。 我们已经启用trace6级别的冗长,以获得关于发生的事情的一些好的信息。 但是,日志是空的: … [Sat Mar 21 07:51:50.577373 2015] [ssl:debug] [pid 3356:tid 2540] ssl_engine_io.c(999): [client …:16529] AH02001: Connection closed to child 137 with standard shutdown (server …:443) [Sat Mar 21 07:54:21.936742 2015] [ssl:info] [pid 4760:tid 432] AH01914: […]

什么是瘦,为什么我需要它

这是一个很低的问题,因为我从来没有真正理解它,所以我想要一个解释: 什么是薄(或乘客或其他select)? 瘦(或其他select)的目的是什么? 为什么我需要使用Apache(或Nginx或其他选项)的Thin(或其他)? 可以使用精简(或其他替代品)而不使用Apache(或其他替代品)? Thin(或其他alt。)和Apache(或其他alt。)之间有什么区别? 目前, 我对这个问题的理解是有限的(可能是错误的) 。Apache是​​一个http web服务器(在这种情况下,它就像一个反向代理(?)),Thin是一个ruby web应用服务器。 为什么他们是什么样的,他们是如何工作的,有些回避我。 措辞可能是非常混乱的(例如,networking服务器与networking应用程序服务器,等等…(有点像“主机”或“主机名”可能会非常混乱))。 如果我在网上find的所有阅读材料对我来说都不是很清楚的话,我可以去哪里去发展我对“正在解决的问题的最低限度的理解”?

Apache错误日志pipe道失败

试图login到一个中央系统日志服务器,直接使用Apache的错误日志pipe道logging器,或获取系统日志转发,但没有任何工作,这些错误对我来说是没有意义的。 我可以让自定义日志工作,但不是ErrorLog。 使用rsyslogd 7.4.4在Ubuntu 14.04上使用Apache / 2.4.7。 在我的虚拟主机configuration(logging器选项后没有空格,没有任何区别): LogLevel warn ErrorLog "|/usr/bin/tee -a /var/log/apache2/error.log | /usr/bin/logger -tapache_err -plocal1.error" CustomLog "|/usr/bin/logger -p local4.warning -t apache" combined 然后得到这个错误: /usr/bin/tee: invalid option — 't' 也试过(有和没有双引号): ErrorLog "|syslog:local1" 但后来得到: (2)No such file or directory: AH00089: Couldn't start ErrorLog process 'syslog:local1'. AH00015: Unable to open logs 甚至尝试过: ErrorLog "| /usr/bin/tee […]

我们应该使用Apache的HTTP2吗?

我想在Apache 2.4.16上使用HTTP2(可能需要升级到2.4.17),并偶然发现了官方Apache页面上的这个评论。 警告 这个模块是实验性的。 与其他标准模块相比,其行为,指令和默认值从发布到发布的变化都有所不同。 鼓励用户咨询“CHANGES”文件以获取潜在更新。 另一方面,许多其他人正在做如何启用它的教程。 那么使用它是安全的还是应该等待? 另外,我们可以将HTTP2与反向代理结合使用吗?

Apache ProxyPass忽略静态文件

Apache前台服务器连接到Jetty应用程序服务器时遇到问题。 我认为这个ProxyPass ! 在一个位置块应该不会传递到应用程序服务器的处理,但由于某种原因,这不是在我的情况发生,Jetty显示缺less静态404(JS,CSS等) 这是我的Apache(v 2.4,BTW)虚拟主机块: DocumentRoot /path/to/foo ServerName foo.com ServerAdmin [email protected] RewriteEngine On <Directory /path/to/foo> AllowOverride None Require all granted </Directory> ProxyRequests Off ProxyVia Off ProxyPreserveHost On <Proxy *> AddDefaultCharset off Order deny,allow Allow from all </Proxy> # don't pass through requests for statics (image,js,css, etc.) <Location /static/> ProxyPass ! </Location> <Location /> ProxyPass […]

Apache 2.4将URL限制在某些IP地址

我正试图限制一个特定的URL在networking外部只能用于特定的IP地址。 当外面的用户尝试访问该URL而不是IP列表时,他应该被redirect到主页。 这是我迄今为止尝试没有任何运气。 最后一部分将所有人redirect到主页,而不pipeIP。 <Location "/secret"> # <If "%{REMOTE_ADDR} != -ipmatch '123.123.123.123/255.255.255.255'"> # Redirect 303 "/secret" / # </If> RewriteCond "%{REMOTE_ADDR}" "!123\.123\.123\.123" RewriteRule .* / [R,L] LogLevel debug rewrite:trace6 </Location> PS:/ secret URL实际上是一个虚拟的URL,并不存在于硬盘上。

为什么启用.htaccess中的重写日志不起作用?

我想启用重写日志logging,以便我可以debugging重写规则,但添加RewriteLog指令导致500错误。 版本信息: Ubuntu 14.04 Server version: Apache/2.4.12 (Ubuntu) Server built: Feb 4 2015 14:22:06 .htaccess内容 <IfModule mod_rewrite.c> RewriteEngine On RewriteLog /var/log/apache2/rewrite.log RewriteLogLevel 5 RewriteBase / RewriteRule ^/wordpress/wp-content/(.*)$ /wp-content/$1 [L] RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> 在错误日志中我看到: /var/www/path.to/wordpress/.htaccess: Invalid command 'RewriteLog', perhaps misspelled or defined by a […]

SELinux阻止Apache写入文件

SELinux阻止apache用户写入它拥有的日志文件。 当我setenforce 0它的作品。 否则会显示这个错误 IOError: [Errno 13] Permission denied: '/var/www/webapp/k/site/k.log' 文件的安全上下文: $ ll -Z k.log -rw-r–r–. apache apache system_u:object_r:httpd_sys_content_t:s0 k.log 该文件是在SELinux模式设置为宽容时创build的。 如何设置安全上下文,以便apache用户可以在该目录中写入? 我没有使用chcon设置目录安全上下文,但是我找不到合适的文件types。 从audit.log : type=AVC msg=audit(1409945481.163:1561): avc: denied { append } for pid=16862 comm="httpd" name="k.log" dev="dm-1" ino=201614333 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:httpd_sys_content_t:s0 tclass=file type=SYSCALL msg=audit(1409945481.163:1561): arch=c000003e syscall=2 success=no exit=-13 a0=7fa8080847a0 a1=441 a2=1b6 a3=3 items=0 ppid=15256 pid=16862 auid=4294967295 […]