ICT:MW Installation procedure 1.43 LTS
Installation Procedure for newMW (MediaWiki 1.43 LTS)
This document describes the clean, reproducible installation workflow for deploying a new MediaWiki instance (newMW) on the existing 3‑VM infrastructure. It includes directory preparation, file extraction, permissions, and the preferred ownership model for VS Code access.
1. Preparation
All commands are executed on VM1 (Web Layer).
1.1 Create the target directory
mkdir /var/www/newMW
1.2 Move into the working directory
cd /var/www
2. Download MediaWiki
Download the latest LTS tarball (example: 1.43.8):
wget https://releases.wikimedia.org/mediawiki/1.43/mediawiki-1.43.8.tar.gz
3. Extract MediaWiki
Extract the archive. This creates a directory such as mediawiki-1.43.8/.
tar -xvzf mediawiki-1.43.8.tar.gz
4. Move Extracted Files into newMW
Move normal files:
mv mediawiki-1.43.8/* newMW/
Move hidden files (e.g. .htaccess):
mv mediawiki-1.43.8/.* newMW/ 2>/dev/null
Remove the now‑empty extraction directory:
rmdir mediawiki-1.43.8
Remove the tarball:
rm mediawiki-1.43.8.tar.gz
5. Ownership and Permissions
Use the preferred ownership model to allow editing via VS Code while keeping Apache fully functional.
5.1 Set owner and group
chown -R mngr:apache /var/www/newMW
5.2 Ensure group write permissions
chmod -R g+w /var/www/newMW
5.3 Apply clean directory/file permissions
Directories:
find /var/www/newMW -type d -exec chmod 775 {} \;
Files:
find /var/www/newMW -type f -exec chmod 664 {} \;
5.4 Enable group inheritance (setgid)
Ensures new files created inside inherit the apache group.
chmod g+s /var/www/newMW
6. Apache Virtual Host
Create a vhost on VM1:
<VirtualHost *:8080>
ServerName newwiki.example.com
DocumentRoot /var/www/newMW
<Directory /var/www/newMW>
AllowOverride All
Require all granted
</Directory>
ErrorLog /var/log/httpd/newwiki-error.log
CustomLog /var/log/httpd/newwiki-access.log combined
</VirtualHost>
Restart Apache:
systemctl restart httpd
7. nginx Reverse‑Proxy (VM3)
Add a server block:
server {
listen 80;
server_name newwiki.example.com;
location / {
proxy_pass http://VM1-IP:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
}
Reload nginx:
systemctl reload nginx
8. Run the MediaWiki Installer
Navigate to:
https://newwiki.example.com
Provide:
- Database:
newwiki - User:
newwikiuser - Password: (as created on VM2)
- Site name
- Admin account
Download LocalSettings.php and place it in:
/var/www/newMW/LocalSettings.php
9. Minimal Post‑Install Configuration
Add or verify:
$wgServer = "https://newwiki.example.com"; $wgScriptPath = ""; $wgArticlePath = "/wiki/$1"; $wgUsePathInfo = true;
Enable uploads (optional):
$wgEnableUploads = true;
Enable SyntaxHighlight:
wfLoadExtension( 'SyntaxHighlight_GeSHi' );
10. Verification Checklist
- Site loads correctly
/wiki/Main_Pageresolves- Editing works
- File uploads work (if enabled)
- No rewrite errors in Apache logs
- nginx proxies correctly
- MariaDB connections succeed
11. Summary
This procedure provides a clean, repeatable installation workflow for MediaWiki
1.43 LTS using the preferred ownership model (mngr:apache) and the
existing 3‑VM architecture. It ensures clarity, maintainability, and
successor‑friendly operation.