Tag: Apache

Java XPath(Apache JAXP实现)的性能

注意:如果您也遇到此问题,请在Apache JIRA上加注: https://issues.apache.org/jira/browse/XALANJ-2540 我得出了一个惊人的结论: Element e = (Element) document.getElementsByTagName("SomeElementName").item(0); String result = ((Element) e).getTextContent(); 似乎是一个令人难以置信的100倍比这更快: // Accounts for 30%, can be cached XPathFactory factory = XPathFactory.newInstance(); // Negligible XPath xpath = factory.newXPath(); // Negligible XPathExpression expression = xpath.compile("//SomeElementName"); // Accounts for 70% String result = (String) expression.evaluate(document, XPathConstants.STRING); 我正在使用JVM的JAXP默认实现: org.apache.xpath.jaxp.XPathFactoryImpl org.apache.xpath.jaxp.XPathImpl 我很困惑,因为很容易看出JAXP如何优化上述XPath查询来实际执行一个简单的getElementsByTagName() 。 但似乎并没有这样做。 这个问题被限制在5-6个经常使用的XPath调用中,这些调用被API抽象和隐藏。 […]

虚拟主机对于通配符子域和静态子域

我有一个奇怪的情况,我想要的urlapp1.example.com , example.com和*.example.com都使用不同的虚拟主机。 这是我所拥有的(不包括example.com因为它使得它变得更加混乱)。 <VirtualHost *> ServerName app1.example.com ServerAlias app1.example.com DocumentRoot = /var/www/app1 # Other configuration for this app here </VirtualHost> <VirtualHost *> ServerName wildcard.example.com ServerAlias *.example.com DocumentRoot = /var/www/wildcard # other configuration for this app here </VirtualHost> 问题是他们冲突。 无论哪一个首先列出胜出。 我如何同时托pipe通配符虚拟主机和特定的虚拟主机? 注意:我不只是在configuration中更改DocumentRoot ,所以使用mod_rewrite更改DocumentRootvariables并不能解决这个问题。

只有variables引用应该由引用返回 – Codeigniter

服务器PHP升级之后,我在Apache 2.0上获得了PHP 5.6.2版的以下错误 A PHP Error was encountered Severity: Notice Message: Only variable references should be returned by reference Filename: core/Common.php Line Number: 257 我该如何解决这个问题?

什么是mod_php?

在阅读Zend教程的同时 ,我遇到了以下的说法: 请注意,.htaccess中的php_flag设置只有在使用mod_php时才有效。 有人可以解释这是什么意思?

WAMP / XAMPP在本地主机上响应非常慢

我不知道问题是什么。 WAMP很慢,所以我重新格式化了我的电脑并安装了WAMP。 尽pipe如此,访问本地主机是非常,非常缓慢,有时甚至不加载。 我甚至删除它,并用XAMPPreplace它,但我仍然得到相同的结果。 可能是什么问题? 这是我目前的主机文件: 127.0.0.1 localhost 127.0.0.1 localhost 之前这样工作的很好,但是我不知道发生了什么事情,为什么最近开始performance奇怪,因为即使是重新格式化也没有解决。

浏览器过时的encryption警告

我已经开始使用Apache 2.4和SSL的Windows Server。 当我连接到https://www.example.com并点击绿色锁,我有消息: 您的网站连接使用过时的密码encryption 有什么build议吗? 以下是ssl.conf : # # This is the Apache server configuration file providing SSL support. # It contains the configuration directives to instruct the server how to # serve pages over an https connection. For detailed information about these # directives see <URL:http://httpd.apache.org/docs/2.4/mod/mod_ssl.html> # # Do NOT simply read the […]

PHP / Apache中的Inkscape不会将字体呈现给PNG

我今天发现的问题与这个未解决的问题类似, 虽然不一样,但可能有同样的原因。 我使用inkscape渲染SVG文件,如PNG或PDF。 在大多数情况下,我打算使用Gearman在后台渲染这些内容,但现在我正在PHP / Apache进程中创build一些缩略图。 看起来,如果inkscape在Apache进程中被调用(通过PHP的exec ),它不能find它需要渲染的字体。 因此,graphics元素渲染良好,但任何文本元素都不会在PNG输出中绘制。 我怀疑从Apache内部的CLI环境是不同的,我的平时bash控制台的方式,这意味着字体不能被看到。 我在OS X 10.6.8上。 有任何想法吗? 编辑:继续从评论中,我已经捕获了Apache和Gearman中的php -i ,并将第一个和第二个(第二个是diff)进行比较(理论上应用diff会使它工作)。 结果在这里 。 编辑2:我已经尝试在两个环境使用system convert -list font – 没有任何差异。

与WSGIDaemonProcess的django apacheconfiguration不工作

更新了问题 [Mon Jul 18 09:20:10.517873 2016] [:error] [pid 30316:tid 139756302964480] [remote 122.164.94.99:48261] Traceback (most recent call last): [Mon Jul 18 09:20:10.518005 2016] [:error] [pid 30316:tid 139756302964480] [remote 122.164.94.99:48261] File "/var/www/rent/Rent/wsgi.py", line 20, in <module> [Mon Jul 18 09:20:10.518141 2016] [:error] [pid 30316:tid 139756302964480] [remote 122.164.94.99:48261] from django.core.wsgi import get_wsgi_application [Mon Jul 18 09:20:10.518236 2016] [:error] […]

用htaccess拒绝目录列表

我有一个文件夹,例如: /public_html/Davood/和文件夹中的太多子文件夹,例如: /public_html/Davood/Test1/ , /public_html/Davood/Test1/Test/ , /public_html/Davood/Test2/ , … 我想添加一个htaccess文件到/public_html/Davood/否认DirectoryListing在/Davood和子文件夹,这是可能的?

从PHP脚本执行一个Bash脚本

我想从PHP脚本执行系统上的Bash脚本。 我在系统上有两个脚本。 其中一个是名为client.php的PHP脚本,它存在于/ var / www / html,另一个是名为testscript的Bash脚本,它存在于/ home / testuser。 我的client.php脚本看起来像 <?php $message=shell_exec("/home/testuser/testscript 2>&1"); print_r($message); ?> 我的testscript看起来像 #!/bin/bash echo "Testscript run succesful" 当我在terminal上做以下事情 php client.php 我在terminal上得到以下输出 Testscript run successful 但是,当我打开页面 http://serverdomain/client.php 我得到以下输出 sh: /home/testuser/testscript: Permission denied 即使在执行了chmod + x testscript之后,我仍然得到这个错误。 我怎样才能从浏览器中工作? 请帮忙。