mediawiki file upload, 미디어위키 파일 업로드

미디어위키 파일 업로드 (mediawiki file upload)

[ Src: http://www.mediawiki.org/wiki/Upload ]


1. 폴더 보안 확인

미디어위키 폴더의 /images 폴더의 퍼미션을 "777"로 수정한다.
(*위의 페이지를 참조하면 "755"로 수정하라고 나오지만 그렇게하면 디렉토리를 만들지 못하고 에러를 발생시킨다.)

 $ cd 미디어위키폴더

 $ sudo chmod 755 ./images

  • 유저에게 읽기, 쓰기, 실행 권한 부여;
  • 그룹원에세 읽기, 실행 권한 부여;
  • 월드(-_-?)에게 읽기, 실행 권한 부여.

1. Check directory security
The upload directory needs to be configured so that it is not possible for an end user to upload and execute other scripts, which could then exploit access to your web directory and damage your wiki or web site.
Set the /images folder (or the /uploads folder in previous versions) to have permission "777":
(*written as 755 from the above link, but can find errors by not creating folders)
  • User can read, write and execute;
  • Group can read and execute;
  • World can read and execute.




2. 업로드 켜기/끄기 설정

미디어위키 1.5 또는 상위버전은 LocalSetting.php 의 $wgEnableUploads 항목을 enable 시켜야 한다. 아래와 같이 설정한다.
$wgEnableUploads = true; # Enable uploads


2. Setting uploads on/off

In MediaWiki version 1.5 and later, the attribute to be set resides in LocalSettings.php and $wgEnableUploads is set as follows:
$wgEnableUploads = true; # Enable uploads




3. 업로드 파일타입 설정

LocalSetting.php 파일의 $wgFileExtensions 항목은 업로드 가능한 파일타입을 적는 부분인데 아래와 같이 추가하면 된다.(세가지 방식 중 원하는 방식으로 하면 된다)

 $wgFileExtensions = array('png','gif','jpg','jpeg','doc','xls','mpp','pdf','ppt','tiff','bmp','docx', 'xlsx', 'pptx','ps','odt','ods','odp','odg');
or
 $wgFileExtensions = array_merge($wgFileExtensions, array('doc', 'xls', 'mpp', 'pdf','ppt','xlsx','jpg','tiff','odt','odg','ods','odp'));
or
 # Add new types to the existing list from DefaultSettings.php
 $wgFileExtensions[] = 'doc';
 $wgFileExtensions[] = 'xls';
 $wgFileExtensions[] = 'pdf';
 $wgFileExtensions[] = 'mpp';
 $wgFileExtensions[] = 'odt';
 $wgFileExtensions[] = 'ods';

3. Configuring file types

You can add $wgFileExtensions in LocalSettings.php to allow uploads of other desired file types. For example, you can change the $wgFileExtensions line to look something like
 $wgFileExtensions = array('png','gif','jpg','jpeg','doc','xls','mpp','pdf','ppt','tiff','bmp','docx', 'xlsx', 'pptx','ps','odt','ods','odp','odg');
or
 $wgFileExtensions = array_merge($wgFileExtensions, array('doc', 'xls', 'mpp', 'pdf','ppt','xlsx','jpg','tiff','odt','odg','ods','odp'));
or
 # Add new types to the existing list from DefaultSettings.php
 $wgFileExtensions[] = 'doc';
 $wgFileExtensions[] = 'xls';
 $wgFileExtensions[] = 'pdf';
 $wgFileExtensions[] = 'mpp';
 $wgFileExtensions[] = 'odt';
 $wgFileExtensions[] = 'ods';




4. 아파치서버 재실행 (restart apache server)

 $ sudo /etc/init.d/apache2 restart




5. 업로드 수행!( Do upload)


댓글 없음:

댓글 쓰기

안녕하세요 :)