We are happy to announce that Vesta is back under active development as of 25 February 2024. We are working on v1 candidate and expect to engage more with the community over the coming months. We are committed to open source, and we encourage contributors to help us build the future of Vesta.
Default Web Sites
Default Web Sites
Two quick questions that somebody might be able to help with.
1) How do I specify which website is the default for a server?
E.g. how do I set which website appears if someone just browses to the IP address of the server?
2) I'd like to restrict access to the Vesta Control Panel to a specific domain rather than to all websites on the server.
E.g. at the moment I can append port 8083 to any https IP address or website hosted on a particular server and I'm presented with the Vesta login. I'd like to restrict that so it's only available through a specific subdomain.
1) How do I specify which website is the default for a server?
E.g. how do I set which website appears if someone just browses to the IP address of the server?
2) I'd like to restrict access to the Vesta Control Panel to a specific domain rather than to all websites on the server.
E.g. at the moment I can append port 8083 to any https IP address or website hosted on a particular server and I'm presented with the Vesta login. I'd like to restrict that so it's only available through a specific subdomain.
Re: Default Web Sites
Why? cPanel doesn't restrict it to the subdomain only when you attempt logging into the control panel.Graham wrote:Two quick questions that somebody might be able to help with.
1) How do I specify which website is the default for a server?
E.g. how do I set which website appears if someone just browses to the IP address of the server?
2) I'd like to restrict access to the Vesta Control Panel to a specific domain rather than to all websites on the server.
E.g. at the moment I can append port 8083 to any https IP address or website hosted on a particular server and I'm presented with the Vesta login. I'd like to restrict that so it's only available through a specific subdomain.
Re: Default Web Sites
I think I sorted item 1 in the assigned domain setting for the IP address.KeiroD wrote:Why? cPanel doesn't restrict it to the subdomain only when you attempt logging into the control panel.
Item 2 because I would limit to limit the number of ways into the control panel if possible. It's not a showstopper for me, more of a nice to have. The fact that I can ask this kind of question is one (of the many) reasons I quickly ruled out cpanel for my requirements.
Re: Default Web Sites
1) There is no direct way to manage default domain. Of course if ip address is assigned to a specific user then only his domain will be shown. From a technical perspective all is simple. Apache and nginx reads configuration line by line and the first domain is set domain as default. You can change the order without any harm by editing file /etc/httpd/conf.d/vesta.conf
2) If you are familiar with nginx configuration you can modify /usr/local/vesta/nginx/conf/nginx.conf which is used for internal vesta webserver. Under vhost confuguration and before ssl directives insert following condition
Then restart vesta
2) If you are familiar with nginx configuration you can modify /usr/local/vesta/nginx/conf/nginx.conf which is used for internal vesta webserver. Under vhost confuguration and before ssl directives insert following condition
Code: Select all
if ($http_host != your-domaint.vestacp.com) {
rewrite (.*) https://your-domain.vestacp.com$1;
}
Code: Select all
service vesta restart
Re: Default Web Sites
Thanks skid.skid wrote:1) There is no direct way to manage default domain. Of course if ip address is assigned to a specific user then only his domain will be shown. From a technical perspective all is simple. Apache and nginx reads configuration line by line and the first domain is set domain as default. You can change the order without any harm by editing file /etc/httpd/conf.d/vesta.conf
2) If you are familiar with nginx configuration you can modify /usr/local/vesta/nginx/conf/nginx.conf which is used for internal vesta webserver. Under vhost confuguration and before ssl directives insert following conditionThen restart vestaCode: Select all
if ($http_host != your-domaint.vestacp.com) { rewrite (.*) https://your-domain.vestacp.com$1; }
Code: Select all
service vesta restart
For number 1 I assigned a domain to the IP address but left the IP address itself as a shared IP. That appears to have changed the default website but left the other domains sharing that IP address untouched. Do you think that's likely to cause other problems (the box only has the one IP)?
I'll give your suggestions for my 2nd request a try later this morning.
Re: Default Web Sites
No problem with shared ip as well.
Re: Default Web Sites
Ah, understandable.Graham wrote:I think I sorted item 1 in the assigned domain setting for the IP address.KeiroD wrote:Why? cPanel doesn't restrict it to the subdomain only when you attempt logging into the control panel.
Item 2 because I would limit to limit the number of ways into the control panel if possible. It's not a showstopper for me, more of a nice to have. The fact that I can ask this kind of question is one (of the many) reasons I quickly ruled out cpanel for my requirements.
Skid: Thanks for the how-to, as well. I'll add this to my wiki... heh. I seem to be collecting the things you can do to VestaCP there.
There's a thought.. but I'll have to look into it later.
Re: Default Web Sites
hey i tried 2 but if i do that i only get to a site that is on my server.
panle.monaxe.nl
but normally i have to go tho the control panel if i put that domain name on my browser
can please someone help me
thanks in advance
panle.monaxe.nl
but normally i have to go tho the control panel if i put that domain name on my browser
can please someone help me
thanks in advance
-
- Posts: 301
- Joined: Tue Dec 22, 2015 2:06 pm
Re: Default Web Sites
When I access my server with IP address, like:Graham wrote:...
1) How do I specify which website is the default for a server?
E.g. how do I set which website appears if someone just browses to the IP address of the server?
http://122.114.108.184/
The webpage will be loaded from /var/www/html .
How can I change this? How can I use IP address to show web pages from one of those public_html folders in /home/username/web/domain.com/ folder?