Welcome to Centmin Mod Community
Register Now

Sysadmin temporary URL

Discussion in 'System Administration' started by dorobo, Mar 17, 2017.

  1. dorobo

    dorobo Active Member

    Jun 6, 2014
    Local Time:
    1:30 AM
    As far as I know, in control panels like cPanel and Directadmin you are given temporary URLs while waiting for your domain to propagate and also for you to test your vhost directory if it loads without errors before you change nameservers.

    Is that easy to implement in centminmod?
  2. pamamolf

    pamamolf Premium Member Premium Member

    May 31, 2014
    Local Time:
    8:30 PM
    MariaDB 10.3.x
    You can do that by editing the hosts file like:

    newserveip  www.domaintotest.com
    Keep in mind that you must edit it as an Administrator.

    windows path:

    Now if you need something like cpanel offers (~username) then you must wait for eva2000 to reply :)
  3. eva2000

    eva2000 Administrator Staff Member

    May 24, 2014
    Brisbane, Australia
    Local Time:
    3:30 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    Isn't that feature in cpanel flagged as a potentially security issue ? Don't recall exactly myself. But probably not something you'd want to do.

    Better option is local host files edit like @pamamolf suggested

    To preview domain site, 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

    server {
      server_name newdomain.com www.newdomain.com;

    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
    centminmodserver-ip-address newdomain.com
    to disable preview comment it out and flush dns for your system
    #centminmodserver-ip-address newdomain.com
    Hostsman app to flush dns and edit the c:\Windows\System32\Drivers\etc\hosts file
  4. upgrade81

    upgrade81 Premium Member Premium Member

    Sep 5, 2016
    Local Time:
    7:30 PM
    Hello everyone, come back to this discussion because I have a similar problem.

    premise that I know well how to modify the host file and I can also use hostman.

    We are currently migrating some sites from an old server to the new one.
    Using the clone function of ManageWP - plugin, as you can see here from their guide:
    Migrate a website - ManageWP

    To migrate a site to a new server you need to provide the new IP, or a temporary url.

    The problem is that their script if we use the IP mode is to query the server on that example: and of course we find the courtesy page of personalized nginx Centminmod, and therefore can not find the files that their script copies to the FTP of the new created vhost.

    I spoke with their assistance and they suggested me to use the temporary url function, but I do not know how to implement it.

    Can someone help me?