We are happy to announce that Vesta is back under active development as of 25 February 2024. We are working on Vesta 2.0 and expect to release it by the end of 2024. Read more about it: https://vestacp.com/docs/vesta-2-development
Multiple domains on account without DNS support
Multiple domains on account without DNS support
To reproduce consider the following setup:
Why is this happening? How can I debug this or how do I fix this?
- Install VestaCP without DNS support
- Create the initial first low level user, so besides your admin user what comes with the installation add an new user let's call the user example.
- Add a website for the example user for this example, example.com would be well suited.
- Create a second user e.g. foobar and add two websites e.g. foo.bar.com and bar.com.
- Next up register a Cloudflare account and change the nameservers of the domains used for the websites created in VestaCP.
- Create A-records pointing to the IP of the VestaCP server. Resulting in the following DNS according to the illustrative domains used in previous steps where SERV_IP is the IP of the VestaCP server:
Code: Select all
A example.com -> SERV_IP A bar.com -> SERV_IP A foo.bar.com -> SERV_IP
Why is this happening? How can I debug this or how do I fix this?
Re: Multiple domains on account without DNS support
Hi
I think this is not a DNS issue, this is just a apache or nginx vhost template
Can you check if foo.bar.com have apropiate vhost ?
Can you rebuild vhosts in user who owns foo.bar.com ? this will solve issue if vesta fails when create vhost.
So the problem cant be of DNS, is just a routhing issue in your webserver, by default if there isnt a vhost your domains will load main default domain
You cant test it, point any subdomain to your vesta ( from cloudflare and not add this to vesta ) whit will load example.com, same happen when you have issue with your vhost.
I think this is not a DNS issue, this is just a apache or nginx vhost template
Can you check if foo.bar.com have apropiate vhost ?
Can you rebuild vhosts in user who owns foo.bar.com ? this will solve issue if vesta fails when create vhost.
So the problem cant be of DNS, is just a routhing issue in your webserver, by default if there isnt a vhost your domains will load main default domain
You cant test it, point any subdomain to your vesta ( from cloudflare and not add this to vesta ) whit will load example.com, same happen when you have issue with your vhost.
Re: Multiple domains on account without DNS support
I actually did check the vhost in the /home/<user>/conf/web directory and it seemed to be there. However what I didn't realize is that it wasn't loaded, or at least not the SSL config. Yes I should've noted that I use a special nginx/php-fpm config what forces the use of the HTTPS protocol. The SSL config got not loaded because in the CP the domain has SSL support disabled so it won't append the *.nginx.ssl.conf (the SSL config) to the main vhost entry file at /etc/nginx/conf.d/vesta.conf
So stupid me... I could've known because my non-SSL config did work. It did do the redirect, however as soon as it got to the HTTPS protocol it loaded the main domain ssl config what seemed to work fine with the SSL cert etc.
Re: Multiple domains on account without DNS support
Unfortunately I now got stuck with a different issue, namely the domain foo.bar.com requires the same certificate as bar.com what is already installed. To not go off-topic here I started a new topic what is treating this issue.
Please have a look: viewtopic.php?f=10&t=18883
Please have a look: viewtopic.php?f=10&t=18883
Re: Multiple domains on account without DNS support
Of course if you have SSL in one site but not in second one and this second you try load with ssl it will load first ssl site found, because ALL SSL sites listen in same port, you need install SSL in all sites to prevent this
In any case your second cuestion, you can install same SSL in foo.com and bar.foo.com just install it in all sites ( if you have wildcard ssl por example, you can install it multiple times investacp, there is no problem for that)
In any case your second cuestion, you can install same SSL in foo.com and bar.foo.com just install it in all sites ( if you have wildcard ssl por example, you can install it multiple times investacp, there is no problem for that)