问题标签 [httpd.conf]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
django - 使用 apache 部署 django 时遇到问题
您好,我在 Django 尝试使用 apache 将其部署在服务器上时遇到问题。出于某种原因,当我将此信息写入我的 httpd.conf 文件时。
重新启动 apache 时出现此错误。
有任何想法吗?
php - 使用 Web 域或系统路径 URL 访问 PHP 中的文件
我的计算机上有一个 localhost Apache/PHP 配置。我希望能够
1)使用绝对路径检查图像文件的存在和
2) 使用相同的 URL 显示它
我想做的一个简单的例子:
如果我设置...
然后 file_exists 将返回 false,因为 URL 是 Web 路径 (http://localhost/myimg.jpg)。
如果我设置...
它将识别文件存在(C:/htdocs/myimg.jpg),但无法显示图像,因为它无法访问图像源。如果我查看源代码并将 URL 复制/粘贴到 Web 浏览器的地址栏中,则图像显示得很好。
也许我在 Apache 的 httpd.conf 文件或 PHP.ini 中遗漏了一些东西?也许是某种别名声明。此外,站点完成后将上传到远程 Web 服务器(例如 bluehost.com),因此我需要一个通用的解决方案。
PHP.ini 中的 allow_url_fopen 已打开,每次我在 httpd.conf 或 PHP.ini 中进行更改时,我都会重新启动服务器。我已经为此苦苦挣扎了好几天,所以即使是正确方向的一点也将不胜感激:)
谢谢。
apache - ErrorDocument not working with local file
I am working on a web app that I'm running on Tomcat 6.0.18, and I am using Apache 2 as a reverse proxy. This works fine. I'm also trying to get Apache to display error pages when, for example, I've shutdown Tomcat for redeployment etc. However, the ErrorDocument
directive in my httpd.conf doesn't seem to work at all for local files. I've tried external urls and strings and both of these cases work fine. But the below does not work:
The Oops.html file is in my htdocs folder. Here is some log output from httpd when I try accessing app when Tomcat is not running but httpd is:
Note that I'm not using an .htaccess file. It seems that there is some problem with the settings related to htdocs folder. Below are some bits from my httpd.conf file that has to do with the htdocs foler. I'm new to working with Apache so I'm not sure how relevant this is or if I should post more.
Any help much appreciated!
EDIT:
When Tomcat is running I see these lines in the error log:
Something isn't configured correctly but I have no I what or where. Thanks for the responses so far, but still stumped.
apache - 从 LAN 上的任何计算机访问 Apache VirtualHost?
我在 httpd.conf 中有很多网站设置为虚拟主机
我在 wamp 机器的主机文件中有这些输入,我可以在该机器上正常访问它们。
但是,当我尝试在我的 OSX 机器上输入一个条目(192.168.1.101 是 wamp 机器的内部 ip)时,它不会向上拉页面。
我还需要做些什么才能从其他机器上完成这项工作吗?谢谢!
apache - Apache:Kohana 框架的 httpd.conf 中的虚拟主机和 URL 重写
我正在使用 Kohana Framework 3.x。我的网络服务器是 Apache,我使用虚拟主机,因为我用我的服务器管理多个网站。
我的 httpd.conf 看起来像这样:
在 Kohana 中,每个 http 请求都需要先转到 index.php。因为我不喜欢这些以 index.php 开头的丑陋 URL(例如 www.myPage1.com/index.php/item/detail/itemId),所以我使用了以下完美运行的 .htaccess 文件
我现在不想再使用 .htaccess 文件,而是将所有重写逻辑放入我的 httpd.conf 文件中。以下给了我一个“400 Bad Request”
我究竟做错了什么?帮助将不胜感激!
.htaccess - 将 .htaccess 中的 mod_rewrite 规则转换为 httpd.conf
我有一组 html 文件位于:www.example.com 和“主站点”(测试版)位于:www.example.com/abcd/(需要这些 mod_rewrite 规则)
mod_rewrite 规则在 .htaccess 中的目录中运行良好。我需要把它们放在 httpd.conf 中:
.htaccess 中的规则如下所示:
将以下内容复制到 httpd.conf 文件中不起作用:
它给出了一个错误:
我需要像这样修改所有规则吗?
编辑1
我试图转换以下行:
到:
但我得到如下错误。
当我尝试访问http://www.example.com/abcd/ins/Sustainability/282.html时,我在日志中收到以下错误:
当我尝试访问http://www.example.com/abcd/ins.html时,我在日志中收到以下错误:
我已将 RewriteLogLevel 设置为 2
我们的 mod_rewrite 规则的未修改版本位于:https ://webmasters.stackexchange.com/questions/4237/url-rewritten-pages-take-much-longer-to-load
apache - 在这种情况下如何使用 SetEnvIf?
我尝试将 X-FRAME-OPTIONS 放入 http 标头以防止 Clickjacking 攻击。如果我像这样在 httpd.conf 或 .htaccess 文件中设置标题,它就可以工作。
但是有几个地方在我自己的网站上使用 iFrame,如果我这样做,它也会阻止我自己网站上的 iFrame。所以我尝试为我自己的网站添加一个例外。检查请求是否来自我自己的网站,然后在页面上允许 iFrame。我试过这个,但它没有用。
有人可以帮我解决这个问题吗?
windows - 带有 SVN 的网站:工作副本:为本地 svn 结帐配置 Apache httpd.conf - 如何?
我曾与 SVN 和 Apache 合作过,但没有一起工作。
我的客户在一个地址有一个实时站点,在另一个地址的另一台机器上有一个 SVN 存储库。
我已经检查了整个 9 码到运行 Apache/2.0.59 的本地 (Windows XP) 机器上的一个目录。(配置本地站点通常没有问题。)
我在结帐时得到 3 个目录:
分支、
标签、
主干
我的 DocumentRoot 应该使用哪一个?
谢谢阅读。
apache2 - 我可以在 httpd.conf 中使用 shell 中的主机名等环境变量吗?
我试图让我所有的网络服务器将他们的日志写入共享存储系统。我想使用系统环境变量,这样我就不必维护 20 多个 httpd.conf 文件。我的 httpd.conf 文件是我部署的一部分,我们这样做是为了如果我们需要更改某些内容,所有主机都会得到该更改。
我想做的是这样的:
错误日志“|/usr/local/apache2/bin/rotatelogs /data/logs/apache/${hostname}_error_log.%Y-%m-%d 86400”
其中主机名与 shell 命令返回的内容相同,例如:
user@server1.domain@01:47:17:~ $> 主机名 server1.domain
apache - 使用 MAMP 允许 htdocs 文件夹中所有 HTML 页面的 SSI 包含指令
我使用 MAMP 开发网站。我在 htdocs 文件夹中拥有自己的文件夹中的每个站点。我管理一个需要使用 ssi 指令的站点,因为主机不允许 php 包含。
我在 httpd.conf 文件中取消了对这些行的注释:
我在 htdocs 文件夹中添加了一个 .htaccess 文件,其中包含以下内容:
在站点索引页面上,包含使用:
但它不适用于任何子文件夹中的文件。我收到此错误: