Vesta: Sugestion: Subdomain inside domain

Created on 7 Sep 2018  路  11Comments  路  Source: serghey-rodin/vesta

Operating System (OS/VERSION):

Ubuntu

VestaCP Version:

All

Installed Software (what you got with the installer):

php-fpm

Steps to Reproduce:

N.A

Related Issues/Forum Threads:

N.A

Other Notes:

The list only show top level domains.

1 - Add button to "show subdomain" in to top (near toggle-all)
2 - Show all subdomains inside the top level domain( in a tree)

All 11 comments

This would be nice.

Absolutely. It makes the domain management UI more intuitive IMHO.

like this issue:

1679

like this issue:

1679

Almoust :D

The list only show the domains as it show now but in the top has a new button "show subDomains"

with [ ] show subDomains:

  • domainAAAA.com
    {Domain info} (Subdomains: 2)
  • domainBBBB.com
    {Domain info}(Subdomains: 0)
  • domainCCCC.org
    {Domain info} (Subdomains: 0)

with [X] show subDomains:

  • domainAAAA.com
    {Domain info}

    • sub1 domainAAAA.com

      {Sub Domain info}

    • sub2.domainAAAA.com

      {Sub Domain info}

  • domainBBBB.com
    {Domain info}
  • domainCCCC.org
    {Domain info}

@augcampos

  • i've made that example thinking fast and making fast. not to be perfect XD
  • also, i dunno that, that will be "perfect", so... yeah...

    • with that said, i think that if we can bring the SQLite or MYSQL to the base platform (VESTA)... it could be better...

      E.g:

      (Zip file includes: vestacp.db, vestacp.sql - SQLite V3)

      vestacp.zip

I like vesta as it, manage all as a domain, but i understand people who whant manage subdomains as subdomains in orther option, but I think this changes are imposible to make in vesta, because vesta work in orther way.

@Skamasle there is were you are wrong,
You will need to modify a few things:
1st. $VESTA/data/users/%user%/web.conf:

WEB:

Now:

DOMAIN='vm02.gate.com' IP='192.168.1.201' IP6='' ALIAS='' TPL='hosting' SSL='yes' SSL_HOME='same' LETSENCRYPT='yes' FTP_USER='' FTP_MD5='' BACKEND='' PROXY='userConf' PROXY_EXT='jpeg,jpg,png,gif,bmp,ico,svg,tif,tiff,css,js,htm,html,ttf,otf,webp,woff,txt,csv,rtf,doc,docx,xls,xlsx,ppt,pptx,odf,odp,ods,odt,pdf,psd,ai,eot,eps,ps,zip,tar,tgz,gz,rar,bz2,7z,aac,m4a,mp3,mp4,ogg,wav,wma,3gp,avi,flv,m4v,mkv,mov,mpeg,mpg,wmv,exe,iso,dmg,swf' STATS='' STATS_USER='' STATS_CRYPT='' U_DISK='1' U_BANDWIDTH='0' SUSPENDED='no' TIME='15:28:22' DATE='2018-09-15'

New:

DOMAIN='vm02.gate.com' PARENT="" IP='192.168.1.201' IP6='' ALIAS='' TPL='hosting' SSL='yes' SSL_HOME='same' LETSENCRYPT='yes' FTP_USER='' FTP_MD5='' BACKEND='' PROXY='userConf' PROXY_EXT='jpeg,jpg,png,gif,bmp,ico,svg,tif,tiff,css,js,htm,html,ttf,otf,webp,woff,txt,csv,rtf,doc,docx,xls,xlsx,ppt,pptx,odf,odp,ods,odt,pdf,psd,ai,eot,eps,ps,zip,tar,tgz,gz,rar,bz2,7z,aac,m4a,mp3,mp4,ogg,wav,wma,3gp,avi,flv,m4v,mkv,mov,mpeg,mpg,wmv,exe,iso,dmg,swf' STATS='' STATS_USER='' STATS_CRYPT='' U_DISK='1' U_BANDWIDTH='0' SUSPENDED='no' TIME='15:28:22' DATE='2018-09-15'

Subdomain:

DOMAIN='git.vm02.gate.com' PARENT="vm02.gate.com" IP='192.168.1.201' IP6='' ALIAS='' TPL='hosting' SSL='yes' SSL_HOME='same' LETSENCRYPT='yes' FTP_USER='' FTP_MD5='' BACKEND='' PROXY='userConf' PROXY_EXT='jpeg,jpg,png,gif,bmp,ico,svg,tif,tiff,css,js,htm,html,ttf,otf,webp,woff,txt,csv,rtf,doc,docx,xls,xlsx,ppt,pptx,odf,odp,ods,odt,pdf,psd,ai,eot,eps,ps,zip,tar,tgz,gz,rar,bz2,7z,aac,m4a,mp3,mp4,ogg,wav,wma,3gp,avi,flv,m4v,mkv,mov,mpeg,mpg,wmv,exe,iso,dmg,swf' STATS='' STATS_USER='' STATS_CRYPT='' U_DISK='1' U_BANDWIDTH='0' SUSPENDED='no' TIME='15:28:22' DATE='2018-09-15'

SSL Cert Locations and config:

NOW

-rw-r----- 1 root root 1647 Set 15 15:32 ssl.vm02.gate.com.ca
-rw-r----- 1 root root 2504 Set 15 15:32 ssl.vm02.gate.com.crt
-rw-r----- 1 root root 3243 Set 15 15:32 ssl.vm02.gate.com.key
-rw-r----- 1 root root 4152 Set 15 15:32 ssl.vm02.gate.com.pem
[...]

New (WildCat only, when non wildcat, use same names as now)

-rw-r----- 1 root root 1647 Set 15 15:32 wildcat.vm02.gate.com.ca
-rw-r----- 1 root root 2504 Set 15 15:32 wildcat.vm02.gate.com.crt
-rw-r----- 1 root root 3243 Set 15 15:32 wildcat.vm02.gate.com.key
-rw-r----- 1 root root 4152 Set 15 15:32 wildcat.vm02.gate.com.pem
[...]

WEB Dirs

NOW: (NOT SUBDOMAINS)

/home/%USER%/web/

dr-xr-x--x  9 gate gate 4096 Dez  1  2017 gate.com

- cgi-bin  document_errors  logs  private  public_html  public_shtml  stats

dr-xr-x--x  9 gate gate 4096 Mar  6  2018 vm01.gate.com

- cgi-bin  document_errors  logs  private  public_html  public_shtml  stats

drwxr-x--x  9 gate gate 4096 Set 15 15:28 vm02.gate.com

- cgi-bin  document_errors  logs  private  public_html  public_shtml  stats

NEW: (SUBDOMAINS ONLY, KEEP OLD LAYOUT FOR DOMAINS)

/home/%USER%/web/
dr-xr-x--x 9 gate gate 4096 Dez 1 2017 gate.com

  • domains

    • gate.com (includes www.gate.com as alias)



      • cgi-bin public_html public_shtml private



    • vm01.gate.com



      • [...]



  • document_errors
  • logs

    • all (file)

    • gate.com

    • vm01.gate.com

  • private
  • stats

    • all (file)

    • gate.com

    • vm01.gate.com

(We have two sub sub domains, so we have to create the base dir of vm01, but the configs for vm01 are directing for the folder: web/gate.com/domains/vm01.gate.com/public_(s)html/)
dr-xr-x--x 9 gate gate 4096 Mar 6 2018 vm01.gate.com

  • domains

    • testing.vm01.gate.com



      • [...]



    • bitminer.vm01.gate.com



      • [...]



  • document_errors
  • logs

    • all (file)

    • testing.vm01.gate.com

    • bitminer.vm01.gate.com

  • private
  • stats

    • all (file)

    • testing.vm01.gate.com

    • bitminer.vm01.gate.com

(this is an normal domains, not included in the wildcat certificate and/or web tree)
(sometimes is needed for: E.g: security purposes)
drwxr-x--x 9 gate gate 4096 Set 15 15:28 vm02.gate.com

  • cgi-bin document_errors logs private public_html public_shtml stats

The configs are put exacly in the sabe dir, that part does not change, but what can change is the parts of:

nginx

E.g.:

Gate.com

server {
#    [...]
    location / { #[...]
            root           /home/gate/web/gate.com/domains/gate.com/public_html;
            access_log     /var/log/apache2/domains/gate.com.log combined;
            access_log     /var/log/apache2/domains/gate.com.bytes bytes;
        }
    }
# [...]
}

vm01.gate.com

server {
#    [...]
    location / { #[...]
            root           /home/gate/web/gate.com/domains/vm01.gate.com/public_html;
            access_log     /var/log/apache2/domains/vm01.gate.com.log combined;
            access_log     /var/log/apache2/domains/vm01.gate.com.bytes bytes;
        }
    }
# [...]
}

vm02.gate.com (not in subdomain system)

server {
#    [...]
    location / { #[...]
            root           /home/gate/web/vm02.gate.com/public_html;
            access_log     /var/log/apache2/domains/vm02.gate.com.log combined;
            access_log     /var/log/apache2/domains/vm02.gate.com.bytes bytes;
        }
    }
# [...]
}

with the examples above is explkicit what you can do, with apache2....
but for examplification sake...

Apache2

gate.com

<VirtualHost 192.168.1.201:8080>
    ServerName gate.com
# [...]
    DocumentRoot /home/gate/web/gate.com/domains/gate.com/public_html
# [...]
    <Directory /home/gate/web/gate.com/domains/gate.com/public_html>
        AllowOverride All
        Options +Includes -Indexes +ExecCGI
        php_admin_value open_basedir /home/gate/web/gate.com/domains/gate.com/public_html:/home/gate/tmp
        php_admin_value upload_tmp_dir /home/gate/tmp
        php_admin_value session.save_path /home/gate/tmp
    </Directory>
# [...]
</VirtualHost>

vm01.gate.com

<VirtualHost 192.168.1.201:8080>
    ServerName vm01.gate.com
# [...]
    DocumentRoot /home/gate/web/gate.com/domains/vm01.gate.com/public_html
# [...]
    <Directory /home/gate/web/gate.com/domains/vm01.gate.com/public_html>
        AllowOverride All
        Options +Includes -Indexes +ExecCGI
        php_admin_value open_basedir /home/gate/web/gate.com/domains/vm01.gate.com/public_html:/home/gate/tmp
        php_admin_value upload_tmp_dir /home/gate/tmp
        php_admin_value session.save_path /home/gate/tmp
    </Directory>
# [...]
</VirtualHost>

vm02.gate.com (NOT AN SUBDOMAIN)

<VirtualHost 192.168.1.201:8080>
    ServerName vm02.gate.com
# [...]
    DocumentRoot /home/gate/web/vm02.gate.com/public_html
# [...]
    <Directory /home/gate/web/vm02.gate.com/public_html>
        AllowOverride All
        Options +Includes -Indexes +ExecCGI
        php_admin_value open_basedir /home/gate/web/vm02.gate.com/public_html:/home/gate/tmp
        php_admin_value upload_tmp_dir /home/gate/tmp
        php_admin_value session.save_path /home/gate/tmp
    </Directory>
# [...]
</VirtualHost>

Ending:

as you see, there is not much to change, to allow it. the lets encrypt wildcat is being made.
(i'm creating also my version of it.)

in the future, we can have it working, with domains and subdomains.

Also in the future, we maybe can have an cert repository
(E.g. use the same cert but not in an wildcat way, E.g: use it for your main domain, and your vesta install panel.)

I like all as you described but we can only start from the domain list as then add 1 step each time :D

Obrigado(Thanks)

@augcampos yeah, but right now, with the file base configs and none database..., that's all i can provide to add improvements for this feature.
and i'm also PT.... :P
N茫o tens de qu锚 (you're welcome) ;)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

developer-av picture developer-av  路  7Comments

darkworks picture darkworks  路  8Comments

TKaluza picture TKaluza  路  8Comments

tlcd96 picture tlcd96  路  5Comments

SteenSchutt picture SteenSchutt  路  7Comments