部署了discuz ,但是页面响应太慢。
-
apache 调成debug 级别看日 (httpd.conf 里设置)
Apache 没问题,自己写的php,html 页面访问响应都很快。
-
看数据库日志 是数据存储目录下 localhost.localdomain.err
看到 如下 错误
2014-08-28 11:00:59 19992 [Warning] IP address ‘192.168.2.241‘ could not be resolved: Temporary failure in name resolution 2014-08-28 11:01:00 19992 [Warning] IP address ‘192.168.2.241‘ could not be resolved: Temporary failure in name resolution 2014-08-28 11:01:00 19992 [Warning] IP address ‘192.168.2.241‘ could not be resolved: Temporary failure in name resolution 2014-08-28 11:01:00 19992 [Warning] IP address ‘192.168.2.241‘ could not be resolved: Temporary failure in name resolution 2014-08-28 11:01:00 19992 [Warning] IP address ‘192.168.2.241‘ could not be resolved: Temporary failure in name resolution
网上查了下 ,说是mysql 域名解析的原因引起的
我当时 是在 /etc/hosts
里添加了当前ip 地址,对应一个域名
192.168.2.241 test_1.smart.com.cn
然后重启apache 访问就很快了。
网上说在mysql 配置文件 my.cnf
[mysqld] #stop yu ming jie xi #-skip-host-cache skip-name-resolve
这样修改后,以后添加新用户要注意了。要配置ip 地址,不能使域名,或者授权
mysql> select host,user from mysql.user; +-----------------------+--------+ | host | user | +-----------------------+--------+ | % | discuz | | 127.0.0.1 | root | | ::1 | root | | localhost | | | localhost | root | | localhost.localdomain | | | localhost.localdomain | root | +-----------------------+--------+