# Create the Apache/Nginx Virtualhost for Percona server

**URL:** <https://forums.percona.com/t/create-the-apache-nginx-virtualhost-for-percona-server/25690>\
**Category:** MySQL & MariaDB\
**Created:** [October 5, 2023, 4:31pm UTC](https://forums.percona.com/t/create-the-apache-nginx-virtualhost-for-percona-server/25690 "2023-10-05T16:31:01Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sanjeev18](https://avatars.discourse-cdn.com/v4/letter/s/cab0a1/32.png) [@Sanjeev18](https://forums.percona.com/u/Sanjeev18)\
**Post date:** [October 5, 2023, 4:31pm UTC](https://forums.percona.com/t/create-the-apache-nginx-virtualhost-for-percona-server/25690/1 "2023-10-05T16:31:01Z")

</div>

Hi

I recently installed the percona server in aws ec2 instance and I accessed via [https://IP:443](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](https://pmm.example.com)).

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

Thanks.

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [October 5, 2023, 4:48pm UTC](https://forums.percona.com/t/create-the-apache-nginx-virtualhost-for-percona-server/25690/2 "2023-10-05T16:48:41Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Sanjeev18](https://avatars.discourse-cdn.com/v4/letter/s/cab0a1/32.png) [@Sanjeev18](https://forums.percona.com/u/Sanjeev18)\
**Post date:** [October 5, 2023, 4:56pm UTC](https://forums.percona.com/t/create-the-apache-nginx-virtualhost-for-percona-server/25690/3 "2023-10-05T16:56:29Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [October 5, 2023, 7:15pm UTC](https://forums.percona.com/t/create-the-apache-nginx-virtualhost-for-percona-server/25690/4 "2023-10-05T19:15:20Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Sanjeev18](https://avatars.discourse-cdn.com/v4/letter/s/cab0a1/32.png) [@Sanjeev18](https://forums.percona.com/u/Sanjeev18)\
**Post date:** [October 6, 2023, 4:36am UTC](https://forums.percona.com/t/create-the-apache-nginx-virtualhost-for-percona-server/25690/5 "2023-10-06T04:36:51Z")

</div>

@matthewb

Is it possible to share the documentation for that…!

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [October 6, 2023, 3:28pm UTC](https://forums.percona.com/t/create-the-apache-nginx-virtualhost-for-percona-server/25690/6 "2023-10-06T15:28:11Z")

</div>

> **[Percona Monitoring and Management - Secure](https://docs.percona.com/percona-monitoring-and-management/how-to/secure.html)**
>
> By Default, PMM ships with a self-signed certificate to enable usage out of the box. While this does enable users to have encrypted connections between clients (database clients and web/API clients) and the PMM server, it shouldn’t be considered a...

---

<div class="post-metadata">

**Author:** ![Sanjeev18](https://avatars.discourse-cdn.com/v4/letter/s/cab0a1/32.png) [@Sanjeev18](https://forums.percona.com/u/Sanjeev18)\
**Post date:** [October 9, 2023, 6:07pm UTC](https://forums.percona.com/t/create-the-apache-nginx-virtualhost-for-percona-server/25690/7 "2023-10-09T18:07:38Z")

</div>

@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,

```auto
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:

```auto
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
