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

UCC & Setting Server Hostname

General questions about VestaCP
Post Reply
  • Print view
Advanced search
7 posts • Page 1 of 1
jhewit
Posts: 41
Joined: Mon Nov 18, 2013 9:32 pm

UCC & Setting Server Hostname
  • Quote

Post by jhewit » Tue Nov 19, 2013 1:53 am

How do we set a friendly server hostname? For example in WHM/Cpanel you can set it to any name you want to the primary domain so for us it would be servername.zinuxcorp.com , we want to set it to hansel.zinuxcorp.com so that our UCC will apply SSL security to the user login.

Any assistance on setting this would be greatly appreciated.
Last edited by jhewit on Tue Nov 19, 2013 3:36 pm, edited 1 time in total.
Top

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

Re: Server Hostname
  • Quote

Post by skid » Tue Nov 19, 2013 7:19 am

You can do this only by editing internal vesta configuration. Open /usr/local/vesta/nginx/conf/nginx.conf and right before ssl directives add following condition

Code: Select all

        if ($http_host != tst.vestacp.com) {
            rewrite  (.*)  https://tst.vestacp.com:8083$1;
        }
tst.vestacp.com should be replaced with relevant domain name. To apply changes restart internal vesta server

Code: Select all

service vesta restart
Top

jhewit
Posts: 41
Joined: Mon Nov 18, 2013 9:32 pm

Re: Server Hostname
  • Quote

Post by jhewit » Tue Nov 19, 2013 3:14 pm

After setting this I cannot access the server control panel at https://hansel.zinuxcorp.com:2083 and when I attempt to access the server using the direct IP address it attempts to load https://hansel.zinuxcorp.com:2083 . Do I need to set the hostname elsewhere? Thank you again for the amazing support.
Top

jhewit
Posts: 41
Joined: Mon Nov 18, 2013 9:32 pm

Re: Server Hostname
  • Quote

Post by jhewit » Tue Nov 19, 2013 3:34 pm

Also one other thing we applied the UCC to the primary domain, however the certificate is not applying to the mail server (mail.zinuxcorp.com) although it is covered under the SSL. Where do we replace the SSL certs for the mail server?
Top

Ocrion
Posts: 11
Joined: Tue Nov 12, 2013 6:31 pm

Re: Server Hostname
  • Quote

Post by Ocrion » Tue Nov 19, 2013 5:50 pm

jhewit wrote:After setting this I cannot access the server control panel at https://hansel.zinuxcorp.com:2083 and when I attempt to access the server using the direct IP address it attempts to load https://hansel.zinuxcorp.com:2083 . Do I need to set the hostname elsewhere? Thank you again for the amazing support.
It's using the port 8083. :)

So in your case it will be https://hansel.zinuxcorp.com:8083
Top

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

Re: UCC & Setting Server Hostname
  • Quote

Post by skid » Tue Nov 19, 2013 5:54 pm

Sorry http_host should also include the port. Here is right config for you

Code: Select all

        if ($http_host != hansel.zinuxcorp.com:8083) {
            rewrite  (.*)  hansel.zinuxcorp.com:8083$1;
        }
and Ocrion said default por is 8083 not the 2083

To fix seconf issue just add mail.zinuxcorp.com as alias to zinuxcorp.com and it will do the trick
Top

Tim Rowley
Posts: 14
Joined: Mon Apr 13, 2015 6:23 pm

Re: UCC & Setting Server Hostname
  • Quote

Post by Tim Rowley » Tue Apr 21, 2015 5:05 pm

I'm unclear now. Does that one statement get both http and https ?

Code: Select all

        if ($http_host != hansel.zinuxcorp.com:8083) {
            rewrite  (.*)  hansel.zinuxcorp.com:8083$1;
        }
Another unclear point for me is where exactly is
right before ssl directives
In nginx.conf there is a section
# SSL PCI Compliance
and then lower down in # Vhost there are directives for SSL, but all within the Vhost brackets.

Code: Select all

# Vhost
    server {
        listen          8083;
        server_name     _;
        root            /usr/local/vesta/web;
        charset         utf-8;

        ssl                  on;
        ssl_certificate      /usr/local/vesta/ssl/certificate.crt;
        ssl_certificate_key  /usr/local/vesta/ssl/certificate.key;
        ssl_session_cache    shared:SSL:10m;
        ssl_session_timeout  10m;

        error_page      404     /error/404/index.html;
        error_page      403     /error/index.html;
        error_page      500     /error/index.html;

        location / {
            expires max;
            index   index.php;
        }

Is this the complete change or are there more steps ?
Top


Post Reply
  • Print view

7 posts • Page 1 of 1

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
 

 

cron

Login  •  Register

I forgot my password