Allow my users to point their subdomains to my server with CNAME, without having to use add-on domain in cpanel - apache

So I have a service that allows my user to map their own subdomains to my server. For example
http://sub.userdomain.com will map to http://sub.mydomain.com
Now I know that the user must add a CNAME record that points to my subdomain, but using Apache & Cpanel, now I have to add an add-on domain for this connection to work.
Is there a workaround so that I don't have to set up this add-on domain for the connection to automatically connect? (Basically so that my user can point their CNAME to my subdomain and it then automagically works without me having to do manual input).
Hope that makes sense!

No, You need to add addon domain on your server so that cPanel will create entry in apache configuration to work that domain.

Related

How to change the name of a subdomain with an another name domain?

I want to change the name of my subdomain which is subdomain.olddomain.com (wordpress) to a name domain that I have bought on LWS, https://newdomain.com.
I would like to keep all website in the server which has the subdomain but call with https://newdomain.com.
It is possible ?
Thank you a lot for your help.
yeah it is possible,
you have to link your new domain to the server which have the subdomain from the domain provider
then change the apache conf where server name property become newdomain,
restart apache, wait a little bit for the modification on your domain provider to propagate and all is good

How to set up SSL for naked domain from Google Domains to Heroku?

I'm trying to use Heroku's Automatic Certificate Management to set up SSL for my site. My app is on heroku at myapp.herokuapp.com, and I currently have Subdomain Forwarding set up so that http://www.myapp.com properly shows my app.
What I want is to have my site hosted at https://myapp.com.
I ran heroku certs:auto:enable, but it shows:
=== Automatic Certificate Management is enabled on myapp
Domain Status
───────────────── ───────────
www.myapp.com Failing
Running heroku domains shows:
=== myapp Heroku Domain
myapp.herokuapp.com
=== myapp Custom Domains
Domain Name DNS Target
───────────────── ───────────────────────────────
www.myapp.com www.myapp.com.herokudns.com
Right now, in Google Domains, I have a Subdomain Forward from #.myapp.com to http://www.myapp.com. I also have a Custom Resource Record with the name www, type CNAME, and data myapp.herokuapp.com..
What do I need to change in my setup so that I can host my site at https://myapp.com?
Unfortunately, Google Domains does not support the ANAME or ALIAS record. You must use one of these for your apex domain. Here's the full list supported by Google Domains.
https://support.google.com/domains/answer/3290350
Heroku has a list of DNS providers that support the ALIAS or ANAME records here: https://devcenter.heroku.com/articles/custom-domains#add-a-custom-root-domain Personally, I use DNSimple and have had great success with them.
The CNAME target needs to be www.myapp.com.herokudns.com. In your question above you only have the apex record in your DNS in myapp.com.herokudns.com. If this is not the case can you share the domain so I can dig the record for more information?
I've had the same problem with Heroku and other PaaS providers over and over: depending who provides and manages the DNS for your domain you may or may not able to use a CNAME or ALIAS record on the naked domain. That's why we've created a simple service to solve this by applying a simple SSL redirection from the naked domain to the "www" under SSL, without changing your DNS management provider: NakedSSL will give you an IP and will create and host an SSL certificate for your naked domain (https://yourdomain.com), redirecting it to the HTTPS URL that you want (most likely "https://www.yourdomain.com").
Disclaimer: I'm obviously part of the team that created NakedSSL. I hope you don't take this as self-promotion (anyway we offer it for free for 1 domain, which totally fits the needs of 95% of developers/hobbyist out there), but as a way to deal with this annoying situation in an easy way.

Switching Cpanel site from using Domain to IP?

I am switching our site from one server to another, but need to test its all working without changing the domain, how can I change it so it accepts connections to the IP?
You have tagged Cpanel so if it is Cpanel/WHM,it includes facility of temp URL which generally goes like http://IPaddress/~cpanelusername
This should load the webcontents of your "publichtml" of Cpanel account.
Please specify the details of your controlpanel on both servers if you are not referring to Cpanel-WHM.
I think you are trying to check your site from new server without changing domain nameserver.
To check our domain from new server, You need to update your local PC host file ( C:\Windows\System32\drivers\etc\hosts ) with new IP and your domain so that you can test your domain from new server.

Point domain name to specific folder on server

I am currently working on a CMS type of site where users can create websites on my server.
I want to be able to create subdomains for the user's website for them to see the preview.
The next step would be for users to be able to point their domain name to my server, and when users go to the domain it would go to their own designated folder on my server.
How would I go about doing this automatically with php, I have been looking for solutions with no avail.
I currently have a Virtual Server with hostgator. Please advise, or point me in the right direction. Any solutions are welcome as well, I am pretty much stuck at this point.
Thank you very much.
EDIT
For example, if my domain is www.mydomain.com, when a user makes an account, the subdomain username.mydomain.com is created. Later down the line, if the user buys the domain name www.userdomain.com, I want to make it so that if www.userdomain.com is entered, it shows what is on www.mydomain.com/userdomain. The URL should still show www.userdomain.com
The answer is depends on which web server you are using ?(apache / nginx or any other)
You need to have separate directory for each sub domain you created
In your virtual host configuration you need to match the host name and get the subdomain as a parameter to set the root directory for your host name.
CNAME is also possible but if you can tell your web server there is a possibility for detailed answer.

Apache Multiple Subdomain DNS Handling

I am currently building an application that I will host and will have multi-tenants (SaaS) called over the web, I would like them to be able to have subdomain.theircompany.com be able to point to subdomain.mycompany.com (or if they wish, point a full TLD to a subdomain with me).
The way I have been expecting this to work is to simply have a wildcard 'ServerAlias *.mycompany.com' in my Apache config pointing to my application, which then extracts the host being called...They then redirect via a CNAME entry on their host.
My question is, would this approach allow external subdomains to be pointed to a CNAME URL instead of IP? As this runs on one account on my system, am I able to install an SSL for a single wildcard if that customers wants to be running on SSL?
Any other suggestions/approaches would be greatly appreciated!
Thanks
A CNAME will work for the purposes of naming, but not for the purposes of a wildcard SSL cert.
Specifically, example.theircompany.com can have a CNAME record with a value of example.yourcompany.com. This will mean that example.theircompany.com will transparently resolve to your site. In other words, a browser still sees example.theircompany.com, not example.yourcompany.com.
As such, the SSL cert must be for the theircompany.com domain, not the yourcompany.com domain.