在 openBSD 上 chroot Apache+MsSQL; 无法确定服务器的完全限定域名
php 使用第二台服务器上的数据库在 Web 服务器上生成 GIF。 页面显示 20 个 GIF,因此短时间内有一些加载(多个连接)
有些 GIF 已加载,但有些未加载,位于 /var/var/www/logs/error_log
[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
中/www/logs/error_log 在MySQL服务器上我发现:
[alert] httpd: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
重新启动MySQL服务器“解决”了问题......几天。
两台服务器是运行 OpenBSD、chroot 的 Apache 和 MySQL + phpMyAdmin 的虚拟机。 不幸的是,在不同的版本(OpenBSD 4.2(web)和3.9(mysql))中,
我在 /var/www/conf/httpd.conf
和 my.cnf
中的知识(没有)没有找到)非常有限。
有任何想法吗 ?
php generates GIFs on the web server using a databases on a second server.
The page shows 20 GIFs, so there is some load for a short time (multiple connections)
Some GIFs are loaded but some are not, in /var/www/logs/error_log
[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:
[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.
The 2 servers are virtual machines running OpenBSD, chroot'ed Apache and MySQL + phpMyAdmin.
unfortunately in diferent versions (OpenBSD 4.2(web) and 3.9(mysql))
my knowledge in /var/www/conf/httpd.conf
and my.cnf
(didn't found it) is very limited.
Any ideas ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您是否尝试过将 resolv.conf 放入 chroot 中? 例如:
如果您发现您的网络服务器时间与您所在的时区不同,您也可能希望对 /etc/localtime 执行相同的操作。
注意:
Have you tried putting resolv.conf inside chroot? Such as:
You may also wish to do the same for /etc/localtime if you find your web server time is off from your time zone.
Note:
“无法确定服务器的完全限定域名”错误可以忽略,这是 apache 内部的事情。
根据 http://dev.mysql.com/doc /refman/5.0/en/error-lost-connection.html 和 http ://bugs.mysql.com/bug.php?id=28359 这听起来要么是网络速度慢,要么是 mysql 过载,无法足够快地响应连接。
鉴于重新启动可以解决问题,我猜测您的资源泄漏速度很慢。 可能类似于在 mysql 上运行的昂贵查询。 您应该能够通过跟踪一段时间内的系统负载来验证这一点。
The "Could not determine the server's fully qualified domain name" error can be ignored, that's an internal apache thing.
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.
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. You should be able to verify this by tracking system load over time.