Articles of apache 2.4

如何仅在特定位置启用SSL

我有一个Apache服务于一个应用程序以及一个Web服务。 我想通过https的Web服务,但通过http的应用程序。 如何仅在特定位置启用SSL? 没有一个SSL指令似乎是有效的 <Location> </Location> 目前我有 <IfModule ssl_module> ServerName www.myserver.com SSLEngine on SSLCACertificateFile "/usr1/apache/conf/ssl/CAList.pem" SSLCertificateFile "/usr1/apache/conf/ssl/mine.crt" SSLCertificateKeyFile "/usr1/apache/conf/ssl/mine.pem" SSLVerifyClient require </IfModule> 但是这使得ssl在我不想要SSL的页面上。

Nginx代理不能按预期工作

我用nginx在主机上使用dokku(小heroku),我的容器是使用apache,它暴露的端口8052。 这是启用和工作正常的.conf里面的configuration: LISTEN 8052 <VirtualHost *:8052> ServerAdmin veeenex@localhost DocumentRoot /var/www <Directory /> Options +FollowSymLinks AllowOverride None </Directory> <Directory /var/www/> Options +FollowSymLinks +ExecCGI AllowOverride All Order allow,deny allow from all </Directory> FCGIWrapper /phpfarm/inst/php-5.2/bin/php-cgi .php AddHandler fcgid-script .php LogLevel warn ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost> 这是主机上的configuration upstream katalog.domain.eu { server 172.17.0.3:8052; } server { listen [::]:80; […]

正常重启后,apache2不能运行

今天,我的apache实例被一些cron作业正常地自动重启,我猜,之后它没有运行。 apache错误日志文件显示: [Fri Jun 03 06:25:04.379685 2016] [mpm_prefork:notice] [pid 8256] AH00171: Graceful restart requested, doing restart apache2: Syntax error on line 140 of /etc/apache2/apache2.conf: Syntax error on line 2 of /etc/apache2/mods-enabled/access_compat.load: Cannot load /usr/lib/apache2/modules/mod_access_compat.so into server: /usr/lib/apache2/modules/mod_access_compat.so: undefined symbol: ap_get_useragent_host 通过手动启动后 service apache2 start 它按预期工作。 我已经在这个Ubuntu 14.04机器上禁用了无人值守的安全更新,因为上周我在上面打印了类似的问题 [Thu May 26 06:27:29.737707 2016] [mpm_prefork:notice] [pid 1487] […]

Nginx子域重写到服务器目录

我们正在转向Apache的一些Nginx服务器。 虽然我们已经使用Nginx的各个网站,它已经在一个最基本的configuration。 但是,我们托pipe的“网站”(实际上是多个)之一是一个沙箱types的网站,以便我们的开发人员可以login到服务器创build一个目录,并且他们有一个网站启动并运行。 我想弄清楚如何用Nginx来复制这个,但是到目前为止我还是无法把头围住。 任何帮助,将不胜感激。 服务器目录设置示例: /home/[USER]/sandbox/site1 /home/[USER]/sandbox/site2 … etc. Apacheconfiguration: <VirtualHost *:80> ServerName example.com ServerAlias *.example.com ServerAlias *.*.example.com RewriteEngine on RewriteCond %{HTTP_HOST} ^(.*)\.(.*)\.example\.com$ [NC] RewriteRule ^(.*)$ /home/%1/sandbox/%2/$1 [L] <Directory /> AllowOverride All Require all granted </Directory> </VirtualHost> 结果域: [USER].site1.example.com [USER].site2.example.com …. etc. 在Nginx中parsing主机并在内部正确路由到所述目录会是什么样子?

Apache mod_authnz_ldap:是否可以通过Unix域套接字文件连接?

在我的Debian服务器上,我configuration了LDAP服务器slapd ,只接受通过Unix域套接字文件的连接。 这是/etc/defaults/slapd的相关部分: SLAPD_SERVICES="ldapi:///" 我一直很高兴地接受这个configuration,各种各样的PHP应用程序都很好地工作。 现在我正在尝试将Apacheconfiguration为通过LDAP进行身份validation。 我正在通过核心模块mod_authnz_ldap做到这一点。 ldapi使用ldapi URLscheme不起作用: AuthLDAPUrl ldapi:///ou=users,dc=example,dc=com?uid?sub?(objectClass=*) 我所看到的所有Apache错误都是TCP连接尝试localhost:389和127.0.0.1:389 ,当然,都被拒绝,因为没有人在这个端口上侦听。 我也尝试了两个URL,两者都有相同的负面结果: # Same as the 1st attempt, but with ldap:// instead of ldapi:// AuthLDAPUrl ldap:///ou=users,dc=example,dc=com?uid?sub?(objectClass=*) # Getting desperate: Specify the file path of the Unix domain socket file AuthLDAPUrl ldap:///var/run/slapd/ldapi/ou=users,dc=herzbube,dc=ch?uid?sub?(objectClass=*) AuthLDAPUrl的Apache 2.4文档声明如下: 指定要使用的LDAPsearch参数的RFC 2255 URL。 RFC 2255确实没有提到ldapi URLscheme,也没有提到如何指定Unix域套接字文件path。 我忽略了什么? 有谁知道我怎么可以得到mod_authnz_ldap使用Unix域套接字文件进行连接? 或者是真的,因为我害怕,不可能用mod_authnz_ldap做到这一点? 我的设置: […]

错误:php70w-与php-common-5.4在安装phpMyAdmin时在centos 7中发生冲突

PHP 7安装phpmyadmin时如何解决冲突? 我已经安装了PHP 7和Httpd,最后一个我想安装phpmyadmin,但是我在安装过程中遇到了这个错误。 sudo yum install phpmyadmin Loaded plugins: fastestmirror, langpacks http://repos.fedorapeople.org/repos/jkaluza/httpd24/epel-7/x86_64/repodata/repomd.xml: [Errno 14] HTTPS Error 404 – Not Found Trying other mirror. To address this issue please refer to the below knowledge base article https://access.redhat.com/articles/1320623 If above article doesn't help to resolve this issue please create a bug on https://bugs.centos.org/ Loading mirror speeds […]

httpd日志当没有工人可用

有没有更多的工作人员可用的httpd日志有办法吗? 例如,它可以logging工人变得不可用的date和时间,并在工人再次可用时再次login。 这个日志将被用来分析容量需求。

在Apache2中设置Cache-Control头文件的最佳方法是什么?

在这个链接下,你有一些关于如何在Apache2服务器中设置Cache-Control头部的例子。 所以一般来说,有三种不同的方法来设置这些头文件: 使用mod_expires + mod_headers 只使用mod_headers 仅使用mod_expires 他们之间有什么重大的区别? 哪一个是首选的,为什么,或者根本不重要? 在Apache2中设置Cache-Control头文件的最佳方式是什么?

来自Apache服务器的奇怪的302响应

我有这种情况完全让我感到困惑: 设置 一个新设置的服务器(centos 7,apache,mysql,没什么奇怪的),它提供了一个简单的php应用程序,我需要在另一台服务器上与我的主应用程序进行交互。 这个服务被设置为在service.name.domain.tld上运行,而主应用程序在domain.tld上(只是提及以防万一)。 问题 由于某些原因,当我尝试从主服务器访问服务应用程序时,我得到了一个无限循环的302redirect。 如果我从主服务器上执行curl -D – http://service-name.domain.tld ,我会得到: HTTP/1.1 302 Found Date: Wed, 03 Aug 2016 12:30:26 GMT Server: Apache Location: http://service-name.domain.tld Content-Length: 218 Connection: close Content-Type: text/html; charset=iso-8859-1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>302 Found</title> </head><body> <h1>Found</h1> <p>The document has moved <a href="http://email-blasts.upgradesale.co">here</a>.</p> </body></html> 如果我从我的电脑执行相同的命令,结果是 HTTP/1.1 200 OK […]

从haproxylogging客户端在Apache中的真实IP

我已经设置了一对新的haproxy(v1.5)负载平衡器,并在其后面放置了2个webserver(apache on Centos 6)。 我已经设置了X转发,我可以在web服务器的access_log中看到客户端的真实IP。 但是,我并没有在error_log中看到客户端的真实IP,它只logginghaproxy节点IP。 我究竟做错了什么? 附件是Web服务器的日志configuration。 LogLevel warn <IfModule log_config_module> LogFormat "%a %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined LogFormat "%a %l %u %t \"%r\" %>s %b" common <IfModule logio_module> # You need to enable mod_logio.c to use %I and %O LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" […]