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

发布于 2024-07-14 19:09:44 字数 988 浏览 8 评论 0原文

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.confmy.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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

似狗非友 2024-07-21 19:09:44

您是否尝试过将 resolv.conf 放入 chroot 中? 例如:

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

如果您发现您的网络服务器时间与您所在的时区不同,您也可能希望对 /etc/localtime 执行相同的操作。

注意:

  • 不要使用符号链接,因为它无法通过 chroot 工作。
  • 不要使用硬链接,因为修改 chroot 中的文件会修改 /etc 中的文件!

Have you tried putting resolv.conf inside 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.

Note:

  • do not use a sym link because it won't work through chroot
  • do not use a hard link because modifying file in chroot would modify file in /etc!
豆芽 2024-07-21 19:09:44

“无法确定服务器的完全限定域名”错误可以忽略,这是 apache 内部的事情。

根据 http://dev.mysql.com/doc /refman/5.0/en/error-lost-connection.htmlhttp ://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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文