"미디어위키 간편URL 적용"의 두 판 사이의 차이

(새 문서: ==미디어위키 폴더 이동== <source lang='dos'> [root@jmnote www]# ll ... 생략 drwxr-xr-x 16 root root 4096 Aug 16 17:58 mediawiki [root@jmnote www]# mv mediawiki w [root@j...)
 
1번째 줄: 1번째 줄:


==미디어위키 폴더 이동==
==미디어위키 폴더 이름 변경==
[[미디어위키 폴더]] 이름이 w가 아니었다면 w로 변경
<source lang='dos'>
<source lang='dos'>
[root@jmnote www]# ll
[root@jmnote www]# ll

2012년 8월 20일 (월) 21:19 판

1 미디어위키 폴더 이름 변경

미디어위키 폴더 이름이 w가 아니었다면 w로 변경

[root@jmnote www]# ll
... 생략
drwxr-xr-x 16 root root   4096 Aug 16 17:58 mediawiki
[root@jmnote www]# mv mediawiki w
[root@jmnote www]# ll
... 생략
drwxr-xr-x 16 root root   4096 Aug 16 17:58 w

2 LocalSettings.php 수정

수정 전
$wgScriptPath       = "/mediawiki";
$wgScriptExtension  = ".php";
수정 후
$wgScriptPath       = "/w";
$wgScript           = "$wgScriptPath/index.php";
$wgArticlePath      = "/wiki/$1";
$wgScriptExtension  = ".php";

3 httpd.conf 수정

httpd.conf 파일에 DocumentRoot 다음에 추가

# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/var/www"
#RedirectMatch /mediawiki/index.php/(.*)$ http://jmnote.com/wiki/$1
#RedirectMatch /mediawiki/index.php?(.*)$ http://jmnote.com/w/index.php?$1
Alias /w/index.php /web/jmnote/www/w/index.php
Alias /wiki /web/jmnote/www/w/index.php
Alias /index.php /web/jmnote/www/w/index.php
Alias /w/skins/ /web/jmnote/www/w/skins/
Alias /w/images/ /web/jmnote/www/w/images/
→ RedirectMatch는 기존 주소[1]를 새 주소[2]로 포워딩해주는 역할을 한다.
→ 새 사이트 구축시는 필요 없다.
→ 검색엔진에 등록된 기존 주소가 끊어지지 않도록 하기 하려면 주석 해제.

4 아파치 재시작

[root@jmnote www]# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]

5 참고 자료

  1. http;//도메인/mediawiki/index.php/표제어
  2. http;//도메인/wiki/표제어
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}