Page 1 of 1

Default website for IP

Posted: Fri Mar 10, 2017 5:30 am
by rickyseptiawan
Hi There,

If I access my vesta external IP , it redirects me to the first created website ?
is there any way to set a default site / just 404 page / handle the redirection ?

I have been searching all the forum and couldnt get anything

Kind Regards,

Re: Default website for IP

Posted: Fri Mar 10, 2017 2:37 pm
by Syeef
The default site has to be the first VirtualHost.

So I do the following:

I add in file: /etc/httpd/conf.d/xxx.xxx.xxx.xxx.conf (your ip address)

Code: Select all

<VirtualHost xxx.xxx.xxx.xxx:8080>
  ServerName localhost
  DocumentRoot /home/admin/web/default.domain.com/public_html
</VirtualHost>
Then I add in file: /etc/nginx/conf.d/xxx.xxx.xxx.xxx.conf

Code: Select all

server {
    listen       xxx.xxx.xxx.xxx:80 default;
    server_name  _;
    #access_log  /var/log/nginx/xxx.xxx.xxx.xxx.log main;
    location / {
        proxy_pass  http://xxx.xxx.xxx.xxx:8080;
   }
}
Then i do server restart:

Code: Select all

service httpd restart
service nginx restart

Re: Default website for IP

Posted: Fri Mar 10, 2017 5:10 pm
by ScIT
syeef is right, this will work.

Another solution is to change the order in /etc/apache2/conf.d/vesta.conf, the first one in top will be displayed as default. So you can there just move your default-site from admin to top.

Re: Default website for IP

Posted: Tue Aug 14, 2018 9:53 am
by vazellin
I think this issue is big trouble and security issue. After several mounth of using VestaCP I found that all my new registered domains is not linked to default site. But the domains linked for firs site from VestaCP. As a result all this domains indexed by google and many people viewed pages with absurd content.
VestaCP needs to make right order by default in files /etc/apache2/conf.d/vesta.conf and /etc/nginx/conf.d/vesta.conf
I think many users don't know about this bug and still use VestaCP as if all is well.

Re: Default website for IP

Posted: Tue Aug 14, 2018 10:40 am
by ScIT
vazellin wrote:
Tue Aug 14, 2018 9:53 am
I think this issue is big trouble and security issue. After several mounth of using VestaCP I found that all my new registered domains is not linked to default site. But the domains linked for firs site from VestaCP. As a result all this domains indexed by google and many people viewed pages with absurd content.
VestaCP needs to make right order by default in files /etc/apache2/conf.d/vesta.conf and /etc/nginx/conf.d/vesta.conf
I think many users don't know about this bug and still use VestaCP as if all is well.
think this issue has nothing to do with security. Just had this once on one of my servers, then I changed the order in the config file and the issue was resolved.

Re: Default website for IP

Posted: Sun Aug 19, 2018 4:08 pm
by Galaxian
I agree with vazellin that this is a problem that should be addressed by VestaCP. The other panels I have used haven't done this by default. I have pages indexed by Google that shouldn't be indexed which are duplication because subdomains like ftp., etc, are appearing as the default account. This is an SEO no-no.

Can anyone explain what the code from the poster above does?