我正在尝试基于 Mediawiki 为我的公司建立知识库。
我已经在我自己的 VDS(debian、apache 2.2.16. php 5.3.3.7)上安装并配置了 Mediawiki 1.21.2 。我使用了 Sphinx 搜索引擎和 SphinxSearch Mediawiki 扩展。
但现在我尝试在生产虚拟服务器(CentOS、apache 2.2.15+nginx 1.0.15、php 5.3.3 和 Mediawiki 1.21.3)上做同样的事情,但在搜索时遇到了一些问题:
当我发出一个应该明确返回一些值的搜索请求时,nginx 显示502 Bad Gateway错误。如果没有要返回的信息,则会显示通常的 MediaWiki 消息。
在apache 日志中,我看到以下内容:
[Wed Dec 04 14:06:27 2013] [notice] child pid 12603 exit signal Segmentation fault (11)
在站点的错误日志中,只有一些关于 StrictStandart 的警告:
[Wed Dec 04 11:30:09 2013] [error] [client 127.0.0.1] PHP Strict Standards: Declaration of SphinxMWSearch::userHighlightPrefs() should be compatible with that of SearchEngine::userHighlightPrefs() in /var/www/vhosts/itkgwiki/extensions/SphinxSearch/SphinxMWSearch.php on line 15, referer: http://my-site/pagename
[Wed Dec 04 11:30:10 2013] [error] [client 127.0.0.1] PHP Strict Standards: Declaration of SphinxMWSearch::userHighlightPrefs() should be compatible with that of SearchEngine::userHighlightPrefs() in /var/www/vhosts/itkgwiki/extensions/SphinxSearch/SphinxMWSearch.php on line 329, referer: http://my-site/pagename
然后转到mediawiki 日志文件:
Start request GET /index.php?search=test&fulltext=%D0%9D%D0%B0%D0%B9%D1%82%D0%B8&title=%D0%A1%D0%BB%D1%83%D0%B6%D0%B5%D0%B1%D0%BD%D0%B0%D1%8F%3A%D0%9F%D0%BE%D0%B8%D1%81%D0%BA
HTTP HEADERS:
HOST: itkg-wiki-new
X-REAL-IP: 192.68.0.136
X-FORWARDED-FOR: 192.68.0.136
CONNECTION: close
ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
USER-AGENT: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.57 Safari/537.36
REFERER: http://itkg-wiki-new/w/%D0%97%D0%B0%D0%B3%D0%BB%D0%B0%D0%B2%D0%BD%D0%B0%D1%8F_%D1%81%D1%82%D1%80%D0%B0%D0%BD%D0%B8%D1%86%D0%B0
ACCEPT-ENCODING: gzip,deflate,sdch
ACCEPT-LANGUAGE: ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4
COOKIE: show-.7B.7B.7B2.7D.7D.7D=collapsed; show-MM=expanded; show-HR-PV=expanded; show-FM=expanded; show-PM=expanded; show-IM=expanded; show-PS=expanded; show-RE=expanded; show-ADV=expanded; show-HR_PB=expanded; show-AA=expanded; show-ZBSL=expanded; show-HRM=expanded; show-REP=expanded; show-FOT=expanded; show-PFR=expanded; show-TAB=expanded; show-KAD=expanded; show-FI=expanded; show-NAV=expanded; show-PP=expanded; show-SL=collapsed; show-SHR=collapsed; show-CO=collapsed; wikiEditor-0-booklet-characters-page=latin; wikiEditor-0-booklet-help-page=format; vector-nav-p-tb=true; jwplayer.volume=100; jwplayer.mute=false; show-FI=expanded; show-NAV=expanded; show-SL=expanded; itkgwikiUserID=2; itkgwikiUserName=Oleg; itkgwiki_session=55dd7644b240946c896c4db9c54f8e73; wikiEditor-0-toolbar-section=advanced
CACHES: EmptyBagOStuff[main] SqlBagOStuff[message] SqlBagOStuff[parser]
[cookie] session_set_cookie_params: "0", "/", "", "", "1"
LocalisationCache: using store LCStore_DB
Unstubbing $wgParser on call of $wgParser::setFunctionHook from SimpleSecurity::setup
Parser: using preprocessor: Preprocessor_DOM
Connecting to localhost itkgwiki...
Implicit transaction open enabled.
Profiler::instance called without $wgProfiler['class'] set, falling back to ProfilerStub for safety
Connected to localhost itkgwiki.
Connected to database 0 at localhost
Implicit transaction start.
Fully initialised
User: cache miss for user 2
User: loading options for user 2 from database.
User: logged in from session
User: loading options for user 2 from override cache.
Connecting to localhost itkgwiki...
Implicit transaction open enabled.
Connected to localhost itkgwiki.
Connected to database 0 at localhost
Implicit transactions are now disabled.
Connection Resource id #124 will be used for SqlBagOStuff
MessageCache::load: Loading ru... got from global cache
Unstubbing $wgLang on call of $wgLang::_unstub from ParserOptions::__construct
SphinxSearch query: test
Use of wfMsg was deprecated in MediaWiki 1.21. [Called from SphinxMWSearchResultSet::getInfo in /var/www/vhosts/itkgwiki/extensions/SphinxSearch/SphinxMWSearch.php at line 545]
Use of wfMsgReal was deprecated in MediaWiki 1.21. [Called from wfMsg in /var/www/vhosts/itkgwiki/includes/GlobalFunctions.php at line 1444]
Use of wfMsgGetKey was deprecated in MediaWiki 1.21. [Called from wfMsgReal in /var/www/vhosts/itkgwiki/includes/GlobalFunctions.php at line 1542]
[ContentHandler] Created handler for wikitext: WikitextContentHandler
让我们strace apache:
30093 15:33:08.748226 lstat("/var/www/vhosts/itkgwiki/includes/content/WikitextContentHandler.php", {st_mode=S_IFREG|0644, st_size=2516, ...}) = 0
30093 15:33:08.748280 lstat("/var/www/vhosts/itkgwiki/includes/content", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
30093 15:33:08.748332 open("/var/www/vhosts/itkgwiki/includes/content/WikitextContentHandler.php", O_RDONLY) = 16 30093 15:33:08.748403 fstat(16, {st_mode=S_IFREG|0644, st_size=2516, ...}) = 0
30093 15:33:08.748469 fstat(16, {st_mode=S_IFREG|0644, st_size=2516, ...}) = 0
30093 15:33:08.748547 fstat(16, {st_mode=S_IFREG|0644, st_size=2516, ...}) = 0
30093 15:33:08.748607 mmap(NULL, 2516, PROT_READ, MAP_SHARED, 16, 0) = 0x7f4866fc4000
30093 15:33:08.748756 munmap(0x7f4866fc4000, 2516) = 0
30093 15:33:08.748800 close(16) = 0
30093 15:33:08.748851 lstat("/var/www/vhosts/itkgwiki/includes/content/TextContentHandler.php", {st_mode=S_IFREG|0644, st_size=3236, ...}) = 0
30093 15:33:08.748904 lstat("/var/www/vhosts/itkgwiki/includes/content", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
30093 15:33:08.748956 open("/var/www/vhosts/itkgwiki/includes/content/TextContentHandler.php", O_RDONLY) = 16 30093 15:33:08.749035 fstat(16, {st_mode=S_IFREG|0644, st_size=3236, ...}) = 0
30093 15:33:08.749101 fstat(16, {st_mode=S_IFREG|0644, st_size=3236, ...}) = 0
30093 15:33:08.749162 fstat(16, {st_mode=S_IFREG|0644, st_size=3236, ...}) = 0
0093 15:33:08.749223 mmap(NULL, 3236, PROT_READ, MAP_SHARED, 16, 0) = 0x7f4866fc4000
30093 15:33:08.749434 munmap(0x7f4866fc4000, 3236) = 0
30093 15:33:08.749492 close(16) = 0
30093 15:33:08.749606 lstat("/var/www/vhosts/itkgwiki/includes/content/WikitextContent.php", {st_mode=S_IFREG|0644, st_size=9098, ...}) = 0
30093 15:33:08.749661 lstat("/var/www/vhosts/itkgwiki/includes/content", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
30093 15:33:08.749713 open("/var/www/vhosts/itkgwiki/includes/content/WikitextContent.php", O_RDONLY) = 16
30093 15:33:08.749785 fstat(16, {st_mode=S_IFREG|0644, st_size=9098, ...}) = 0
30093 15:33:08.749850 fstat(16, {st_mode=S_IFREG|0644, st_size=9098, ...}) = 0
30093 15:33:08.749911 fstat(16, {st_mode=S_IFREG|0644, st_size=9098, ...}) = 0
30093 15:33:08.749972 mmap(NULL, 9098, PROT_READ, MAP_SHARED, 16, 0) = 0x7f4866fc2000
30093 15:33:08.750399 brk(0x7f486a134000) = 0x7f486a134000
30093 15:33:08.750546 munmap(0x7f4866fc2000, 9098) = 0
30093 15:33:08.750596 close(16) = 0
30093 15:33:08.750644 lstat("/var/www/vhosts/itkgwiki/includes/content/TextContent.php", {st_mode=S_IFREG|0644, st_size=8039, ...}) = 0
30093 15:33:08.750696 lstat("/var/www/vhosts/itkgwiki/includes/content", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
30093 15:33:08.750748 open("/var/www/vhosts/itkgwiki/includes/content/TextContent.php", O_RDONLY) = 16 30093 15:33:08.750818 fstat(16, {st_mode=S_IFREG|0644, st_size=8039, ...}) = 0
30093 15:33:08.750884 fstat(16, {st_mode=S_IFREG|0644, st_size=8039, ...}) = 0
30093 15:33:08.750945 fstat(16, {st_mode=S_IFREG|0644, st_size=8039, ...}) = 0
30093 15:33:08.751005 mmap(NULL, 8039, PROT_READ, MAP_SHARED, 16, 0) = 0x7f4866fc3000
30093 15:33:08.751380 munmap(0x7f4866fc3000, 8039) = 0
30093 15:33:08.751429 close(16) = 0
30093 15:33:08.751491 lstat("/var/www/vhosts/itkgwiki/includes/content/AbstractContent.php", {st_mode=S_IFREG|0644, st_size=10154, ...}) = 0
30093 15:33:08.751544 lstat("/var/www/vhosts/itkgwiki/includes/content", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
30093 15:33:08.751597 open("/var/www/vhosts/itkgwiki/includes/content/AbstractContent.php", O_RDONLY) = 16
30093 15:33:08.751640 fstat(16, {st_mode=S_IFREG|0644, st_size=10154, ...}) = 0
30093 15:33:08.751708 fstat(16, {st_mode=S_IFREG|0644, st_size=10154, ...}) = 0
30093 15:33:08.751769 fstat(16, {st_mode=S_IFREG|0644, st_size=10154, ...}) = 0
30093 15:33:08.751830 mmap(NULL, 10154, PROT_READ, MAP_SHARED, 16, 0) = 0x7f4866fc2000 30093 15:33:08.752214 munmap(0x7f4866fc2000, 10154) = 0
30093 15:33:08.752261 close(16) = 0
30093 15:33:08.752315 lstat("/var/www/vhosts/itkgwiki/includes/content/Content.php", {st_mode=S_IFREG|0644, st_size=16546, ...}) = 0
30093 15:33:08.752366 lstat("/var/www/vhosts/itkgwiki/includes/content", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
30093 15:33:08.752418 open("/var/www/vhosts/itkgwiki/includes/content/Content.php", O_RDONLY) = 16
30093 15:33:08.752462 fstat(16, {st_mode=S_IFREG|0644, st_size=16546, ...}) = 0
30093 15:33:08.752544 fstat(16, {st_mode=S_IFREG|0644, st_size=16546, ...}) = 0
30093 15:33:08.752611 fstat(16, {st_mode=S_IFREG|0644, st_size=16546, ...}) = 0
30093 15:33:08.752671 mmap(NULL, 16546, PROT_READ, MAP_SHARED, 16, 0) = 0x7f4866fc0000 30093 15:33:08.752945 munmap(0x7f4866fc0000, 16546) = 0
30093 15:33:08.752994 close(16) = 0
30093 15:33:08.753141 --- SIGSEGV (Segmentation fault) @ 0 (0) ---
30093 15:33:08.753259 chdir("/etc/httpd") = 0 30093 15:33:08.753303 rt_sigaction(SIGSEGV, {SIG_DFL, [], SA_RESTORER|SA_INTERRUPT, 0x7f486592f500}, {SIG_DFL, [], SA_RESTORER|SA_RESETHAND, 0x7f486592f500}, 8) = 0
30093 15:33:08.753359 kill(30093, SIGSEGV) = 0
30093 15:33:08.753395 rt_sigreturn(0x758d) = 0
30093 15:33:08.753431 --- SIGSEGV (Segmentation fault) @ 0 (0) ---
我的技能太差,无法从中做出决定,所以我很乐意提供任何建议。