라즈베리파이의 OS, Raspbian에서는 패키지를 제공하므로 매우 간단하다.
sudo apt-get install mediawiki
설치하면 apache2의 available configuration에 mediawiki라는 새로운 configuration(/etc/apache2/conf-available/mediawiki.conf)이 생긴다.
아래의 Alias를 풀어서 /mediawiki 로 접근해도 된다.
#Alias /mediawiki /var/lib/mediawiki
난 VirtualHost를 이용한다.
/etc/apache2/sites-available/wiki.dasomoli.org.conf
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
ServerName wiki.dasomoli.org
ServerAdmin dasomoli@gmail.com
DocumentRoot /var/lib/mediawiki
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/wiki_error.log
CustomLog ${APACHE_LOG_DIR}/wiki.access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
Include conf-available/serve-cgi-bin.conf
</VirtualHost>
이제 mediawiki configuration을 enable 하자
sudo a2enconf mediawiki
wiki.dasomoli.org site도 enable하자
sudo a2ensite wiki.dasomoli.org.conf
apache2도 reload하자
sudo service apache2 reload
이제 wiki.dasomoli.org에 접속해서 mediawiki 설치를 시작한다.
설치가 끝나면 LocalSettings.php 파일을 저장할 수 있는데, 이 파일을 /etc/mediawiki/LocalSettings.php 로 저장한다.
다시 wiki.dasomoli.org로 접속해보면. 설치된 위키를 볼 수 있다!