We are happy to announce that Vesta is back under active development as of 25 February 2024. We are working on v1 candidate and expect to engage more with the community over the coming months. We are committed to open source, and we encourage contributors to help us build the future of Vesta.
Wildcard Sub-Domain and Additional Static Sub-Domain?
Wildcard Sub-Domain and Additional Static Sub-Domain?
In my current setup, I have a successful WordPress Multisite running with wildcard sub-domains. This is great in that when I add a new site in the WordPress network, it automatically works using the site sub-domain.
Example: *.gordon55m.com points all new WordPress sites to the correct spot.
I now wish to add a Drupal (Open Atrium) site on a sub-domain of that same base domain. Is this possible to do this while keeping the wildcard sub-domain?
Example: intranet.gordon55m.com would point to Open Atrium Drupal whereas *.gordon55m.com would correctly go to the corresponding WordPress site.
What I've Tried: I added the sub-domain under the Web in Vesta. I then added an A Record in the base domain DNS records to point to the server IP address. This didn't work as WordPress still grabbed the sub-domain.
Any suggestions?
Example: *.gordon55m.com points all new WordPress sites to the correct spot.
I now wish to add a Drupal (Open Atrium) site on a sub-domain of that same base domain. Is this possible to do this while keeping the wildcard sub-domain?
Example: intranet.gordon55m.com would point to Open Atrium Drupal whereas *.gordon55m.com would correctly go to the corresponding WordPress site.
What I've Tried: I added the sub-domain under the Web in Vesta. I then added an A Record in the base domain DNS records to point to the server IP address. This didn't work as WordPress still grabbed the sub-domain.
Any suggestions?
Re: Wildcard Sub-Domain and Additional Static Sub-Domain?
Hello Gordon55M,
As you create a domain with wildcard before a second domain without it. I think the config files was generated with the wildcard on the first position. So, the web server will read the begin of the config file and every request will match with the wildcard so, it will never read the other one.
I think is there two solutions to try :
- Edit the files in "/home/[username]/conf/web" manually to move the config part with wildcard on the end of the file and restart web servers but this edit can be lost if vesta update the config.
or
- Edit the vesta config file /usr/local/vesta/data/users/[username]/web.conf and move the line with the wildcard to the last position and regenerate the web configs file with the "v-rebuild-web-domains " vesta bin.
Regards,
As you create a domain with wildcard before a second domain without it. I think the config files was generated with the wildcard on the first position. So, the web server will read the begin of the config file and every request will match with the wildcard so, it will never read the other one.
I think is there two solutions to try :
- Edit the files in "/home/[username]/conf/web" manually to move the config part with wildcard on the end of the file and restart web servers but this edit can be lost if vesta update the config.
or
- Edit the vesta config file /usr/local/vesta/data/users/[username]/web.conf and move the line with the wildcard to the last position and regenerate the web configs file with the "v-rebuild-web-domains " vesta bin.
Regards,
Last edited by Kyon on Wed Aug 20, 2014 4:33 pm, edited 2 times in total.
Re: Wildcard Sub-Domain and Additional Static Sub-Domain?
Kyon, thanks for the quick reply and guidance! I edited the web.conf file as you suggested. At the risk of sounding dumb, how do I regenerate the configs file and execute the "v-rebuild-web-domains " vesta bin?
I tried following the documentation and ran:
But am unsure of how to regenerate the configs file. Can you help point me in the right direction? My searches didn't turn up anything.
Edit - Should I run?
I tried following the documentation and ran:
Code: Select all
for user in $(v-list-sys-users plain); do v-rebuild-web-domains $user; done
Edit - Should I run?
Code: Select all
for user in $(v-list-sys-users plain); do v-list-sys-config $user; done
Re: Wildcard Sub-Domain and Additional Static Sub-Domain?
"for user in $(v-list-sys-users plain); do v-rebuild-web-domains $user; done" seems to be the good one.
It doen't worked ? Did you restart nginx and apache ?
Regards,
It doen't worked ? Did you restart nginx and apache ?
Regards,
Re: Wildcard Sub-Domain and Additional Static Sub-Domain?
Kyon, after some fiddling, I got it to work...kind of...
I am now missing the domains under the Web tab in my user area. I've included the image below. Any idea on how to rebuild this domain area in Vesta?
I am now missing the domains under the Web tab in my user area. I've included the image below. Any idea on how to rebuild this domain area in Vesta?
Re: Wildcard Sub-Domain and Additional Static Sub-Domain?
What is the return of : v-list-web-domains [the concerned user]
I hope I don't give you bad advise :(.
I hope I don't give you bad advise :(.
Re: Wildcard Sub-Domain and Additional Static Sub-Domain?
Here is what it returns (I just redacted it):
Code: Select all
DOMAIN IP U_DISK U_BANDWIDTH TPL DATE
------ ------ ------ ------ ------ ------
subdomain1.url.com 107.XXX.XXX.X 92 0 default 2014-08-19
subdomain2.url.com 107.XXX.XXX.X 127 0 default 2014-08-19
url.com 107.XXX.XXX.X 199 637 default 2014-05-23
Re: Wildcard Sub-Domain and Additional Static Sub-Domain?
Woaa strange, I tried to move a line on my vesta conf like i advised and it don't reproduce this issue...
Did you do other edits ?
Did you get a correct result if you use "v-list-web-domains username json" ?
Did you do other edits ?
Did you get a correct result if you use "v-list-web-domains username json" ?
Re: Wildcard Sub-Domain and Additional Static Sub-Domain?
Error: USER username doesn't exist
Re: Wildcard Sub-Domain and Additional Static Sub-Domain?
Replace username by the concerned user