• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Question Automatically add temporary development domain

clmsvie

New Pleskian
Hello!

I am new to plex which came with my hosting. There I am able to create new customers, subscriptions, etc for my clients/customers.
We are developing websites - so I need to be able to access the webspace without changing the DNS of the final domain in the beginning.

Therefore I usually add a subdomain like customer.mydomain.com which works fine. Later I also add the final domain (customerdomain.com) and set it to the same directory (httpdocs/). Not sure if that's the best way. I found out about domain aliases and wondered if there is a better way to do it?

My final goal is to have a subdomain automatically added to the server for these purposes with a letsencrypt certificate.
My idea was to add the DNS record for *.dev.mydomain.com pointing to my server's IP. Then I created a wildcard letsencrypt certificate for dev.mydomain.com.
I hoped that when I create a new subscription with a domain of the pattern of anything.dev.mydomain.com that

a) the wildcard DNS record points to the correct subscription
b) the SSL certificate is valid.

... but it was not working.

My question now is how can I have a temporary development domain (with a valid SSL certificate) pointing to every subscription I create, without having to change DNS records every time?

Thanks in advance!
 
Aliases are not the correct solution, the subdomain approach is correct.

The wildcard subdomain *.dev.mydomain.com sounds good to me.

The wildcard SSL certificate is not the correct solution. While with the wildcard subdomain all requests that end on dev.mydomain.com will be routed to your server so that you will not need to apply changes to DNS for sub-sub-domains like website.dev.mydomain.com, for the SSL certificate I suggest to simply create a single domain certificate for each subdomain that you create. You need to create the subscription or subdomain in Plesk anyway, and it is only a few seconds of extra wait to let Plesk auto-install the SSL certificate for it.
 
Hi @clmsvie

My question now is how can I have a temporary development domain (with a valid SSL certificate) pointing to every subscription I create, without having to change DNS records every time?
You can try our new feature of creating websites with temporary domains by Plesk.

1. It can be enabled by adding the following lines in the panel.ini configuration file:

[techDomain]
subdomain.enabled = true


2. Then you will be able to choose a temporary domain name provided by Plesk during domain creation:
temp_dom1.png

3. Don't forget to secure the domain with an SSL certificate by Let's Encrypt (these domains forcing of using HSTS, we will do it automatically a bit later):
temp_dom2.png

4. Right after creation, the temporary domain is publicly available and secured with a valid SSL certificate:
Screenshot 2020-10-19 at 13.50.40.png

5. When you need to shift to a production domain name, you can just rename the temporary domain:
temp_dom3.png

Plesk will re-generate all required: web server configuration, DNS records, etc. to use the updated domain name.
 
Thanks for the answers.
Sounds good with the temporary domains, is there a way to change it to my own one though?
 
Hi, would be nice when I could change that "competent-burnel" for each temporary domain.

This is the auto-generated name and you will see a new one for every new domain. But all such names have a required prefix *.plesk.page that ensures that a domain will be publicly available on the web.
 
btw, why would you like to change the auto-generated temporary domain name to your own?
 
Aliases are not the correct solution, the subdomain approach is correct.

The wildcard subdomain *.dev.mydomain.com sounds good to me.

The wildcard SSL certificate is not the correct solution. While with the wildcard subdomain all requests that end on dev.mydomain.com will be routed to your server so that you will not need to apply changes to DNS for sub-sub-domains like website.dev.mydomain.com, for the SSL certificate I suggest to simply create a single domain certificate for each subdomain that you create. You need to create the subscription or subdomain in Plesk anyway, and it is only a few seconds of extra wait to let Plesk auto-install the SSL certificate for it.
I was able to reach the created subscription/server with the DNS wildcard.
The issue now is only the SSL certificate. Right now I need to add a TXT "_acme-challenge" for every subdomain in use in the DNS settings.
Is there a way to create the certificate without needing to add something to the DNS settings every time?
 
Back
Top