免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2443 | 回复: 3
打印 上一主题 下一主题

[Web] 菜鸟求助:apache 中的 SSI 问题(已解决) [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-11-25 21:38 |只看该作者 |倒序浏览
环境:
redhat as 4.4 使用 rpm包安装 apache 2.0 +php4+mysql4.1
网站为 php 和 shtml 的

apache SSI 相关配置

<Directory "/var/www/html">
    Options Indexes Includes
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>
#
# Filters allow you to process content before it is sent to the client.
#
# To parse .shtml files for server-side includes (SSI):
# (You will also need to add "Includes" to the "Options" directive.)
#
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
虚拟主机配置

<VirtualHost *:80>
#    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot /var/www/html/xxxx.org.cn
    ServerName www.xxxx.org.cn
    ErrorLog logs/xxxx.org.cn-error_log
    CustomLog logs/xxxx.org.cn-access_log common
</VirtualHost>

现象:service 运行php其他网站正常,但上面的虚拟主机对应的网站,配置好SSI后,运行ok了,但今天不知道什么原因显示有问题了。

部分报错日志

[client 121.29.176.89] PHP Notice:  Undefined variable:  usr_flag in /var/www/html/XXXX.org.cn/new_xxxx/inc/ifr_login_index_wynn.php on line 50, referer: http://www.xxxx.org.cn/new_xxxx/index_wynn_div.shtml
[client 121.29.176.89] PHP Notice:  Undefined variable:  usr_flag in /var/www/html/xxxx.org.cn/new_xxxx/inc/ifr_login_index_wynn.php on line 56, referer: http://www.xxxx.org.cn/new_xxxx/index_wynn_div.shtml

[ 本帖最后由 cnzg_y 于 2008-11-26 12:12 编辑 ]

论坛徽章:
0
2 [报告]
发表于 2008-11-25 22:45 |只看该作者
从贴出的虚拟主机部分的配置文件来看 没有什么问题,但是log 贴的太少,不能看出具体问题根源。建议贴上系统的 log 和 apache 的 error log 文件来进行分析。

论坛徽章:
0
3 [报告]
发表于 2008-11-25 22:58 |只看该作者
原帖由 liang3391 于 2008-11-25 22:45 发表
从贴出的虚拟主机部分的配置文件来看 没有什么问题,但是log 贴的太少,不能看出具体问题根源。建议贴上系统的 log 和 apache 的 error log 文件来进行分析。


apache 的 error 如下
[Tue Nov 25 17:58:14 2008] [notice] Digest: done
[Tue Nov 25 17:58:14 2008] [notice] LDAP: Built with OpenLDAP LDAP SDK
[Tue Nov 25 17:58:14 2008] [notice] LDAP: SSL support unavailable
[Tue Nov 25 17:58:14 2008] [notice] mod_python: Creating 4 session mutexes based on 256 max processes and 0 max threads.
[Tue Nov 25 17:58:14 2008] [notice] Apache/2.0.52 (Red Hat) configured -- resuming normal operations
[Tue Nov 25 18:06:09 2008] [notice] caught SIGTERM, shutting down
[Tue Nov 25 18:06:10 2008] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Tue Nov 25 18:06:10 2008] [notice] Digest: generating secret for digest authentication ...
[Tue Nov 25 18:06:10 2008] [notice] Digest: done
[Tue Nov 25 18:06:10 2008] [notice] LDAP: Built with OpenLDAP LDAP SDK
[Tue Nov 25 18:06:10 2008] [notice] LDAP: SSL support unavailable
[Tue Nov 25 18:06:10 2008] [notice] mod_python: Creating 4 session mutexes based on 256 max processes and 0 max threads.
[Tue Nov 25 18:06:10 2008] [notice] Apache/2.0.52 (Red Hat) configured -- resuming normal operations
[Tue Nov 25 18:08:48 2008] [notice] SIGHUP received.  Attempting to restart
[Tue Nov 25 18:08:48 2008] [notice] Digest: generating secret for digest authentication ...
[Tue Nov 25 18:08:48 2008] [notice] Digest: done
[Tue Nov 25 18:08:48 2008] [notice] LDAP: Built with OpenLDAP LDAP SDK
[Tue Nov 25 18:08:48 2008] [notice] LDAP: SSL support unavailable
[Tue Nov 25 18:08:48 2008] [notice] mod_python: Creating 4 session mutexes based on 256 max processes and 0 max threads.
[Tue Nov 25 18:08:49 2008] [notice] Apache/2.0.52 (Red Hat) configured -- resuming normal operations
[Tue Nov 25 18:15:28 2008] [notice] SIGHUP received.  Attempting to restart
[Tue Nov 25 18:15:28 2008] [notice] Digest: generating secret for digest authentication ...
[Tue Nov 25 18:15:28 2008] [notice] Digest: done
[Tue Nov 25 18:15:28 2008] [notice] LDAP: Built with OpenLDAP LDAP SDK
[Tue Nov 25 18:15:28 2008] [notice] LDAP: SSL support unavailable
[Tue Nov 25 18:15:28 2008] [notice] mod_python: Creating 4 session mutexes based on 256 max processes and 0 max threads.
[Tue Nov 25 18:15:29 2008] [notice] Apache/2.0.52 (Red Hat) configured -- resuming normal operations

只是如上的重复,没有其他的信息。

虚拟主机的error[Tue Nov 25 21:58:05 2008] [error] [client 219.243.36.16] File does not exist: /var/www/html/xxxxx.xxxx.cn/favicon.ico
[client 202.160.179.113] PHP Notice:  Undefined variable:  username in /var/www/html/xxxxx.xxxx.cn/new_xxxxx/inc/common.php on line 2
[client 202.160.179.113] PHP Notice:  Undefined variable:  usr_flag in /var/www/html/xxxxx.xxxx.cn/new_xxxxx/inc/common.php on line 3
[client 202.160.179.113] PHP Notice:  Undefined variable:  usr_flag in /var/www/html/xxxxx.xxxx.cn/new_xxxxx/inc/common.php on line 16
[client 202.160.179.113] PHP Notice:  Undefined variable:  usr_flag in /var/www/html/xxxxx.xxxx.cn/new_xxxxx/inc/common.php on line 22
[client 202.160.179.113] PHP Notice:  Undefined variable:  usr_flag in /var/www/html/xxxxx.xxxx.cn/new_xxxxx/inc/common.php on line 28
[client 202.160.179.113] PHP Notice:  Undefined index:  rows in /var/www/html/xxxxx.xxxx.cn/new_xxxxx/inc/template.php on line 235
[client 202.160.179.113] PHP Notice:  Undefined variable:  msgs in /var/www/html/xxxxx.xxxx.cn/new_xxxxx/inc/mysql.php on line 73
[Tue Nov 25 22:02:02 2008] [error] [client 202.106.90.2] File does not exist: /var/www/html/xxxxx.xxxx.cn/favicon.ico
[client 60.213.84.224] script '/var/www/html/xxxxx.xxxx.cn/new_xxxxx/admin_behind/insertreply.php' not found or unable to stat
[Tue Nov 25 22:07:10 2008] [error] [client 61.240.219.190] File does not exist: /var/www/html/xxxxx.xxxx.cn/favicon.ico
[client 72.30.142.164] PHP Notice:  Undefined variable:  username in /var/www/html/xxxxx.xxxx.cn/new_xxxxx/inc/common.php on line 2
[client 72.30.142.164] PHP Notice:  Undefined variable:  usr_flag in /var/www/html/xxxxx.xxxx.cn/new_xxxxx/inc/common.php on line 3
[client 72.30.142.164] PHP Notice:  Undefined variable:  usr_flag in /var/www/html/xxxxx.xxxx.cn/new_xxxxx/inc/common.php on line 16
[client 72.30.142.164] PHP Notice:  Undefined variable:  usr_flag in /var/www/html/xxxxx.xxxx.cn/new_xxxxx/inc/common.php on line 22
[client 72.30.142.164] PHP Notice:  Undefined variable:  usr_flag in /var/www/html/xxxxx.xxxx.cn/new_xxxxx/inc/common.php on line 28
[client 72.30.142.164] PHP Notice:  Undefined variable:  msgs in /var/www/html/xxxxx.xxxx.cn/new_xxxxx/inc/mysql.php on line 73
[client 72.30.142.164] PHP Notice:  Undefined index:  rows in /var/www/html/xxxxx.xxxx.cn/new_xxxxx/inc/template.php on line 235
[client 58.246.231.106] script '/var/www/html/xxxxx.xxxx.cn/new_xxxxx/admin_behind/insertreply.php' not found or unable to stat
[client 58.246.231.106] script '/var/www/html/xxxxx.xxxx.cn/new_xxxxx/admin_behind/insertreply.php' not found or unable to stat
[Tue Nov 25 22:15:41 2008] [error] [client 72.30.142.164] File does not exist: /var/www/html/xxxxx.xxxx.cn/new_xxxxx/news/20081030_102558_411680.shtml
[client 202.160.178.121] PHP Notice:  Undefined variable:  username in /var/www/html/xxxxx.xxxx.cn/new_xxxxx/inc/common.php on line 2
[client 202.160.178.121] PHP Notice:  Undefined variable:  usr_flag in /var/www/html/xxxxx.xxxx.cn/new_xxxxx/inc/common.php on line 3
[client 202.160.178.121] PHP Notice:  Undefined variable:  usr_flag in /var/www/html/xxxxx.xxxx.cn/new_xxxxx/inc/common.php on line 16
[client 202.160.178.121] PHP Notice:  Undefined variable:  usr_flag in /var/www/html/xxxxx.xxxx.cn/new_xxxxx/inc/common.php on line 22
[client 202.160.178.121] PHP Notice:  Undefined variable:  usr_flag in /var/www/html/xxxxx.xxxx.cn/new_xxxxx/inc/common.php on line 28
[client 202.160.178.121] PHP Notice:  Undefined variable:  total in /var/www/html/xxxxx.xxxx.cn/new_xxxxx/inc/count_click.php on line 47
[client 202.160.178.121] PHP Notice:  Undefined index:  rows in /var/www/html/xxxxx.xxxx.cn/new_xxxxx/inc/template.php on line 235
[client 59.38.217.207] script '/var/www/html/xxxxx.xxxx.cn/new_xxxxx/admin_behind/insertreply.php' not found or unable to stat
[Tue Nov 25 22:18:25 2008] [error] [client 222.136.72.243] File does not exist: /var/www/html/xxxxx.xxxx.cn/new_xxxxx/index.shtml, referer: http://www.xxxxx.xxxx.cn/new_xxxxx/index.shtml
[Tue Nov 25 22:18:55 2008] [error] [client 220.181.61.216] File does not exist: /var/www/html/xxxxx.xxxx.cn/robots.txt
[client 60.210.60.142] PHP Notice:  Undefined variable:  username in /var/www/html/xxxxx.xxxx.cn/new_xxxxx/inc/common.php on line 2, referer: http://www.baidu.com/s?lm=0& ... amp;uim=1&usm=0
[client 60.210.60.142] PHP Notice:  Undefined variable:  usr_flag in /var/www/html/xxxxx.xxxx.cn/new_xxxxx/inc/common.php on line 3, referer: http://www.baidu.com/s?lm=0& ... amp;uim=1&usm=0
[client 60.210.60.142] PHP Notice:  Undefined variable:  usr_flag in /var/www/html/xxxxx.xxxx.cn/new_xxxxx/inc/common.php on line 16, referer: http://www.baidu.com/s?lm=0& ... amp;uim=1&usm=0
[client 60.210.60.142] PHP Notice:  Undefined variable:  usr_flag in /var/www/html/xxxxx.xxxx.cn/new_xxxxx/inc/common.php on line 22, referer: http://www.baidu.com/s?lm=0& ... amp;uim=1&usm=0
[client 60.210.60.142] PHP Notice:  Undefined variable:  usr_flag in /var/www/html/xxxxx.xxxx.cn/new_xxxxx/inc/common.php on line 28, referer: http://www.baidu.com/s?lm=0& ... amp;uim=1&usm=0
[client 60.210.60.142] PHP Notice:  Undefined variable:  msgs in /var/www/html/xxxxx.xxxx.cn/new_xxxxx/inc/mysql.php on line 73, referer: http://www.baidu.com/s?lm=0& ... amp;uim=1&usm=0
[client 60.210.60.142] PHP Notice:  Undefined index:  rows in /var/www/html/xxxxx.xxxx.cn/new_xxxxx/inc/template.php on line 235, referer: http://www.baidu.com/s?lm=0& ... amp;uim=1&usm=0
[client 60.210.60.142] PHP Notice:  Undefined variable:  msgs in /var/www/html/xxxxx.xxxx.cn/new_xxxxx/inc/mysql.php on line 73, referer: http://www.baidu.com/s?lm=0& ... amp;uim=1&usm=0
[Tue Nov 25 22:26:44 2008] [error] [client 72.30.142.164] File does not exist: /var/www/html/xxxxx.xxxx.cn/robots.txt
[Tue Nov 25 22:31:05 2008] [error] [client 59.42.89.38] File does not exist: /var/www/html/xxxxx.xxxx.cn/favicon.ico
[client 59.38.217.207] script '/var/www/html/xxxxx.xxxx.cn/new_xxxxx/admin_behind/insertreply.php' not found or unable to stat
[Tue Nov 25 22:32:33 2008] [error] [client 59.42.89.38] File does not exist: /var/www/html/xxxxx.xxxx.cn/new_xxxxx/news/20081014_154825_889130.shtml
[Tue Nov 25 22:32:33 2008] [error] [client 59.42.89.38] File does not exist: /var/www/html/xxxxx.xxxx.cn/favicon.ico
[client 219.142.245.247] PHP Notice:  Undefined variable:  usr_flag in /var/www/html/xxxxx.xxxx.cn/new_xxxxx/inc/ifr_login_index_wynn.php on line 45, referer: http://www.xxxxx.xxxx.cn/new_xxxxx/index_wynn_div.shtml
[client 219.142.245.247] PHP Notice:  Undefined variable:  usr_flag in /var/www/html/xxxxx.xxxx.cn/new_xxxxx/inc/ifr_login_index_wynn.php on line 50, referer: http://www.xxxxx.xxxx.cn/new_xxxxx/index_wynn_div.shtml
[client 219.142.245.247] PHP Notice:  Undefined variable:  usr_flag in /var/www/html/xxxxx.xxxx.cn/new_xxxxx/inc/ifr_login_index_wynn.php on line 56, referer: http://www.xxxxx.xxxx.cn/new_xxxxx/index_wynn_div.shtml
[client 219.142.245.247] PHP Notice:  Undefined variable:  html in /var/www/html/xxxxx.xxxx.cn/new_xxxxx/inc/ifr_login_index_wynn.php on line 62, referer: http://www.xxxxx.xxxx.cn/new_xxxxx/index_wynn_div.shtml
[Tue Nov 25 22:33:03 2008] [error] [client 219.142.245.247] File does not exist: /var/www/html/xxxxx.xxxx.cn/favicon.ico
[Tue Nov 25 22:33:04 2008] [error] [client 219.142.245.247] File does not exist: /var/www/html/xxxxx.xxxx.cn/favicon.ico
[client 59.57.182.211] script '/var/www/html/xxxxx.xxxx.cn/new_xxxxx/admin_behind/insertreply.php' not found or unable to stat
[Tue Nov 25 22:35:07 2008] [error] [client 123.204.56.154] File does not exist: /var/www/html/xxxxx.xxxx.cn/new_xxxxx/favicon.ico
[Tue Nov 25 22:35:08 2008] [error] [client 123.204.56.154] File does not exist: /var/www/html/xxxxx.xxxx.cn/new_xxxxx/favicon.gif
[client 58.246.231.106] script '/var/www/html/xxxxx.xxxx.cn/new_xxxxx/admin_behind/insertreply.php' not found or unable to stat
[Tue Nov 25 22:39:11 2008] [error] [client 211.94.76.4] File does not exist: /var/www/html/xxxxx.xxxx.cn/favicon.ico
[Tue Nov 25 22:39:14 2008] [error] [client 211.94.76.4] File does not exist: /var/www/html/xxxxx.xxxx.cn/favicon.ico
[client 59.38.217.207] script '/var/www/html/xxxxx.xxxx.cn/new_xxxxx/admin_behind/insertreply.php' not found or unable to stat
[client 60.213.84.224] script '/var/www/html/xxxxx.xxxx.cn/new_xxxxx/admin_behind/insertreply.php' not found or unable to stat
[client 58.251.231.228] PHP Notice:  Undefined variable:  usr_flag in /var/www/html/xxxxx.xxxx.cn/new_xxxxx/inc/ifr_login_index_wynn.php on line 45, referer: http://www.xxxxx.xxxx.cn/new_xxxxx/index_wynn_div.shtml
[client 58.251.231.228] PHP Notice:  Undefined variable:  usr_flag in /var/www/html/xxxxx.xxxx.cn/new_xxxxx/inc/ifr_login_index_wynn.php on line 50, referer: http://www.xxxxx.xxxx.cn/new_xxxxx/index_wynn_div.shtml
[client 58.251.231.228] PHP Notice:  Undefined variable:  usr_flag in /var/www/html/xxxxx.xxxx.cn/new_xxxxx/inc/ifr_login_index_wynn.php on line 56, referer: http://www.xxxxx.xxxx.cn/new_xxxxx/index_wynn_div.shtml
[client 58.251.231.228] PHP Notice:  Undefined variable:  html in /var/www/html/xxxxx.xxxx.cn/new_xxxxx/inc/ifr_login_index_wynn.php on line 62, referer: http://www.xxxxx.xxxx.cn/new_xxxxx/index_wynn_div.shtml
[Tue Nov 25 22:48:38 2008] [error] [client 58.251.231.228] File does not exist: /var/www/html/xxxxx.xxxx.cn/favicon.ico
[Tue Nov 25 22:48:49 2008] [error] [client 58.251.231.228] File does not exist: /var/www/html/xxxxx.xxxx.cn/favicon.ico
[Tue Nov 25 22:49:53 2008] [error] [client 220.181.61.211] File does not exist: /var/www/html/xxxxx.xxxx.cn/robots.txt
[Tue Nov 25 22:50:27 2008] [error] [client 220.181.61.211] File does not exist: /var/www/html/xxxxx.xxxx.cn/article
[client 116.24.52.14] script '/var/www/html/xxxxx.xxxx.cn/new_xxxxx/admin_behind/insertreply.php' not found or unable to stat
[Tue Nov 25 22:53:13 2008] [error] [client 72.30.79.30] File does not exist: /var/www/html/xxxxx.xxxx.cn/robots.txt

俺对 php 也不是熟悉,看日志,Google了 一下,觉得php的代码应该是有问题。
请楼上的看看

论坛徽章:
0
4 [报告]
发表于 2008-11-26 12:17 |只看该作者
俺总以为是SSI 的问题,今天自己仔细在虚拟机上把那个网站的代码挂上去测试了一下,发现是网站代码写的时候一些不规范(我只获得了网站源代码,没有任何说明文档,对码代码有不熟悉),虚拟主机需要特别的一些配置,还要根据报错的日志,对一些目录和文件修改权限。真是晕啊。谢谢 liang3391 兄的回帖啊。

[ 本帖最后由 cnzg_y 于 2008-11-26 12:19 编辑 ]
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP