Page 1 of 1

UCC & Setting Server Hostname

Posted: Tue Nov 19, 2013 1:53 am
by jhewit
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.

Re: Server Hostname

Posted: Tue Nov 19, 2013 7:19 am
by skid
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

Re: Server Hostname

Posted: Tue Nov 19, 2013 3:14 pm
by jhewit
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.

Re: Server Hostname

Posted: Tue Nov 19, 2013 3:34 pm
by jhewit
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?

Re: Server Hostname

Posted: Tue Nov 19, 2013 5:50 pm
by Ocrion
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

Re: UCC & Setting Server Hostname

Posted: Tue Nov 19, 2013 5:54 pm
by skid
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

Re: UCC & Setting Server Hostname

Posted: Tue Apr 21, 2015 5:05 pm
by Tim Rowley
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 ?