Articles of apache 2.4

Apache只logging网关IP作为访问者的IP地址

我有一个在NAT后面的web服务器,可以在互联网上访问。 我正在使用mikrotik路由器进行NAT。 但是,当从互联网或外部局域网访问网站时,并不显示实际的访客IP,而是显示网关IP地址。 我尝试了很多改变日志格式的东西,把自定义头部分配给x-forward,但是还是没有运气。 NAT规则: chain=srcnat action=masquerade chain=dstnat action=dst-nat to-addresses=private-ip to-ports=80 protocol=tcp dst-address=public-ip dst-port=80

Apache不让我进来,但它应该

编辑 下面接受的答案是正确的假设(正如我以为)服务器是V2.2。 相反,我发现服务器是Apache 2.4,所以真正的解决scheme是使用新的指令。 请在接受的答案下面看到我的评论。 原文问题 在mydomain.com/wp-admin我放了一个类似的.htaccess # note: the ip here is a fake order deny,allow deny from all allow from 192.168.1.101 但是我现在得到了一个403错误。 这里的域和IP是假的,但是我使用的真正的IP是正确的,因为我可以看到它形成日志,就像这样: www.example.com 192.168.1.101 – – [10 / Jan / 2017:10:51:52 +0100]“GET / wp-admin / HTTP / 1.1”403 518“ – ”“Mozilla / 5.0 OS X 10.11; rv:50.0)Gecko / 20100101 Firefox / 50.0“ […]

运行cronjob错误未定义的索引:REQUEST_URI

我用cronjob&php cli blesta计费有问题,我在php / server中遇到了问题,或者有一个错误数据库。 我看到php cli已经安装。 Cron命令 * / 5 * * * * / usr / bin / php /home/domains/member.domain.com/public_html/index.php cron 错误:未定义索引:REQUEST_URI Unable to deliver 1 invoice to client #31661 via Email due to error: Undefined index: REQUEST_URI Unable to deliver 1 invoice to client #31331 via Email due to error: Undefined index: […]

apache在centos 7中不是以mpm事件开始的

您好我试图从prefork切换到Apache MPM事件如下: vim /etc/httpd/conf.modules.d/00-mpm.conf # Select the MPM module which should be used by uncommenting exactly # one of the following LoadModule lines: # prefork MPM: Implements a non-threaded, pre-forking web server # See: http://httpd.apache.org/docs/2.4/mod/prefork.html LoadModule mpm_prefork_module modules/mod_mpm_prefork.so # worker MPM: Multi-Processing Module implementing a hybrid # multi-threaded multi-process web server # See: http://httpd.apache.org/docs/2.4/mod/worker.html # […]

一个单一的平衡器pipe理器页面为多个虚拟主机

我们目前使用Apache 2.4作为负载平衡器,用于三台Tomcat服务器的多主集群。 我们可以通过networking浏览器访问这个负载均衡器的内部IP地址,并可以随时更改设置(例如http://xx.xx.xx.xx/balancer-manager )。 这工作,我们对此很好。 启用的模块: proxy.load(用于configurationproxy.conf) proxy_ajp.load proxy_balancer.load(用于configurationproxy_balancer.conf) 但是现在我们将在这个Apache上托pipe几个虚拟主机(在这个设置中是三个虚拟主机),每个虚拟主机代表一个三个Tomcat本身的集群。 每个都可以通过一个像http://customer.company.tld/app/ui这样的URL来访问 。 所以每个集群的path是一样的 ! 现在我们面临着两个问题: 页面平衡器pipe理器只能通过虚拟主机访问。 因此,我们必须通过随机select内部主机名(添加到ServerAlias)来访问平衡器pipe理器,并将该主机名也添加到离我们内部计算机的/ etc / hosts中以便能够使用它。 此外,我们必须为每个虚拟主机(〜集群)执行此操作。 但是我们希望有一个页面平衡器pipe理器来显示所有的虚拟主机和后面的集群。 这里有一些示例configuration: / etc / apache2 / site-enabled / foo #我们其实有三个:foo,bar,baz <VirtualHost *:80> ServerAdmin webmaster@localhost ServerName customer-foo.company.tld ServerAlias customer-foo-balancer customer-foo.company.tld www.customer-foo.company.tld DocumentRoot /var/www <Directory /> Options FollowSymLinks AllowOverride None Order allow,deny deny from all […]

如何制作使用TLS的自签名SSL证书?

将Apache和PHP升级到Ubuntu 12.01 LTS上的最新版本之后,其上的SSL站点变得无法访问,指出错误“ssl_error_no_cypher_overlap”。 我尝试使用openssl req -x509 -nodes -days 1826 -newkey rsa:2048 -keyout apache_x509_RSA-2048_days-1826_013115.key -out apache_x509_RSA-2048_days-1826_013115.crt生成新的自签名SSL证书openssl req -x509 -nodes -days 1826 -newkey rsa:2048 -keyout apache_x509_RSA-2048_days-1826_013115.key -out apache_x509_RSA-2048_days-1826_013115.crt 但是当我运行: /etc/ssl/our_certs# sslscan –no-failed mydomain.com 我懂了: _ ___ ___| |___ ___ __ _ _ __ / __/ __| / __|/ __/ _` | '_ \ \__ \__ \ \__ […]

如何configurationApache mod_proxy代理Fedora 21上的GlassFish 4.1?

我有glassfish 4.1运行,并检查http-listener-2上的JK-Listener选项: 我也已经安装了Apache( sudo yum install httpd )并在/etc/httpd/conf.d上创build了以下文件: /etc/httpd/conf.d/ajp.conf ProxyPass / painel ajp:// localhost:8181 / painel ProxyPassReverse / painel ajp:// localhost:8181 / painel 但所有我试图使用ajp协议是503 http错误。 我错过了什么? 如果我将协议从ajp更改为http和端口8080,它的工作原理。 但是这个想法是使用ajp。 任何帮助是受欢迎的。

ufw从ip拒绝似乎并没有工作

在今天工作的时候,我一直在拖着我的服务器的访问日志,并注意到我的客户的一个WordPress的网站越来越受到来自国外的知识产权的login企图。 我想拒绝从这个IP地址访问,并尝试以下ufw命令: sudo ufw deny from xx.xx.xx.xx to any 我看到规则已经添加,防火墙是活动的,但我仍然看到从该IP地址的login页面大量的post。 我也试过使用iptables,虽然我对这个工具不是很熟悉: sudo iptables -A INPUT -s xx.xx.xx.xx -j DROP 我有没有想过这个错误? 我会认为,在拒绝访问的IP地址,它不会出现在我的apache访问日志与login页面的post200的状态。 编辑:正如我所提到的,ufw是活动的,规则就位,这里是ufw状态的输出(ip被阻止): root@mel:~# ufw status Status: active To Action From — —— —- 22 ALLOW Anywhere 80 ALLOW Anywhere 1723 ALLOW Anywhere 8080 ALLOW Anywhere 6273 ALLOW Anywhere 36728 DENY Anywhere Anywhere DENY xx.xx.xx.xx 22 […]

网站在不同的服务器上,但希望通过端口80和443访问所有站点

我有一个路由器后面的两个Web服务器:1行业务的Web应用程序/网站(Windows)和1个LAMP / Web开发服务器与多个网站/项目(与虚拟主机,自己的域名等Apache)。 到目前为止,要公开访问web dev项目,我已经在linux服务器上为每个虚拟主机使用了不同的端口,因为端口80将转发到Windows服务器(优先)。 现在,我更愿意使用我的域和子域来公开访问我的web开发项目(而不是难以记住端口号)。我如何设置它,以便我可以通过端口80访问两台服务器上的所有网站和端口443 …我添加SSL)?

https://domain.com SSL错误,它不会redirect到www,除非添加exception

我已经使用certbot为我的域创build了一个让我们encryption的证书。 我已经确保包含www和一些(需要的)子域名,所以证书应该对非www和www有效: domain.com www.domain.com sub1.domain.com … 但事实并非如此,如果我尝试访问https://domain.com,它会抛出一个SSL错误。 在证书查看器(通过www访问时),我可以看到通用名称(CA)domain.com。 证书主题备用名称包含非www和www … 所以我不明白为什么会出现这个错误: domain.com uses an invalid security certificate. The certificate is not trusted because it is self-signed. Error code: SEC_ERROR_UNKNOWN_ISSUER 我确实生成了自签名证书,但是对于默认的虚拟主机块(httpd-ssl.conf中的那个),其他块正在使用我们的encryption证书。 我也确保删除了Firefox的caching。 我做了一个例外,现在每次写https://domain.com时都会redirect到https://www.domain.com 。 我使用Apache 2.4.23,我的vhostsconfiguration如下: <VirtualHosts *:80> Servername domain.com Redirect permanent / https://www.domain.com/ </VirtualHosts> <VirtualHost *:443> ServerName domain.com:443 Redirect permanent / https://www.domain.com:443/ </VirtualHost> <VirtualHost *:PORT> […]