Articles of apache 2.4

apache2的systemd启动脚本:如何传递envvariables?

下面的systemd启动脚本(Debian GNU / Linux Jessie) [Unit] Description=Apache httpd web server After=network.target [Service] PIDFile=/var/run/apache2/apache2.pid EnvironmentFile=/etc/default/apache2 EnvironmentFile=/etc/apache2/envvars ExecStart=/usr/sbin/apache2 -d /etc/apache2 -k start [Install] WantedBy=multi-user.target 不起作用,因为可执行文件没有选取EnvironmentFile的envvariables。 这是我在/var/log/daemon.log服务启动时读到的: Nov 23 10:05:30 kdc apache2[3111]: AH00526: Syntax error on line 74 of /etc/apache2/apache2.conf: Nov 23 10:05:30 kdc apache2[3111]: Invalid Mutex directory in argument file:${APACHE_LOCK_DIR} APACHE_LOCK_DIR是在/ etc / apache2 / envvars中定义的,它是股票debian的东西: # […]

将没有证书的站点redirect到非ssl而不是提供默authentication书

我从我们的客户主持几个网站。 其中一些有SSL证书,因此使用https端口443和一些没有证书。 具有这样的证书的网站被configuration为自动将httpredirect到https。 如果我访问其中一个没有自己的证书的网站,那么首先装载的虚拟主机文件中的虚拟主机文件将被提供,这是我自己的主页。 我现在想知道是否有可能有ApacheredirectSSL请求到没有自己的证书到非SSL的网站,所以它不会给出“不受信任的证书”警告。 例: domain1.com – 启用SSL(先载入) domain2.com – 启用SSL domain3.com – 未启用SSL 当我请求https://domain3.com时,我得到了不可信的警告,因为domain1.com的证书被提供,当然不包含domain3.com作为主要或替代名称。 相反,我想要redirect到http://domain3.com 我已经试过的是以下configuration,当访问domain3.com时,给我一个SSL错误 <VirtualHost MyIp:443> RewriteEngine On RewriteCond %{HTTPS} on RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] </VirtualHost> 我不确定我的方法是否朝着正确的方向发展,或者我的目标是否可以实现。 所以我愿意接受各种帮助。 谢谢。

Apache 2:限制资源

我在apache 2.4上运行一些网页。 目前,我可以在status-page上看到很多这样的连接: Srv PID Acc M CPU SS Req Conn Child Slot Client VHost Request 2-0 – 0/0/5 . 1297.48 944 2482371 0.0 0.00 0.26 82.xx.xxx.xx example.com:7080 POST /xmlrpc.php HTTP/1.0 正如你所看到的,这个连接需要大量的CPU能力,并且运行很长时间。 我如何closures这些连接? 使用Comodo Ruleset的Mod_Security没有将其检测为攻击。

pthreads不支持apache2handler SAPI

现在已经有几个星期了,我无法安装pthread。 我将列出错误日志,然后列出我的configuration选项。 这些是我得到的错误: (Apache错误日志) 第0行的Unknown中的pthreads不支持apache2handler SAPI apachectl -V输出 Server version: Apache/2.4.18 (Unix) Server built: Jan 10 2016 14:54:48 Server's Module Magic Number: 20120211:52 Server loaded: APR 1.4.8, APR-UTIL 1.5.2 Compiled using: APR 1.4.8, APR-UTIL 1.5.2 Architecture: 64-bit Server MPM: worker threaded: yes (fixed thread count) forked: yes (variable process count) 同时PHP错误日志: (PHP错误日志) bin / php […]

我不能让我的虚拟主机在Apache中正常工作

虽然我知道这个话题已经在其他一些线程里讨论过了,在这个线程里,如何在Apache中configuration虚拟主机。 事情是在寻找可能的答案后,我在这里的问题,在谷歌研究和阅读Apache官方文档我不能让我的问题得到解决。 首先,我在CentOS 7上安装了一个运行在Apache 2.4上的WordPress安装,并设置了下面的虚拟主机: <VirtualHost *:80> ServerName subdomain1.domain.com ServerAlias www.subdomain1.domain.com DocumentRoot /some/path/to/wordpress <Directory "/some/path/to/wordpress"> DirectoryIndex index.php Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all Require all granted </Directory> <Files ".ht*"> Require all denied </Files> ErrorLog "logs/subdomain1-error.log" CustomLog "logs/subdomain1-access.log" combined LogLevel warn </VirtualHost> 它工作得很好,但我决定添加一个Moodle安装(因为服务器没有太多的stream量),然后如果我浏览铬subdomain1.domain.com或subdomain2.domain.com没关系,Chrome始终去subdomain2.domain.com(Moodle网站)。 我在Chrome和Firefox上尝试了相同的结果。 Moodle虚拟主机是: <VirtualHost *:80> ServerName subdomain2.domain.com ServerAlias www.subdomain2.domain.com DocumentRoot […]

SELinux上下文为apache ldap ssl

题 什么SELinux上下文我需要什么文件来获得apache ldap(通过SSL)auth工作? 或者它是一个networking协议或系统调用或其他什么东西? 环境 Centos 7上的Apache 2.4使用基于ssl的基本ldap身份validation。 有了SELinux许可( setenforce 0 ),一切运行良好。 我可以用ldap完美地login到受保护的目录。 当启用SELinux( setenforce 1 )时,apache不能执行ldapsearch并允许用户通过。 这与ssl或证书有关,我无法弄清楚。 在/ var /日志/的httpd / ssl_error_log [Thu Mar 17 15:33:32.529755 2016] [authnz_ldap:debug] [pid 6412] mod_authnz_ldap.c(501): [client 158.158.193.232:17386] AH01691: auth_ldap authenticate: using URL ldaps://ldap-ad.example.org:636/ou=Auto-Accounts,dc=example,dc=org?sAMAccountname?sub [Thu Mar 17 15:33:32.530792 2016] [ldap:debug] [pid 6412] util_ldap.c(372): AH01278: LDAP: Setting referrals to On. […]

Web服务器是否将证书链发送给Web客户端?

如果我的Web服务器(最新的Apache)有一个有效的(未过期或撤销的)Verisign证书链(root-> intermediate-> leaf / myserver),那么服务器是否将整个(?)链发送给客户端? Web客户端(例如最新的Chrome) 是否需要在线查找每个相同的证书,特别是如果客户端已经信任根CA? 如果客户无法联系Verisign,会发生什么情况? (例如,在没有WiFi的笔记本电脑上安装LAMP)。

阿帕奇在火焰中(AH00025)。 怎么修?

我试图让Apache 2.4.10在.htaccess文件中指定的基本身份validation(在HTTPS下)。 我将一个目录的设置更改为AllowOverride all ,它开始只提供普通的500页。 恢复该目录AllowOverride none似乎没有固定的东西。 我在日志中发现的错误似乎都将所请求的相对URL解释为授权用户名,并且声明: [Wed Jun 22 20:34:00.565683 2016] [core:crit] [pid 24994] [client ____:51295] AH00025:configuration错误:无法检查用户:/writing/icons/rublev_trinity_icon.gif,referer:____ AH00025是什么意思? 我发现了一些像https://httpd.apache.org/docs/trunk/upgrading.html这样的页面,但没有明确的错误代码定义。 而且我想要什么/ etc / apache2 / mods-enabled / auth *文件?

连接到VPN时如何通过特定的networking接口使Apache输出数据包?

我有一个完美的Apache服务器,直到我连接到VPN,然后所有连接到服务器超时。 现在到我的理解问题是tun0成为默认的输出接口,因此Apache将混淆如何发送数据包,所以我试图解决它使用控制组通过标记数据包出去从Apache和redirect他们通过eth0像在这个真棒苏答复 ,但它不工作后,我的Ubuntu操作系统升级到16.04版本。 这是我的networking图: 这里是我的networking细节: me@mypc:~$ ip route list 0.0.0.0/1 via 10.132.1.5 dev tun0 default via 192.168.0.1 dev eth0 proto static metric 100 10.132.1.1 via 10.132.1.5 dev tun0 10.132.1.5 dev tun0 proto kernel scope link src 10.132.1.6 123.4.5.6 via 192.168.0.1 dev eth0 234.5.6.7 via 192.168.0.1 dev eth0 128.0.0.0/1 via 10.132.1.5 dev tun0 169.254.0.0/16 dev eth0 […]

位置参数的htaccessredirect到基础url

如果URL包含特殊参数(URL中包含参数中的Email ),则会redirect到没有任何参数的页面的基本URL。 例如: http://example.com/accounts/daily/ybk/[email protected] 至 http://example.com/accounts/daily/ybk/