简体   繁体   English

在 openBSD 上 chroot Apache+MsSQL; 无法确定服务器的完全限定域名

[英]chrooted Apache+MsSQL on openBSD; Could not determine the server's fully qualified domain name

php generates GIFs on the web server using a databases on a second server. php 使用第二台服务器上的数据库在 Web 服务器上生成 GIF。 The page shows 20 GIFs, so there is some load for a short time (multiple connections)该页面显示 20 个 GIF,因此在短时间内有一些负载(多个连接)


Some GIFs are loaded but some are not, in /var/www/logs/error_log/var/www/logs/error_log ,某些 GIF 已加载,但有些未加载

[Mon Feb 23 10:05:56 2009] [error] PHP Warning:  mysql_connect() [function.mysql-connect]: Lost connection to MySQL server at 'reading initial communication packet', system error: 0 in /htdocs/.../myImage.php on line 4
[Mon Feb 23 10:05:56 2009] [error] PHP Fatal error: Lost connection to MySQL server at 'reading initial communication packet', system error: 0 in /htdocs/.../myImage.php on line 4

in /var/www/logs/error_log on the MySQL server I found:在我发现的 MySQL 服务器上的/var/www/logs/error_log

[alert] httpd: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

Rebooting the MySQL server "resolves" the problem ... for a few days.重新启动 MySQL 服务器“解决”了问题......几天。

The 2 servers are virtual machines running OpenBSD, chroot'ed Apache and MySQL + phpMyAdmin.这两个服务器是运行 OpenBSD、chroot 的 Apache 和 MySQL + phpMyAdmin 的虚拟机。 unfortunately in diferent versions (OpenBSD 4.2(web) and 3.9(mysql))不幸的是在不同的版本(OpenBSD 4.2(web)和3.9(mysql))

my knowledge in /var/www/conf/httpd.conf and my.cnf (didn't found it) is very limited.我对/var/www/conf/httpd.confmy.cnf (没有找到)的了解非常有限。
Any ideas ?有任何想法吗 ?

The "Could not determine the server's fully qualified domain name" error can be ignored, that's an internal apache thing.可以忽略“无法确定服务器的完全限定域名”错误,这是 apache 内部的事情。

Per http://dev.mysql.com/doc/refman/5.0/en/error-lost-connection.html and http://bugs.mysql.com/bug.php?id=28359 this sounds like either a slow network, or an overloaded mysql that can't respond to connections fast enough.根据http://dev.mysql.com/doc/refman/5.0/en/error-lost-connection.htmlhttp://bugs.mysql.com/bug.php?id=28359这听起来像是一个缓慢的网络,或无法足够快地响应连接的过载 mysql。

Given that rebooting fixes the issue, I'm going to guess that you've got a slow resource leak.鉴于重新启动解决了这个问题,我猜你有一个缓慢的资源泄漏。 Probably something like expensive queries left running on mysql.可能像在 mysql 上运行的昂贵查询之类的东西。 You should be able to verify this by tracking system load over time.您应该能够通过随时间跟踪系统负载来验证这一点。

Have you tried putting resolv.conf inside chroot?您是否尝试将 resolv.conf 放入 chroot 中? Such as:如:

mkdir -p /var/www/etc/ && cp -p /etc/resolv.conf /var/www/etc/

You may also wish to do the same for /etc/localtime if you find your web server time is off from your time zone.如果您发现您的 Web 服务器时间与您的时区不同,您可能还希望对 /etc/localtime 执行相同的操作。

Note:笔记:

  • do not use a sym link because it won't work through chroot不要使用符号链接,因为它不能通过 chroot 工作
  • do not use a hard link because modifying file in chroot would modify file in /etc!不要使用硬链接,因为修改 chroot 中的文件会修改 /etc 中的文件!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM