AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-82683

jbrahy's questions

Martin Hope
jbrahy
Asked: 2017-03-11 11:26:10 +0800 CST

在命名中使用 ip 为每个客户端自动专用 access_log

  • 0

我们有一个内部应用程序,我想让 apache httpd 服务器根据每个客户端 ips 创建新的日志文件。在我看到的文档中,您可以有多个日志。

http://httpd.apache.org/docs/2.2/logs.html

LogFormat "%h %l %u %t \"%r\" %>s %b" common
CustomLog logs/access_log common
CustomLog logs/referer_log "%{Referer}i -> %U"
CustomLog logs/agent_log "%{User-agent}i"

但我真正想要的是这样的。

CustomLog logs/%h-access_log common

其中 %h 被推断为 IP 地址,即 1.1.1.1-access_log

我想有一种 mod_perl 方法可以做到这一点,但只是想知道在我编写模块之前是否有人知道通过标准配置来做这样的事情。

http apache-2.2 configuration web mod-perl
  • 1 个回答
  • 86 Views
Martin Hope
jbrahy
Asked: 2015-08-06 18:32:57 +0800 CST

随机重定向到 .html 网站的 404

  • 2

我有大约 25 台服务器在负载均衡器后面运行数百个网站。他们都在 CentOS 6.6 上使用 Apache/2.2.15。有一个站点具有随机 301,它们正在重定向到另一个站点的 https 版本。我已经完成了配置和 rsync -azvp --delete'd 所有 conf.d 目录,但仍然有这个非常奇怪的错误。我很想知道在哪里调试这个非常奇怪的错误。

我在 apache 日志中没有看到 303 重定向,但我在另一个网站的 ssl 版本中看到了 404 错误,并且在 Chrome 开发者控制台中看到了重定向。

/var/log/subdomain-website-access_log:1.1.1.1 - - [04/Aug/2015:09:33:44 -0700] "GET /images/header.jpg HTTP/1.1" 404 313

当我将http://www.website.com/images/header.jpg放入浏览器的 URL 时,它也会重定向到 404。

这是具有随机重定向的站点的配置

<VirtualHost *:80>
    ServerName www.website.com
    ServerAlias website.com
    ServerAdmin [email protected]
    DocumentRoot /home/website.com/www
    ErrorLog /var/log/website.com-error_log
    CustomLog /var/log/website.com-access_log combined
    LogLevel error

    <Directory "/">
        Options None
        AllowOverride None
    </Directory>

    <Directory "/home/website.com/www">
        Options None
        AllowOverride None
        Order allow,deny
        allow from all
    </Directory>
</VirtualHost>

这是获取它们的站点的配置。

<VirtualHost *:80>
        ServerName subdomain.website.com
        Redirect permanent / https://subdomain.website.com/
</VirtualHost>

<VirtualHost *:443>
    ServerName [email protected]
    DocumentRoot /home/subdomain/www
    ServerName subdomain.website.com

    ErrorLog "/var/log/subdomain-website-error_log"
    CustomLog "/var/log/subdomain-website-access_log" common
    LogLevel error

    # Turn on Expires and set default to 0
    ExpiresActive On
    ExpiresDefault A0

    SSLEngine on
    SSLProtocol all -SSLv2 -SSLv3
    SSLHonorCipherOrder on
    SSLCipherSuite "EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 EECDH+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 EECDH+aRSA+RC4 EECDH EDH+aRSA RC4 !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS"
    SSLCertificateFile "/etc/httpd/certs/website.crt"
    SSLCertificateKeyFile "/etc/httpd/certs/website.key"
    SSLOptions +StdEnvVars
    BrowserMatch "MSIE [2-5]" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0

    <Directory />
        Options Indexes FollowSymLinks MultiViews +ExecCGI +SymLinksIfOwnerMatch
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>

    <Directory "/home/subdomain/www/">
        Options Indexes FollowSymLinks MultiViews +ExecCGI +SymLinksIfOwnerMatch
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>
</VirtualHost>
apache-2.2
  • 1 个回答
  • 762 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve