小编Bex*_*Bex的帖子

为什么不推荐直接调用 egrep 或 fgrep?

根据grep-Programs的手册页,

此外,还有两个变体程序 egrep 和 fgrep 可用。egrep 与'grep -E' 相同。fgrep 与'grep -F' 相同。

不推荐使用 egrep 或 fgrep 的直接调用,但提供它是为了允许依赖它们的历史应用程序不加修改地运行。

为什么它们被弃用?

grep

6
推荐指数
1
解决办法
1876
查看次数

OpenBSD httpd.conf 条件

注意:这个问题是关于内置的 OpenBSD http 服务器的命名httpd及其配置。它不适用于任何其他网络服务器。

\n\n

是否可以对新的 OpenBSD http 服务器进行运行时条件配置httpd?na\xc3\xafve 的例子是

\n\n
server "myserver.com" {\n  if $REMOTE_ADDR == "127.0.0.1" block drop\n}\n
Run Code Online (Sandbox Code Playgroud)\n\n

禁止本地访问。

\n\n

另一个也许更相关和更具启发性的例子是,我正在实现一个从特定位置运行的远程服务的接口,那么我将受益于类似的东西

\n\n
remote_service1_ip = "192.168.0.1"\nserver "myserver.com" {\n  location "/remote_service1_api/" {\n    if $REMOTE_ADDR != $remote_service1_ip block drop\n  }\n}\n
Run Code Online (Sandbox Code Playgroud)\n\n

如果这是可能的,正确的做法是什么?

\n\n

man更一般地说 - OpenBSD 的页面httpd.conf中指定了许多预定义的宏,如下所述block

\n\n
$DOCUMENT_URI\n    The request path.\n$QUERY_STRING\n    The optional query string of the request.\n$REMOTE_ADDR\n    The IP address of the connected client.\n$REMOTE_PORT\n    The TCP source port …
Run Code Online (Sandbox Code Playgroud)

openbsd webserver http openbsd-httpd

5
推荐指数
1
解决办法
1506
查看次数

标签 统计

grep ×1

http ×1

openbsd ×1

openbsd-httpd ×1

webserver ×1