Manual:LocalSettings.php/ko

From MediaWiki.org
Jump to: navigation, search
미디어위키 파일: LocalSettings.php
위치: /
소스 코드: SVN에 없음(설치 중에 자동으로 생성됨)|HEAD

1.20.61.19.7

클래스: 없음


이 파일은 미디어위키 환경 설정을 담고 있습니다. 이 파일은 설치 시에 자동으로 생성되지만, DefaultSettings.php에 들어있는 기본 설정을 다른 값으로 변경하거나, 확장 기능을 설치할 때 이 파일을 수정할 필요가 있습니다.

이 파일은 PHP 파일이기 때문에, 이 파일을 편집하려면 기본적인 PHP 문법을 알고 있어야 합니다. 모든 환경 변수는 "$"로 시작하며, 각 문장은 ";"로 끝난다는 점을 참고해주세요. 또한, 변수에 들어가는 값이 truefalse인 경우가 대부분입니다.

LocalSettings.php 파일을 고치고 저장하면 변경 사항이 바로 적용되며, 서버를 재시작할 필요는 없습니다. 다만, 브라우저 캐시가 변경 사항을 제대로 표시하지 못할 경우가 있으니 캐시를 갱신해야 할 수 있습니다.

이 파일에서 설정하지 않은 환경 설정은 includes/DefaultSettings.php에 있는 값으로 설정됩니다. DefaultSettings.php는 직접 고치지 마세요. 기본 설정을 변경하려면, DefaultSettings.php의 해당 부분을 복사한 다음에 LocalSettings.php에 붙여넣은 다음 고쳐야 합니다. 이때 붙여넣는 위치가 'require_once( "includes/DefaultSettings.php" );'가 있는 줄보다 아래쪽에 가도록 붙여넣어 주세요.

확장 기능을 설치할 때에도 설정 파일의 수정이 필요합니다. 자세한 설명은 각 확장 기능의 설명 문서를 참고해주세요. 확장 기능의 목록은 Extension Matrix에서 볼 수 있습니다.

경고! 경고:
require_once( "includes/DefaultSettings.php" );보다 앞쪽에 확장 기능 설치 코드를 넣으면 안 됩니다. 확장 기능이 제대로 설치되지 않으며, 또한 위키에 접속하지 못할 수도 있습니다.

참고로, 기본적으로 생성되는 LocalSettings.php의 맨 마지막에는 ?>가 없습니다(PHP는 ?>가 없어도 정상적으로 동작합니다). ?> 다음에 코드를 붙여넣어 비정상적으로 동작하는 문제를 막기 위해서 의도적으로 해당 부분이 제거된 파일이 생성됩니다.

See the configuration settings index and the comments included in the settings files for help on what all the variables do. A short listing of the most important variables, as well as the most requested features, is listed below.

만약 미디어위키를 직접 설치해서 사용하는 것이 아니라 위키 서비스를 사용하고 있다면 LocalSettings.php 파일을 직접 수정할 방법이 없을 수 있습니다. 이 경우에는 서비스 제공자가 직접 수정하는 것을 막았을 수도 있으며, 이에 대해서는 각 제공자에게 문의해주세요.

Contents

기본 설정 [edit]

미디어위키 위치(include path) [edit]

$IP(include path) 변수는 미디어위키 설치 파일이 어디에 있는지를 담고 있습니다. 이 값은 절대 경로로 입력해야 하고, 마지막에 "/"를 붙이지 않습니다.

이 값은 DefaultSettings.php보다 먼저 설정되어야 하고, DefaultSettings.php에서는 이 값을 이용해 여러 파일을 읽어들입니다.

사이트 이름 [edit]

$wgSitename 변수는 사이트 이름을 담고 있습니다. 이 변수는 시스템 여러 곳에서 사용됩니다.

사이트 언어 [edit]

$wgLanguageCode 변수는 위키에서 사용할 기본 언어를 담고 있습니다. 가입한 사용자는 이 설정과 별도로 환경 설정에서 언어를 조정할 수 있지만, 설정하지 않았거나 로그인하지 않은 경우 이 변수가 적용됩니다.

Declination of site name [edit]

Some translations of interface are ready for inflection of site name. You can set proper forms of word in variables $wgGrammarForms.

스크립트 경로 [edit]

$wgScriptPath 변수는 는 미디어위키가 설치된 경로를 담고 있습니다.

서버 이름 [edit]

$wgServer 변수는 자동으로 할당되지만, 덮어 쓸 수 있습니다.

만약 www.example.com 이 인터넷에서 미디어위키에 접근 할 수 있는 경로라면, 다음과 같이 쓸 수 있습니다.

$wgServer = 'http://www.example.com';

기본 틀{{SERVER}}$wgServer 의 값과 일치합니다.

스크립트 이름 [edit]

$wgScript 은 메인 php 스크립트의 이름이다. 기본적으로는 index.php 라고 설정 되어 있다. 이 스크립트 이름을 바꾸는것을 추천하지 않는다. 그러나 당신이 굳이 바꿀려면 파일이름을 꼭 기억 하라.

Redirect script name [edit]

The $wgRedirectScript variable specifies the URL path to the redirect script which handles redirects in MediaWiki. This setting is similar to wgScript as you can configure the exact name of the script. As mentioned above, this is probably not a good idea unless you really know what you are doing.

Article path [edit]

$wgArticlePath is the path to use when accessing a page in MediaWiki. The path should contain the path to the main script (usually making use of $wgScript) and use the $1 placeholder for the article name.

If you are using Apache rewrite rules to create pretty and short URLs, you probably need to adjust $wgArticlePath to address the right path. Note that wgArticlePath is used to construct URLs from within MediaWiki. If you make a mistake here, internal links will show up incorrectly while you still may be able to access the main page by specifying the correct URL manually. See Manual:Short URL for more information on URL configuration.

Typical values are:

"$wgScript/$1" pass the article name with separator "/"
"$wgScript?title=$1" pass the article name as a parameter (old style)
"mypath/$1" custom path. Use Apache rewrite rules to convert "mypath" to the proper path accessing the main script

Stylesheet location [edit]

Use the $wgStylePath variable to set the URL path to the place where the stylesheets (CSS) for the MediaWiki installation are located. The $wgStyleDirectory variable should point the same place, but note that this is a local file system path for use in internal scripts accessing the file system.

Upload location [edit]

The upload directory is the place where files uploaded by the users are stored. The $wgUploadPath variable specifies the URL path, the $wgUploadDirectory points to the local file system path.

[edit]

The $wgLogo variable specifies which graphical logo is displayed in the top left corner of all mediawiki pages.

Add the following two lines to LocalSettings.php (below the "require" statements):

$wgStylePath   = "/wiki/skins/";  
$wgLogo        = "{$wgStylePath}/common/images/wiki.png";

This replaces the default logo in the /wiki/skins/common/images/ directory.

Another option is to direct the $wgStylePath variable to the Upload Directory to be able to exchange the logo by updating uploaded files.

$wgStylePath is usually YOUR_WIKI_FOLDER/wiki/skins.

  • Note that in the example given, the $wgLogo points to /wiki/skins/common/images/wiki.png with the first part being defined by $wgStylePath. Make sure you have both correct, or $wgLogo will not point to where you think it's pointing.

Contact info [edit]

The $wgEmergencyContact variable is the e-mail address of the user to contact when things happen. This e-mail address is used to send internal bug reports to. As an administrator, you want to include your e-mail address here.

The $wgPasswordSender variable is the e-mail address where e-mail gets sent from, when passwords are sent out to users who have forgotten their passwords. Choose an address people can reply to in case of trouble or confusion.

Database settings [edit]

MediaWiki needs access to the database (currently either MySQL or PostgreSQL) to store pages, modifications, user information, and a lot more things.

The $wgDBserver contains the hostname where the database is hosted on. In most cases this will be just "localhost" as the database is run on the same system, but for distributed installations, you need to fill in the fully qualified domain name of the computer running the database.

$wgDBname is the database name of the database to be used by MediaWiki. A single MySQL or PostgreSQL installation can store more than one database and you can even run many MediaWiki installations on a single server. Make sure you have stated the correct database name here and use different database names for different wiki installations on the same database server.

The $wgDBuser and $wgDBpassword variables contain the login name and password to be used by MediaWiki to access the database. Make sure the specified user has the proper access rights to be able to manipulate the wiki's table on the database server.

Security [edit]

Keep in mind that the LocalSettings.php permissions should not allow other users to view this file as it contains security-related data, including your database user password. chmod 700 or otherwise set the permissions to something that provides security from public access. Additionally, the database user only needs to have SELECT, INSERT, UPDATE and DELETE permissions for the database. See also AdminSettings.php which is a MySql user that has superuser database permissions to run the maintenance scripts.

User rights [edit]

The $wgGroupPermissions is an associative array, controlling permissions for creating and editing pages for your different user groups. In this array, custom permission levels can be created, and permission levels for the different user groups can be set. See Help:User rights for more information about the different permissions and user groups available.

Force capital links [edit]

By default, no page name can start with a lowercase Roman letter: in an attempt to do so the first letter is converted to uppercase; if a link target, included page, image or category is specified with a name starting with a lowercase letter, the actual target etc. is the page starting with the corresponding capital.

Alternatively page names can start with a lowercase letter, in addition to the possibilities of starting with a capital, a digit, etc. For that you must adjust the $wgCapitalLinks variable. Setting it to false allows lowercase characters, true chooses the default behaviour.

Enabling subpages [edit]

Subpages are enabled on a per-namespace basis using the $wgNamespacesWithSubpages variable. For example, to enable subpages in the main namespace:

$wgNamespacesWithSubpages[NS_MAIN] = 1;

Image uploads [edit]

Before users are allowed to upload files to the MediaWiki system, you have to enable that feature. Make sure the Upload Directory is properly configured and writeable by the Apache web server process. Then set the $wgEnableUploads variable to true to allow uploading in the web user interface.

i.e. Here's some example code from includes/DefaultSettings.php to put in LocalSettings.php.

$wgUploadPath       = "$wgScriptPath/uploads";      ## Wiki 1.5 defaults to /images, but allows more than just images
$wgUploadDirectory  = "$IP/uploads";                ## Wiki 1.5 defaults to /images, but allows more than just images

## To enable image uploads, make sure the above '$wgUploadPath' directory is writable by Apache User or group.
## ''(i.e.  chmod og+w uploads images)''  then the following should be true:
$wgEnableUploads       = true;
 
$wgUseImageResize      = true;
$wgUseImageMagick      = true;
$wgImageMagickConvertCommand = "/usr/bin/convert";
 
## If you want to use image uploads under safe mode, create the directories images/archive, images/thumb and
## images/temp, and make them all writable. Then uncomment this, if it's not already uncommented:
$wgHashedUploadDirectory = false;

If you want to be able to resize images on the fly to support thumbnails, MediaWiki needs a working ImageMagick installation. Set the $wgUseImageResize and $wgUseImageMagick variables to true once you have installed and tested ImageMagick on your system. Make sure the $wgImageMagickConvertCommand variable points to the proper location of the convert command of your installation and that the command is executable by the web server process.

Also, you may want to modify the list of accepted extensions, which is stored within the $wgFileExtensions array:

$wgFileExtensions = array('png','jpg','jpeg','ogg','doc','xls','ppt','mp3','sxc','pdf','nse');

In case you run into trouble with ImageMagick, and obtain the following error message:

Fatal error: mime_magic could not be initialized, magic file is not available in includes/MimeMagic.php on line 506

Try adding the following line to LocalSettings.php:

$wgMimeDetectorCommand = "file -bi";

See also: Manual:Configuring file uploads, Manual:Mime type detection, and Manual:Image Administration#Image thumbnailing

LaTeX inline equations [edit]

In order to render mathematical formulae in LaTeX, you need a working LaTeX installation on your system. Set the $wgUseTeX variable to true to enable that feature. Also make sure the $wgMathPath, $wgMathDirectory and $wgTmpDirectory are set properly, but you might want to go with the default values unless you have a very good reason to change it.

Interwiki support [edit]

InterWiki support is built into MediaWiki but you need to configure the prefix to be used for your internal links. This prefix is usually the same as $wgSitename, but in case you need to change that, you set the $wgLocalInterwiki variable to the preferred name.

Language of user interface [edit]

MediaWiki allows for a variety of localized user interfaces languages instead of the english default. If you want to run your wiki in a non-English language, set the $wgLanguageCode variable to the proper language code (e.g. "de" for German, "es" for Spanish, etc.)

You may use any of the languages found in the directory language. E.g., if you find MessagesEs.php, you can use "es" for Spanish. Do not use "Es" with a capital letter. Although it seems to work, not all texts are translated.

Note: After changing the language code, you will need to run a php script to make it work. With your command line tool, go to your wiki directory, open the "maintenance" folder, and type "php rebuildMessages.php --rebuild". Please note that on Windows, the PHP folder might not be included in the PATH environment variable.

Not all languages are supported. See here for a list of the localisation statistics of 1.22wmf4 (281e88a). See translatewiki.net for the statistics per released version.

Setting copyright for the site [edit]

  • $wgRightsPage is the page on the wiki that covers the copyrights that it falls under. Usually, this will be Project:Copyrights.
  • $wgRightsUrl is the page describing full details of your license. (For the GNU FDL, for example, this would be http://www.gnu.org/licenses/fdl.html.)
  • $wgRightsText is the text in the footer that follows "Content is available under". It will be linked to the page specified in $wgRightsPage.
  • $wgRightsIcon is the URL of the image placed at the left of the footer.
    Note: If $wgRightsPage is non-empty, the link in the copyright/license notice will link to that page on your site. If $wgRightsPage is empty then the copyright/license notice will link to $wgRightsUrl instead.
  • $wgEnableDublinCoreRdf and $wgEnableCreativeCommonsRdf to add RDF meta data to wiki pages. For more details about RDF metadata see RDF metadata.

To modify the copyright statements of the site, add something like this to LocalSettings.php:

$wgRightsPage = "YourWiki:Copyright"; 
$wgRightsText = "copyright YourWiki";

Afterwards, edit MediaWiki:Copyright to provide an appropriate message, using "$1" to indicate the position where the link to your copyright page will be.

Example: setting a Creative Commons license

To set a Creative Commons license do the following:

<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/2.5/">
<img alt="Creative Commons License" border="0" src="http://creativecommons.org/images/public/somerights20.png" />
</a>
This work is licensed under a
<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/2.5/">
Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License</a>.
  • For $wgRightsURL enter the href info from the first anchor:
$wgRightsUrl = "http://creativecommons.org/licenses/by-nc-sa/2.5/";
  • For $wgRightsText enter the text the second anchor links from (add the "a" to the Wiki variable for a more grammatically correct version)
$wgRightsText = "a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License";
  • For $wgRightsIcon enter the src info from the img link in the first anchor. You want to copy the badge to your own site instead of using the one from the Creative Commons site.
$wgRightsIcon = "http://creativecommons.org/images/public/somerights20.png";
  • For using RDF metadata about copyright add one or both of the following lines to your LocalSettings.php
$wgEnableCreativeCommonsRdf = true;
$wgEnableDublinCoreRdf = true;

Custom namespaces [edit]

By declaring the $wgExtraNamespaces array, and modifying the $wgNamespacesWithSubpages, and $wgNamespacesToBeSearchedDefault arrays, extra namespaces can be added to a MediaWiki installation; and by declaring the $wgNamespaceAliases array namespace aliases can be added. Take heed not to have any pages already titled in that namespace, for instance in you had a page called "Technical:Support" and you created the Technical: namespace, then that page would not only be lost, but you cannot remove it from Special:Allpages. To fix this delete the namespace, move "Technical:Support" to "Support" in mainspace, delete the redirect, reinsert the namespace, and move it back to "Technical:Support". See Custom namespaces for more information as to how to do so.

Skins [edit]

The default skin of the site can be modified via the $wgDefaultSkin variable.

See also [edit]

언어: English  • Deutsch • Ελληνικά • español • français • Bahasa Indonesia • 日本語 • 한국어 • русский