Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section General Discussion
  • Search

Subdomain Working but with two error

General questions about VestaCP
Post Reply
  • Print view
Advanced search
13 posts
  • 1
  • 2
  • Next
netlantv
Posts: 8
Joined: Wed Jun 10, 2020 2:07 pm

Os: Debian 8x
Web: apache + nginx
Subdomain Working but with two error
  • Quote

Post by netlantv » Wed Jun 10, 2020 2:19 pm

Hello,
I see many people speak about to access with a subdomain.

I made a working solution :
- Register a new domain : panel.domain.com
- Modify the config file to have :

Code: Select all

location / {
        proxy_pass      https://XX.XX.XX.XX:8083;
    }
all is working but when a create or deleted a domain have an error :
- Created : Error: Web domain xxxxxxxxx.com exist
The domaine is well create but it return the error.
Image

- Deleted : ERR_CONNECTION_CLOSED
Image

I used MyVesta fork by dpeca
Config :
- Debian 10
- Ryzen 7 3800
- 4Gb Ram


Thanks for you help
Top

dpeca
VestaCP Team
Posts: 473
Joined: Wed Nov 25, 2015 7:30 pm

Re: Subdomain Working but with two error
  • Quote

Post by dpeca » Wed Jun 10, 2020 5:24 pm

You are doing something wrong since you are modifying nginx conf, which you never should do, because soon or later it will overwriten with template.

Please describe what you are trying to do.

Subdomain will works if you add it the same way you are adding main domain.
Top

netlantv
Posts: 8
Joined: Wed Jun 10, 2020 2:07 pm

Os: Debian 8x
Web: apache + nginx
Re: Subdomain Working but with two error
  • Quote

Post by netlantv » Wed Jun 10, 2020 7:16 pm

Yes, I understand,

I modified the file in /home/admin/conf/web

panel.domain.com.nginx.ssl.conf

Original:

Code: Select all

location/ {
        proxy_pass https://XX.XX.XX.XX:8443;
        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|tif|tiff|css|js|ttf|otf|webp|txt|csv|rtf|doc|docx|xls|xlsx|ppt|pptx|odf|odp|ods|odt|pdf|psd|ai|eot|eps|ps|zip|t$
            root /home/admin/web/valentindoche.com/public_html;
            access_log /var/log/apache2/domains/domain.com.log combined;
            access_log /var/log/apache2/domains/domain.com.bytes bytes;
            expires max;
            # try_files $uri @fallback;
        }
    }

Modified:

Code: Select all

location / {
        proxy_pass https://XX.XX.XX.XX:8083;
    }
The goal is to be able to access the panel when I do panel.domain.com.
Top

dpeca
VestaCP Team
Posts: 473
Joined: Wed Nov 25, 2015 7:30 pm

Re: Subdomain Working but with two error
  • Quote

Post by dpeca » Thu Jun 11, 2020 8:20 pm

create /usr/local/vesta/data/templates/web/nginx/vesta.stpl

Code: Select all

server {
    listen      %ip%:%proxy_ssl_port% http2;
    server_name %domain_idn% %alias_idn%;
    # ssl         on;
    ssl_certificate      %ssl_pem%;
    ssl_certificate_key  %ssl_key%;
    error_log  /var/log/%web_system%/domains/%domain%.error.log error;
    access_log     /var/log/%web_system%/domains/%domain%.log combined;

    location / {
        proxy_pass      https://%ip%:8083;
    }

    location /webmail {
        disable_symlinks off;
        proxy_pass      https://%ip%:%web_ssl_port%;
        location ~* ^.+\.(%proxy_extentions%)$ {
            root           /var/lib/roundcube;
            access_log     /var/log/%web_system%/domains/%domain%.log combined;
            access_log     /var/log/%web_system%/domains/%domain%.bytes bytes;
            expires        max;
            # try_files      $uri @fallback;
        }
    }

    location /phpmyadmin {
        disable_symlinks off;
        proxy_pass      https://%ip%:%web_ssl_port%;
        location ~* ^.+\.(%proxy_extentions%)$ {
            root           /usr/share;
            access_log     /var/log/%web_system%/domains/%domain%.log combined;
            access_log     /var/log/%web_system%/domains/%domain%.bytes bytes;
            expires        max;
            # try_files      $uri @fallback;
        }
    }

    location /phpmyadmin/ {
        proxy_pass      https://%ip%:%web_ssl_port%;
    }

    location ~ /\.ht    {return 404;}
    location ~ /\.svn/  {return 404;}
    location ~ /\.git/  {return 404;}
    location ~ /\.hg/   {return 404;}
    location ~ /\.bzr/  {return 404;}

    disable_symlinks if_not_owner from=%docroot%;

    include %home%/%user%/conf/web/snginx.%domain_idn%.conf*;
}

create /usr/local/vesta/data/templates/web/nginx/vesta.tpl

Code: Select all

server {
    listen      %ip%:%proxy_port%;
    server_name %domain_idn% %alias_idn%;
    location / {
        rewrite ^(.*) https://%domain_idn%$1 permanent;
    }
include %home%/%user%/conf/web/*nginx.%domain_idn%.conf_letsencrypt;
}
then assign vesta nginx template to your panel subdomain.
Top

netlantv
Posts: 8
Joined: Wed Jun 10, 2020 2:07 pm

Os: Debian 8x
Web: apache + nginx
Re: Subdomain Working but with two error
  • Quote

Post by netlantv » Fri Jun 12, 2020 12:44 pm

Hello,

I have always the same error :
  • When i create a domainWhen i create a domain :
    The panel say : Error: Web Domain domain.com exist
    In error log i have nothing and i access log i have :

    Code: Select all

    XX.XX.XX.XX - - [12/Jun/2020:14:31:11 +0200] "POST /add/web/ HTTP/2.0" 200 4013 "https://panel.domain.dev/add/web/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36"
    XX.XX.XX.XX - - [12/Jun/2020:14:31:11 +0200] "GET /js/i18n.js.php?1491697868 HTTP/2.0" 200 977 "https://panel.domain.dev/add/web/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36"
Top

dpeca
VestaCP Team
Posts: 473
Joined: Wed Nov 25, 2015 7:30 pm

Re: Subdomain Working but with two error
  • Quote

Post by dpeca » Fri Jun 12, 2020 12:54 pm

maybe you really have that domain already added?
Top

netlantv
Posts: 8
Joined: Wed Jun 10, 2020 2:07 pm

Os: Debian 8x
Web: apache + nginx
Re: Subdomain Working but with two error
  • Quote

Post by netlantv » Fri Jun 12, 2020 12:56 pm

I roll my head on the keyboard :
jhdfcgsdjdfhsgdfhjksdg
dshjdsdhsd
Top

dpeca
VestaCP Team
Posts: 473
Joined: Wed Nov 25, 2015 7:30 pm

Re: Subdomain Working but with two error
  • Quote

Post by dpeca » Fri Jun 12, 2020 1:20 pm

or maybe modifications that you made in nginx conf files makes some conflict?
try to rebuild configs:

Code: Select all

for user in $(grep '@' /etc/passwd |cut -f1 -d:); do
    if [ ! -f "/usr/local/vesta/data/users/$user/user.conf" ]; then
        continue;
    fi
    v-rebuild-web-domains $user 'no'
done
service nginx restart
service apache2 restart
Top

dpeca
VestaCP Team
Posts: 473
Joined: Wed Nov 25, 2015 7:30 pm

Re: Subdomain Working but with two error
  • Quote

Post by dpeca » Fri Jun 12, 2020 1:30 pm

or maybe panel.domain.com is added as alias?
Top

netlantv
Posts: 8
Joined: Wed Jun 10, 2020 2:07 pm

Os: Debian 8x
Web: apache + nginx
Re: Subdomain Working but with two error
  • Quote

Post by netlantv » Fri Jun 12, 2020 1:42 pm

Code: Select all

-bash: v-rebuild-web-domains: command not found
Top


Post Reply
  • Print view

13 posts
  • 1
  • 2
  • Next

Return to “General Discussion”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password