Vesta: Unable to add www alias (to letsencrypt domain?)

Created on 19 Feb 2018  Â·  11Comments  Â·  Source: serghey-rodin/vesta

Operating System (OS/VERSION):

Ubuntu 16.04 LTS

VestaCP Version:

Latest .19

Installed Software (what you got with the installer):

Apache / nginx config

Steps to Reproduce:

  • set up domain without the www. alias.
  • Add Letsencrypt SSL. All is working.
  • Try to add www alias, hit save,

    • Quit from domain edit and re-enter domain edit page, the alias has disappeared.

Related Issues/Forum Threads:

https://forum.vestacp.com/viewtopic.php?f=11&t=16219

Other info

  • Try removing SSL and LE, and saving the domain. Then you add the www alias to a plain http domain. Same result

  • Try with a different subdomain ... xxxx.domain.com. This ... succeeeds! So it seems to be prejudiced against www.

  • Try editing $VESTA/data/users/username/web.conf and edit it so that xxx becomes www. Then we rebuild web config. Alias, appears in the config, and also in the web interface. However, now we are unable to add LE SSL. It fails with "Error 2". No further information is available in /var/log/vesta/system.log

  • Tried running command line versions which appear in the system.log. Same result. At what point does the alias get passed to letsencrypt servers?

v-add-web-domain-alias 'user' 'domain.com' 'www.domain.com' 'no'
v-list-web-domain user domain.com | grep ALIAS
ALIAS: (blank)

bug confirmed

Most helpful comment

@klukiyan $VESTA is variable that's exists by default and directs to vesta's folder /usr/local/vesta. You can just simple replace it. /usr/local/vesta/data/users/{USERNAME_FOR_DOMAIN}/web.conf and {USERNAME_FOR_DOMAIN} must be replaced by username that own broken domain.

This files and folders are available for sudousers only. So before trying to get there or edit something, enter sudo su for admin or login as root, after you do you job, enter exit to prevent permission problems from root.

You can edit it whatever you like. vi PATH, nano PATH, or whatever you use. I preffer Midnight Commander and use mcedit PATH (this is require to install mc package`).

All 11 comments

Confirm issue.

OS: CentOS 7
Vesta CP version: 0.9.8 (x86_64) release 19
Installed Software: nginx + php-fpm

Also found that v-update-web-templates for problem domains is remove aliases as well. v-change-web-domain-name doesn't help at all.

Fixed it by:

  1. Edit $VESTA/func/main.sh as it done in pull request #1490
  2. Run v-update-web-templates
  3. I also got new error when trying to add alias Error: Web alias example.com exists. To fix this. I opened $VESTA/data/users/{USERNAME_FOR_DOMAIN}/web.conf and removed all found www.example.com domains in config.
  4. Add alias, all works fine.

UPD 22.05.2018

More stable and faster solution.

  1. Edit $VESTA/data/users/{USERNAME_FOR_DOMAIN}/web.conf and add www.domainname.com to ALIAS variable.
  2. v-update-web-templates {USERNAME_FOR_DOMAIN}.

@Niklan Hi Nikita,
Can you please explain me how do I get to $VESTA/data/users/{USERNAME_FOR_DOMAIN}/web.conf ?
I cannot find web.conf anywhere :(
Where is $VESTA? is the solution for pre-install or arlready on installed?
Thank you

@klukiyan $VESTA is variable that's exists by default and directs to vesta's folder /usr/local/vesta. You can just simple replace it. /usr/local/vesta/data/users/{USERNAME_FOR_DOMAIN}/web.conf and {USERNAME_FOR_DOMAIN} must be replaced by username that own broken domain.

This files and folders are available for sudousers only. So before trying to get there or edit something, enter sudo su for admin or login as root, after you do you job, enter exit to prevent permission problems from root.

You can edit it whatever you like. vi PATH, nano PATH, or whatever you use. I preffer Midnight Commander and use mcedit PATH (this is require to install mc package`).

changing web.conf only fixes support for http
https://www.domain.com gives error on certificate doesn't include www :(

@Niklan's solution also works for Ubuntu.

Confirm issue.

OS: CentOS 7
Vesta CP version: 0.9.8 (x86_64) release 19
Installed Software: nginx + php-fpm

Also found that v-update-web-templates for problem domains is remove aliases as well. v-change-web-domain-name doesn't help at all.

Fixed it by:

  1. Edit $VESTA/func/main.sh as it done in pull request #1490
  2. Run v-update-web-templates
  3. I also got new error when trying to add alias Error: Web alias example.com exists. To fix this. I opened $VESTA/data/users/{USERNAME_FOR_DOMAIN}/web.conf and removed all found www.example.com domains in config.
  4. Add alias, all works fine.

UPD 22.05.2018

More stable and faster solution.

  1. Edit $VESTA/data/users/{USERNAME_FOR_DOMAIN}/web.conf and add www.domainname.com to ALIAS variable.
  2. v-update-web-templates {USERNAME_FOR_DOMAIN}.

Bad fix, because after changing main.sh, new domains are created with two aliases www.domainname.com, www.domainname.com

any idea to fix this? I really need it badly for www...

I did it using ssh in mind conf somewhere.
Can't remember, but find it by googling

On Mon, Sep 21, 2020, 07:12 Benyamin Limanto notifications@github.com
wrote:

any idea to fix this? I really need it badly for www...

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/serghey-rodin/vesta/issues/1489#issuecomment-695902998,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AGTQZ62WLOGBTLSJGRII2P3SG3OEFANCNFSM4ERI3EHQ
.

https://github.com/serghey-rodin/vesta/commit/74fa6d5b0ce78cbb85ea657d16f8f2c3dba93c6c
In func.sh, around line 900, find
aliases=$(echo "$aliases" |grep -v www.$domain |sed -e "/^$/d")
and edit it to read
aliases=$(echo "$aliases" |sed -e "/^$/d")
Make a backup first!

74fa6d5
In func.sh, around line 900, find
aliases=$(echo "$aliases" |grep -v www.$domain |sed -e "/^$/d")
and edit it to read
aliases=$(echo "$aliases" |sed -e "/^$/d")
Make a backup first!

Is it working also on ubuntu? Also after that I only need to un check ssl->save web->check ssl->save web again right?

It shouldn't matter what distro you use it on, as its only using bash commands. Make a backup of the script. Try it. If it doesn't work, restore the backup.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Prince-M picture Prince-M  Â·  4Comments

SteenSchutt picture SteenSchutt  Â·  7Comments

TKaluza picture TKaluza  Â·  8Comments

cakama3a picture cakama3a  Â·  5Comments

progcode picture progcode  Â·  3Comments