Want to subscribe to topics you're interested in?
Become a Member

Install Centminmod and ngnix only in the local network?

Discussion in 'Install & Upgrades or Pre-Install Questions' started by the caretaker, Mar 13, 2017.

  1. the caretaker

    the caretaker New Member

    14
    3
    3
    Nov 11, 2015
    Ratings:
    +4
    Local Time:
    4:12 PM
    1.9.6
    MariaDB 10
    How to set centminmod so that it can test in the local network? Would like 2). Add Nginx vhostdomain which is also available in the network.
    So everything is local
     
  2. eva2000

    eva2000 Administrator Staff Member

    30,949
    6,917
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,415
    Local Time:
    4:12 PM
    Nginx 1.13.x
    MariaDB 5.5
    Just setup the domains you want via centmin.sh menu option 2 as outlined at Nginx Vhost & NSD DNS Setup - CentminMod.com LEMP Nginx web stack for CentOS They aren't live unless you edit your domain's DNS to point to centminmod server's IP address so will no interfere with your live domain operation.

    Then edit each domain's vhost file at /usr/local/nginx/conf/conf.d/newdomain.com.conf and /usr/local/nginx/conf/conf.d/newdomain.com.ssl.conf (if you set yes to ssl) and add to server_name listing additional domain names you want to test from i.e. test.newdomain.com.

    would change from

    Code:
    server {
      server_name newdomain.com www.newdomain.com;
    to

    Code:
    server {
      server_name newdomain.com www.newdomain.com test.newdomain.com;
    then only update DNS for test.newdomain.com to point to centminmod server's IP address. Then after testing is done and you want to switch live domain to centminmod copy, just update DNS for newdomain.comto point to centminmod server's IP address as well :)

    If you want to preview newdomain.com on new centminmod server without updating DNS, on Windows PC edit your windows HOSTS file at c:\Windows\System32\Drivers\etc\hosts (see guide at Modify your hosts file | Knowledge Center | Rackspace Hosting or install Hostman app HostsMan - abelhadigital.com which can manage the file too and allows easy dns flushing when you make changes to the hosts file.

    c:\Windows\System32\Drivers\etc\hosts contents to preview without DNS update
    Code:
    centminmodserver-ip-address newdomain.com
    to disable preview comment it out and flush dns for your system
    Code:
    #centminmodserver-ip-address newdomain.com
    Hostsman app to flush dns and edit the c:\Windows\System32\Drivers\etc\hosts file
     
    • Like Like x 1
  3. the caretaker

    the caretaker New Member

    14
    3
    3
    Nov 11, 2015
    Ratings:
    +4
    Local Time:
    4:12 PM
    1.9.6
    MariaDB 10
    So far this works on local computer where the server runs. Over network on the test.domain.com does not work
     
  4. eva2000

    eva2000 Administrator Staff Member

    30,949
    6,917
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,415
    Local Time:
    4:12 PM
    Nginx 1.13.x
    MariaDB 5.5
    each server over network needs same local hosts file edit too to bypass DNS