AWS Mediawiki Web Server and phpMyAdmin on Amazon Linux 2
- Apache 2.4
- PHP 8.1
- MariaDB 10.5
- phpMyAdmin 5.2
- MediaWiki 1.39
Web Server
We prepared SSL/TLS so you can access to top page using http:// or https://.
MediaWiki Installation
Once the instance is running, please access your MediaWiki hosting domain or enter the public DNS provided by AWS (IPv4 Public IP) into your browser.
You will see the MediaWiki application. Click set up the wiki.

Step1. Language

Click set up the wiki.
Step2. Welcome to MediaWiki!

Click Continue.
Step3. Connect to database


You can find the database server password by accessing the System Log in the EC2 management console:
- Go to the Amazon EC2 console at https://console.aws.amazon.com/ec2/.
- Chose your Instance and Click on Actions → Monitor and troubleshoot → Get System Log.

Get System log as shown below.

You can also SSH into your instance and find the login credential using the following command.
$ cat /home/ec2-user/credentials
////////////////////credentials info////////////////////
--- MediaWiki
----- Setting : Success
--- phpMyAdmin
----- Setting : Success
--- MariaDB
----- User : root
----- Password : oa6scanavCf2szNk
----- User : mediawiki
----- DB name : mediawiki
----- Password : Ndmkd0qGkgqp1bgr
////////////////////////////////////////////////////////
- Database host: localhost
- Database name: mediawiki
- Database username: mediawiki
- Database password: *************
Click Continue.
Step4. Database settings

Click Continue.
Step5. Name


- Name of wiki:
- Your username:
- Password:
- Password again:
- Email address:
Check to go to more option -> check Ask me more questions
.


Check to install -> check I'm bored already, just install the wiki
.
We will install for now so choose I'm bored already, just install the wiki
.
Click Continue.
Step6. Install

Click Continue.

Click Continue.
Step7. Complete!

You will need to upload LocalSettings.php
to the the same directory as index.php using the following scp command.
❯ scp -i ~/path-to/ssh-key.pem ~/download-path/LocalSettings.php ec2-user@xxx.xxx.xxx.xxx:/var/www/html/mediawiki
LocalSettings.php 100% 4326 14.5KB/s 00:00
After that you can start using the website. Click to enter your wiki
on this page or access it at https://xxx.xxx.xxx.xxx/index.php
.

Change URL
If the IP Address is changed due to stop / start instance, you will not be able access to website with the new IP Address. You will need to change the MediaWiki URL $wgServer value in LocalSettings.php.
$ vim /var/www/html/mediawiki/LocalSettings.php
## The protocol and server name to use in fully-qualified URLs
$wgServer = "https://xxx.xxx.xxx.xxx";
You can access the site after the change
Options
phpMyAdmin
You can access phpMyAdmin after creating ssh tunnel. Please refer to AWS LAMP with PHP 8.1 on Amazon Linux 2