Create the Apache/Nginx Virtualhost for Percona server

Hi

I recently installed the percona server in aws ec2 instance and I accessed via https://IP:443. But this not convenient to remember the IP address. For that I planned to configure the domain name to access the percona (https://pmm.example.com).

Does anyone know how to setup this in AWS ubuntu ec2 using apache or nginx.

Thanks.

You can either A) set up a route53 domain and create an A class record to point to the IP, or B) simply add the IP and domain name you want to use into your computer’s /etc/hosts file.

@matthewb

Thanks.

I followed the Step A, I created the A record in route53 and got the letsencrypt ssl certificates. After that I configured the apache vhosts but it’s not working… it shows wrong ssl certificate instead of letsencrypt.

There is no apache needed. You can install the SSL certs directly into PMM server. Check out our documentation for steps on how to do this.

@matthewb

Is it possible to share the documentation for that…!

@matthewb

I have tried like below but it’s not working… can you tell me what am I wrong here…

I have create the A record for the percona server point to my custom domain and also installed the certbot and create the ssl certificates for the domain.
then I moved the those ssl certificate to pmm server docker container followed by the above document…
my certificate is,

SSLCertificateFile /etc/letsencrypt/live/pmm.example.com/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/pmm.example.com/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/pmm.example.com/fullchain.pem

Command used to move those certificate to pmm container:

docker cp cert.pem pmm-server:/srv/nginx/cert.pem
docker cp privkey.pem pmm-server:/srv/nginx/privkey.pem
docker cp fullchain.pem pmm-server:/srv/nginx/fullchain.pem
docker exec -it pmm-server chown root.root /srv/nginx/*

Thanks