昨晚在配置phpMyAdmin时突然无法打开了,打开主页显示空白,位于/etc/httpd/logs/error_log下面的apache的错误日志显示如下:
[Wed Mar 21 14:10:47.800034 ] [autoindex:error] [pid 13460] [client ::1:35522] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive
[Wed Mar 21 14:14:28.810509 ] [mpm_prefork:notice] [pid 13459] AH00170: caught SIGWINCH, shutting down gracefully
[Wed Mar 21 14:14:30.104634 ] [suexec:notice] [pid 13789] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Wed Mar 21 14:14:30.119509 ] [auth_digest:notice] [pid 13789] AH01757: generating secret for digest authentication ...
[Wed Mar 21 14:14:30.11 ] [lbmethod_heartbeat:notice] [pid 13789] AH02282: No slotmem from mod_heartmonitor
[Wed Mar 21 14:14:30.128561 ] [mpm_prefork:notice] [pid 13789] AH00163: Apache/2.4.6 (CentOS) PHP/7.2.3 configured -- resuming normal operations
[Wed Mar 21 14:14:30.128596 ] [core:notice] [pid 13789] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Wed Mar 21 14:15:42.520244 ] [mpm_prefork:notice] [pid 13789] AH00170: caught SIGWINCH, shutting down gracefully
网上到查了半天也没有查处原因,也尝试过重装apache,刚才想到了配置文件的问题,于是把位于/var/www/html的phpMyAdmin安装目录下的config.sample.inc.php文件重新拷贝一份覆盖config.inc.php,问题解决。看来是改这个文件的时候不小心改错了,小小问题又花半天了时间。
总结两点经验:1、linux下某些程序无法运行的时候可以想想是不是配置文件的问题。2、养成拷贝文件而不是重命名文件、备份文件的好习惯。