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 Web Server
  • Search

Default Web Sites

Questions regarding the Web Server
Apache + Nginx, Nginx + PHP5-FPM
Post Reply
  • Print view
Advanced search
9 posts • Page 1 of 1
Graham
Posts: 57
Joined: Wed Sep 25, 2013 6:32 pm

Default Web Sites
  • Quote

Post by Graham » Sun Nov 03, 2013 7:45 pm

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

KeiroD
Posts: 61
Joined: Fri Oct 11, 2013 8:35 pm

Re: Default Web Sites
  • Quote

Post by KeiroD » Mon Nov 04, 2013 5:08 am

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.
Why? cPanel doesn't restrict it to the subdomain only when you attempt logging into the control panel.
Top

Graham
Posts: 57
Joined: Wed Sep 25, 2013 6:32 pm

Re: Default Web Sites
  • Quote

Post by Graham » Mon Nov 04, 2013 7:06 am

KeiroD wrote:Why? cPanel doesn't restrict it to the subdomain only when you attempt logging into the control panel.
I think I sorted item 1 in the assigned domain setting for the IP address.

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

skid
VestaCP Team
Posts: 1476
Joined: Wed Apr 06, 2011 11:12 pm

Re: Default Web Sites
  • Quote

Post by skid » Mon Nov 04, 2013 9:40 am

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

Code: Select all

        if ($http_host != your-domaint.vestacp.com) {
            rewrite  (.*)  https://your-domain.vestacp.com$1;
        }
Then restart vesta

Code: Select all

service vesta restart
Top

Graham
Posts: 57
Joined: Wed Sep 25, 2013 6:32 pm

Re: Default Web Sites
  • Quote

Post by Graham » Mon Nov 04, 2013 10:16 am

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 condition

Code: Select all

        if ($http_host != your-domaint.vestacp.com) {
            rewrite  (.*)  https://your-domain.vestacp.com$1;
        }
Then restart vesta

Code: Select all

service vesta restart
Thanks skid.

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

skid
VestaCP Team
Posts: 1476
Joined: Wed Apr 06, 2011 11:12 pm

Re: Default Web Sites
  • Quote

Post by skid » Mon Nov 04, 2013 10:21 am

No problem with shared ip as well.
Top

KeiroD
Posts: 61
Joined: Fri Oct 11, 2013 8:35 pm

Re: Default Web Sites
  • Quote

Post by KeiroD » Mon Nov 04, 2013 12:35 pm

Graham wrote:
KeiroD wrote:Why? cPanel doesn't restrict it to the subdomain only when you attempt logging into the control panel.
I think I sorted item 1 in the assigned domain setting for the IP address.

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.
Ah, understandable.

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

Darkace
Posts: 15
Joined: Sun Mar 01, 2015 2:09 pm

Re: Default Web Sites
  • Quote

Post by Darkace » Sat Jun 20, 2015 10:47 am

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
Top

baijianpeng
Posts: 301
Joined: Tue Dec 22, 2015 2:06 pm

Re: Default Web Sites
  • Quote

Post by baijianpeng » Thu Feb 25, 2016 6:16 pm

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?
When I access my server with IP address, like:

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?
Top


Post Reply
  • Print view

9 posts • Page 1 of 1

Return to “Web Server”



  • 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