Articles of apache 2.4

在本地networkingapache2上不要使用Client Cert Auth

我希望有人能帮我解决这个问题 我在我的Ubuntu 14.04盒子上运行了一个Apache 2.4.7服务器,有一些面向公众的站点。 对于其中一些网站,我使用自签名证书实施了客户端证书身份validation。 我试图改变我的configuration,当客户端连接到与服务器在同一networking上的网站时,完全绕过validation。 这是我的configuration文件的片段: SSLEngine On SSLProtocol -all +TLSv1 +SSLv3 SSLCipherSuite HIGH:MEDIUM:!aNULL:+SHA1:+MD5:+HIGH:+MEDIUM SSLCertificateFile /etc/ssl/ca/certs/server.crt SSLCertificateKeyFile /etc/ssl/ca/private/server.key SSLCACertificateFile /etc/ssl/ca/certs/serverCA.crt SSLVerifyClient require SSLProxyEngine Off ProxyRequests Off 我已经尝试通过将SSLVerifyClient require移动到Location块来修改此configuration,如下所示: <Location /> Order deny,allow Deny from all Allow from 192.168.1.0/24 SSLVerifyClient require Satisfy any </Location> 不幸的是,这不起作用,我仍然会被要求提供证书,或者我的网站可以从互联网免费获得。 非常感谢您的帮助

使用IPv6的Apache VirtualHost通配符

在Ubuntu上使用Apache 2.4,我在ports.conf中有以下内容: Listen XX.73.44.57:80 Listen [2001:XX:0:2c38::39]:80 <IfModule ssl_module> Listen XX.73.44.57:443 Listen [2001:XX:0:2c38::39]:443 </IfModule> <IfModule mod_gnutls.c> Listen XX.73.44.57:443 Listen [2001:XX:0:2c38::39]:443 </IfModule> 我想在我的服务器configuration中有以下内容: <VirtualHost *:80> 但是这似乎不能正常工作,因为主机没有回应。 我也试过: <VirtualHost *:80 [::]:80> 以下工作: <VirtualHost [2001:XX:0:2c38::39]:80 XX.73.44.57:80> 但我更喜欢通配符。 我必须明确地给出IP地址吗?

如何授予Apache访问目录

目前,我正在使本地托pipe的网站正常运行,但在从主机和其他计算机访问它时也遇到了问题。 我已经在防火墙中创build了exception并转发了端口连接。 我用适当的代码创build了一个.htaccess文件,并编辑了所有其他文件以允许连接。 当我在本地主机上使用网站的URL时,它是有效的,这是可以预料的。 但是,当我在任何一台计算机上使用我的IP地址时,我收到以下错误(IP地址由我隐私保护): Forbidden You don't have permission to access / on this server. Apache/2.4.9 (Win64) PHP/5.5.12 Server at XXX.XXX.X.XX Port 80 我做了足够多的研究,并相信Apache可能没有权限访问网站的目录。 我正在使用WAMP服务器,截至2015年7月5日完全更新。 任何帮助得到这个网站启动和运行,将不胜感激。 如果您想了解更多信息,只需留下评论,我将随时随地编辑这篇文章。 谢谢!

Apache2服务器应该是SSL感知的,但是没有为通配符SSL证书configuration

我想在Apache Web服务器上configurationGodaddy Wild Card证书。我收到以下错误: [Thu Jul 23 02:32:42.499991 2015] [mpm_event:notice] [pid 12293:tid 140626762094464] AH00491: caught SIGTERM, shutting down [Thu Jul 23 02:32:43.553475 2015] [ssl:emerg] [pid 12529:tid 139774360311680] AH02240: Server should be SSL-aware but has no certificate configured [Hint: SSLCertificateFile] (/etc/apache2/sites-enabled/godaddy-ssl.conf:2) [Thu Jul 23 02:32:43.553518 2015] [ssl:emerg] [pid 12529:tid 139774360311680] AH02311: Fatal error initialising mod_ssl, exiting. […]

针对高并发请求优化Apache

我正在运行一个服务于移动应用程序的API请求的Apache2 Ubuntu服务器。 最近我面临的一个瓶颈是,当请求越来越高(更多的并发用户),请求响应越来越慢。 以前需要1秒或2秒,但是一旦并发用户增加(在某个高峰时间),即使服务器负载, CPU和内存仍然很低,也可能会延迟10秒或更长时间。 我的目标是提高Apache2和Ubuntu Server在最低响应时间尽可能多的并发用户的能力。 内存和CPU不是主要的考虑因素,因为VPS规格如果达到极限,可以扩大规模。 我怎样才能做到这一点? 我到目前为止所做的: configurationulimit /etc/security/limits.conf并添加以下内容: 软nofile 40000 努力nofile 40000 软nproc 40000 将以下行添加到/etc/pam.d/common-session 会话需要pam_limits.so configurationApache2 /etc/apache2/mods-enabled/mpm_prefork.conf <IfModule mpm_prefork_module> StartServers 20 MinSpareServers 25 MaxSpareServers 100 MaxRequestWorkers 150 MaxConnectionsPerChild 0 MaxClients 8192 MaxRequestsPerChild 0 ServerLimit 8192 </ IfModule>configuration 将以下行添加到/etc/sysctl.conf fs.file-max = 2097152 响应时间似乎有所改善(虽然有些请求仍然延迟),但不令人满意,因为它仍然比非高峰时间慢得多。

没有R标志的RewriteRule for root不起作用

我正在试图做一个caching系统的文件。 而我正在考虑使用国防部重写服务caching的文件,如果它存在,或PHP文件(这将创buildHTML静态caching),如果没有。 这是我想出的第一个样本 <IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^$ /cache/home.html [L,NC] RewriteCond %{REQUEST_URI} /cache/ RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^cache/home.html /index.php [L] RewriteRule ^page/([0-9]*) /cache/page_$1.html [L,NC] RewriteCond %{REQUEST_URI} /cache/ RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^cache/page_([0-9]*).html /page.php?&id=$1 [L] </IfModule> 这适用于内部页面。 如果我打电话给http://www.example.site/page/1或http://www.example.site/page/2它正确地服务caching的文件或php页取决于文件是否存在。 问题是它不适用于主站点http://www.example.site 如果我为家庭添加一个redirect标志,它实际上工作正常 RewriteRule ^$ /cache/home.html [L,NC,R] 但是,很显然,在这种情况下,如果我打电话给主站点,并且服务于http://www.example.site/cache/home.html这不是我正在寻找的。 这里有几行日志,其中的问题可能是: [Wed Aug 05 11:59:11.751277 2015] [rewrite:trace1] [pid 30670] mod_rewrite.c(468): […]

我如何获得LDAP将当前login的用户凭据传递给本地Apache服务器?

我试图获得SSO(单点login)在本地osTicket安装工作。 我在osTicket网站上find了HTTP passthru插件,并将其安装在osTicket中。 我已经确定插件正在确保我可以访问插件设置。 因此,据我所知,应该发生的事情是,用户的凭据是从Windows读取的,然后直接传递到osTicket,以便用户自动login。如果我错了关于插件应该如何工作,请纠正我。 我还确保LDAP插件正在运行并安装在osTicket中。 我做了一些关于为什么自动login不起作用的研究,并且认识到HTTPauthentication与Windows ADauthentication不一样。 我查了一下SSPI,Kerberos等等,看看是否可以获得Apache的Apache服务器的Windows凭据,并假定LDAP模块应该能够获得这些凭证。 再次,如果我对LDAP模块的工作方式有误,请纠正我。 最后,我刚刚干掉了我的XAMPP安装,并开始了一个WAMP安装。 得到了LDAP的工作,现在我试图find一种方法来获得Apache的凭据。 我写了一个简单的脚本,应该回显当前login的用户。 <?php $user = $_SERVER['REMOTE_USER']; ?> <html> <body> <?php echo $user;?> </body> </html> 但是,当我运行这个脚本,我得到以下错误。 (!)注意:未定义的索引:第2行的C:\ wamp \ www \ servertest.php中的REMOTE_USER 这告诉我,$ _SERVER的超全球不获取当前连接的用户的Windows凭据。 我如何填写这个超级全球数组与Windows凭据? 有什么configuration选项需要添加到我的HTTPD.conf?

Vagrant上的Apache 2.4和Ubuntu 14.04错误:“您无权访问/在此服务器上。

我意识到在这里有很多类似的问题,但我一直在挣扎几个小时,一直无法find解决scheme。 当我尝试通过主机名shopwise.dev (设置到/etc/hosts中的Vagrant框的IP)访问我的Vagrant Ubuntu框时,出现以下错误页面: Forbidden You don't have permission to access / on this server. Apache/2.4.7 (Ubuntu) Server at shopwise.dev Port 80 我创build了文件/etc/apache2/sites-available/shopwise.conf : ServerName host.foxytronics.com NameVirtualHost *:80 <Directory /> Options FollowSymLinks AllowOverride All Require all granted </Directory> <Directory "/home/shopws/public_html"> Options Indexes FollowSymLinks MultiViews AllowOverride All Require all granted </Directory> <VirtualHost *:80> ServerAdmin [email protected] ServerName […]

如何禁用一个Apache虚拟主机上的PHP邮件function?

我想通过Apache2虚拟主机configuration文件禁用PHP函数邮件。 我想要做一个虚拟主机,而不是所有的虚拟主机,我不想在php.ini中禁用此function 如何正确地做到这一点? 提前致谢!

ReverseProxy不适用于OSX El Capitan

我试图通过一个更干净的URL访问我的Plex Web UI。 目前,您可以访问http://marvin.boldlygoingnowhere.org:32400/web/index.html 。 我希望它在http://marvin.boldlygoingnowhere.org/plex inheritance人我有什么, 马文:〜马文$ httpd -v服务器版本: Apache/2.4.16 (Unix) Server built: Aug 22 2015 16:51:57 Server's Module Magic Number: 20120211:47 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: prefork threaded: no forked: yes (variable process count) Server compiled with…. -D APR_HAS_SENDFILE -D APR_HAS_MMAP -D […]