Apache2 : Wiki System : MediaWiki2025/03/03 |
|
Install the Wiki System, MediaWiki. |
|
| [1] | |
| [2] | |
| [3] | Install other required PHP modules. |
|
root@www:~#
apt -y install php-common php-gd php-intl php-mysql php-enchant
root@www:~#
vi /etc/php/8.2/fpm/pool.d/www.conf
;; add to last line
;; maybe you need to configure parameters below for your usage
php_value[max_execution_time] = 600
php_value[memory_limit] = 2G
php_value[post_max_size] = 2G
php_value[upload_max_filesize] = 2G
php_value[max_input_time] = 600
php_value[max_input_vars] = 2000
php_value[date.timezone] = Asia/Tokyo
systemctl reload php8.2-fpm |
| [4] | Create User and Database on MariaDB for MediaWiki. |
|
root@www:~# mysql Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 37 Server version: 10.11.6-MariaDB-0+deb12u1 Debian 12 Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> create database mediawiki; Query OK, 1 row affected (0.00 sec) MariaDB [(none)]> grant all privileges on mediawiki.* to mediawiki@'localhost' identified by 'password'; Query OK, 0 rows affected (0.00 sec) MariaDB [(none)]> exit Bye |
| [5] | Configure Apache2 for MediaWiki. |
|
root@www:~# wget https://releases.wikimedia.org/mediawiki/1.43/mediawiki-1.43.0.tar.gz root@www:~# tar zxvf mediawiki-1.43.0.tar.gz root@www:~# mv mediawiki-1.43.0 /var/www/mediawiki root@www:~# chown -R www-data:www-data /var/www/mediawiki
root@www:~#
vi /etc/apache2/conf-available/mediawiki.conf # create new
Timeout 600
ProxyTimeout 600
Alias /mediawiki "/var/www/mediawiki"
DirectoryIndex index.php index.html index.htm
<Directory "/var/www/mediawiki">
Options FollowSymLinks
AllowOverride All
Require all granted
<FilesMatch \.(php|phar)$>
SetHandler "proxy:unix:/var/run/php/php8.2-fpm.sock|fcgi://localhost/"
</FilesMatch>
</Directory>
<Directory "/var/www/mediawiki/images">
AllowOverride None
AddType text/plain .html .htm .shtml .phtml
Header always set X-Content-Type-Options "nosniff"
<FilesMatch \.(php|phar)$>
SetHandler None
</FilesMatch>
</Directory>
a2enmod headers Enabling module headers. To activate the new configuration, you need to run: systemctl restart apache2root@www:~# a2enconf mediawiki Enabling conf mediawiki. To activate the new configuration, you need to run: systemctl reload apache2root@www:~# systemctl reload apache2 |
| [6] | Access to the URL [https://(Server's Hostname or IP address)/mediawiki/mw-config/] with Web browser on any Client, then following screen is displayed. Click the [Continue] button. |
|
| [7] | Verify that the installation requirements are met and click the [Continue] button. |
|
| [8] | This is the database connection setting. Enter the database name, user name, and password you created, and click the [Continue] button. |
|
| [9] | Click the [Continue] button. |
|
| [10] | Set the Wiki name and administrator account. |
|
| [11] | This is an optional setting, so set it according to your preference. |
|
| [12] | Click the [Continue] button. |
|
| [13] | Click the [Continue] button. |
|
| [14] | This will display the setup completion screen. Finally, as instructed on the screen, download [LocalSettings.php] and upload it under the MediaWiki root directory ([/var/www/mediawiki] in this example). |
|
| [15] | This is the main screen of MediaWiki, where you can create a Wiki site, like WikiPedia. |
|
| Sponsored Link |
|
|