问题标签 [apache-modules]
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.
c - Global variables in Apache Server
I'm writing some apache (2.2) modules in C and I'm pretty new at it, so I was wondering:
I need to know if it's possible to create a global variable that will be initiated whenever the apache server starts to run.
See, I need to have a list of host names (that will be "privileged"), so that every request I get, I need to check if the host name appears in the list (to check if it's "previleged").
So the list should be global (so that every server instance will have the same instance of the list), and I need to initialize it at the beginning.
How do I do that, if it's at all possible?
Thanks!
c - Apache Server 中的日常任务
我正在用 C 编写一些 apache (2.2) 模块,而且我对它很陌生,所以我想知道:
我想做一个日常任务。将读取文件并将其数据插入列表的一种。
那可能吗?
谢谢!
html - 有人知道 mod_layout apache 模块的好替代品吗?
我已经为我的 apache 服务器使用 mod_layout 模块很长时间了……但是,最近,它并没有正常工作。
我不想尝试修复模块(我认为作者已经放弃了它),我想找到一个不同的选项。
基本上,mod_layout 让我可以即时将测试和/或文件插入到 html 中。我可以在 html 中出现的特定文本的开头、结尾或之后插入文本。
python - 让 apache 在 mac 上运行 python
所以我有一个新的mac,我试图让它用mod_python、mod_wsgi和django运行apache。我有一个测试 test.py 只包含:
#!/usr/bin/python
print "Content-type: text/html"
print
print "<html><head>"
print ""
print "</head><body>"
print "Test Page"
print "</body></html>"
我刚刚下载了 xcode4,使用 macports 通过这些网站上提供的步骤安装 apache、php5 和 mod_wsgi:
http ://www.phpied.com/installing-php-and-apache-on-mac-osx-that -was-pretty-easy/
http://heisel.org/blog/2009/09/25/mod-wsgi-mac/
由于某种原因 mod_python 不起作用所以我从 svn 下载了最新的源代码并执行标准./configure --with-apxs=/opt/local/apache2/bin/apxs
make
sudo make install
然后使用 LoadModule blah modules/blah.so 配置 httpd.conf
当我启动 apache 时
并在我的浏览器中导航到 test.py,我以纯文本形式看到了整个文件,我知道这是不对的。我在 httpd.conf 中打开了 python 调试,当我再次导航到 test.py 时看到了这个,弹出:
任何人都知道有什么问题或知道如何在带有 xcode 4 的 mac 上执行此操作的教程(是的,在我的研究中这实际上是相关的,因为 xcode 4 取消了一些架构支持,从而使一些模块过时了)?
apache2 - 在 apache 模块中配置 Apache 客户端超时
我正在编写一个 apache 模块,我想知道如何处理我的 ap_rwrite 尝试将某些内容写回客户端而客户端没有响应的情况。对 ap_rwrite 的调用是否会阻塞直到发生这种情况?
我可以设置一个超时吗?如果是这样,它叫什么?
谢谢!
apache - Apache mod_evasive 问题
我正在为我的网站使用 mod_evasive apache 模块,它似乎工作得很好。由于您可以在配置中指定在触发规则时运行外部命令,因此我添加了类似
一切正常,但我收到的电子邮件没有发件人,也没有主题,正文如下所示:
无论如何我可以使用自定义地址和自定义主题配置 mod_evasive 吗?
apache2 - 用于访问 Apache 模块中的引用者字段的 API
我在 request_rec* 结构中找不到它?有没有办法可以在 Apache 模块中访问它?
谢谢!
python - 有没有更简单的方法可以让 apache/mod_wsgi 在 py 文件更改时自动重启?
我有一个在 apache/mod_wsgi 中运行的 django 站点。每次更新代码后,我都需要手动重新启动 apache。
mod_wsgi 提供了一种方法来做到这一点:http ://code.google.com/p/modwsgi/wiki/ReloadingSourceCode 我认为有点,不太体面。
所以我的问题是:有没有更简单、更体面的方法呢?例如监控文件状态或其他东西的apache mod。如果没有,是否可以编写一个 apache mod 来做到这一点?
c - Apache 的写入权限以更新 /var/www 文件夹
我正在编写一个执行以下操作的 apache 模块:
1)用户请求一个页面(index.html)
2) Apache 模块将充当过滤器,计算 index.html 中的单词数,然后将单词数附加到 html 文件的页脚。
3)用有页脚的那个覆盖index.html,也就是新的index.html
4)向用户提供http请求。
基本上,当我使用 fwrite 将页脚附加到 index.html 时,第 3 步出现问题,但无济于事。我想它是一个文件访问权限错误。
我想知道解决此问题的最佳方法是什么,因为我了解到允许对 www 目录进行写访问是一种高安全风险。
apache - 在 MAMP 上安装 apache 模块 X-Sendfile
如何安装 X-Sendfile apache 模块以便 MAMP 可以使用它?
我已按照这些说明安装 X-Sendfile,但它不起作用(似乎它只是为默认的 apache 安装安装了它)。我也尝试手动复制/usr/libexec/apache2/mod_xsendfile.so
到/Applications/MAMP/Library/modules/
,但是在重新启动 Apache 时产生了以下错误:
Cannot load /Applications/MAMP/Library/modules/mod_xsendfile.so into server: cannot create object file image or add library