AWS Documentation

  1. Home
  2. Docs
  3. AWS Documentation
  4. AWS Ubuntu 22 Apache, MySQL, PHP8.0(LAMP) and phpMyAdmin AMI

AWS Ubuntu 22 Apache, MySQL, PHP8.0(LAMP) and phpMyAdmin AMI

This AMI is a LAMP Web Server with phpMyAdmin installed on Ubuntu 22. This stack has the SSM agent and AWS CLI installed. For more details on how to use the SSM agent and AWS CLI, please refer to documentation below.

This AMI supports following versions.

  • PHP 8.0
  • Apache 2.4
  • MySQL 8.0
  • phpMyAdmin 5.2

Web Server

You can access to top page using http:// or https://. We installed certbot from snap packages, you can set up TLS/SSL certificates using Let’s Encrypt.

PHP module

If you are installing additional required PHP modules, install them with php version. For instance,

$ sudo apt install php8.0-mbstring

DB Server Password

You can find the password from EC2 management console System Log.

  1. Go to Amazon EC2 console at https://console.aws.amazon.com/ec2/.
  2. Chose your Instance and Click Actions → Instance Settings → Get System log

Get System log

You can also SSH into your instance and find the login credential using the following command.

$ cat /home/ubuntu/credentials 
////////////////////credentials info////////////////////
--- phpMyAdmin
----- Setting  : Success
--- MySQL
----- User     : root
----- Password : e1WFUFzvz1NaxiSo
////////////////////////////////////////////////////////

If you want to use a mysql user “debian-sys-maint”, please set up the password with the mysql root user.

mysql> ALTER USER 'debian-sys-maint'@'localhost' IDENTIFIED BY 'YOUR_PASSWORD';
mysql> flush privileges;

Additionally, this YouTube video shows how to troubleshoot password retrieval for MySQL.

phpMyAdmin

You can access to phpMyAdmin after creating ssh tunnel.

How to Set up SSH Tunneling (Port Forwarding)

ex.) create ssh tunnel

$ ssh ubuntu@{ipaddress} -i {ssh-key-file.pem} -N -L 8080:localhost:80

http://localhost:8080/phpMyAdmin

For phpMyAdmin please refer to phpMyAdmin User Guide

Reference

Tags ,
Was this article helpful to you? Yes No

How can we help?