outroll / vesta

VESTA Control Panel
http://vestacp.com
GNU General Public License v3.0
2.93k stars 1.03k forks source link

Sugestion: Subdomain inside domain #1700

Open augcampos opened 6 years ago

augcampos commented 6 years ago

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)

muratcesmecioglu commented 6 years ago

This would be nice.

fossxplorer commented 6 years ago

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

tlcd96 commented 6 years ago

like this issue:

1679

augcampos commented 6 years ago

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:

with [X] show subDomains:

tlcd96 commented 6 years ago

@augcampos

Skamasle commented 6 years ago

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.

tlcd96 commented 6 years ago

@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

(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

(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

tlcd96 commented 6 years ago

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;
        }
    }
# [...]
}
tlcd96 commented 6 years ago

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.)

augcampos commented 6 years ago

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)

tlcd96 commented 6 years ago

@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) ;)