Join the community today
Register Now

Domains maintenaince mode

Discussion in 'Install & Upgrades or Pre-Install Questions' started by EckyBrazzz, May 26, 2019.

  1. EckyBrazzz

    EckyBrazzz Active Member

    885
    186
    43
    Mar 28, 2018
    >>>>Click here<<<< i'm nearby......
    Ratings:
    +343
    Local Time:
    9:00 AM
    Latest
    Latest
    Thanks, I already tried to find it but did not sucseed.
    Code (Text):
    #find . -type f -exec grep "Centmin Mod Nginx Test Page" '{}' \; -print       
    grep: ./proc/sys/fs/binfmt_misc/register: Invalid argument
    grep: ./proc/sys/net/ipv4/route/flush: Permission denied
    grep: ./proc/sys/net/ipv6/conf/all/stable_secret: Input/output error
    grep: ./proc/sys/net/ipv6/conf/default/stable_secret: Input/output error
    grep: ./proc/sys/net/ipv6/conf/eth0/stable_secret: Input/output error
    grep: ./proc/sys/net/ipv6/conf/lo/stable_secret: Input/output error
    grep: ./proc/sys/net/ipv6/route/flush: Permission denied
    grep: ./proc/sys/vm/compact_memory: Permission denied
    ^Z
    [3]+  Stopped                 find . -type f -exec grep "Centmin Mod Nginx Test Page" '{}' \; -print
    #find . -type f- grep "Centmin Mod Nginx Test Page" '{}' \; -print     
    find: Arguments to -type should contain only one letter
    # find . -type f -print | xargs grep "Centmin Mod Nginx Test Page"
    grep: ./proc/sys/fs/binfmt_misc/register: Invalid argument
    grep: ./proc/sys/net/ipv4/route/flush: Permission denied
    grep: ./proc/sys/net/ipv6/conf/all/stable_secret: Input/output error
    grep: ./proc/sys/net/ipv6/conf/default/stable_secret: Input/output error
    grep: ./proc/sys/net/ipv6/conf/eth0/stable_secret: Input/output error
    grep: ./proc/sys/net/ipv6/conf/lo/stable_secret: Input/output error
    grep: ./proc/sys/net/ipv6/route/flush: Permission denied
    grep: ./proc/sys/vm/compact_memory: Permission denied
    

     
  2. eva2000

    eva2000 Administrator Staff Member

    46,238
    10,510
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,293
    Local Time:
    10:00 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    strange you must of edited or removed it or overwrote the contents in the file already ? or you running the command or running the command in wrong present working directory

    try narrowing the find target directory to /usr/local/nginx
    Code (Text):
    find /usr/local/nginx -type f -exec grep "Centmin Mod Nginx Test Page" '{}' \; -print


    Code (Text):
    find /usr/local/nginx -type f -exec grep "Centmin Mod Nginx Test Page" '{}' \; -print 
                    <h1><strong>Centmin Mod Nginx Test Page</strong></h1>
    /usr/local/nginx/html/index.html
    
     
  3. EckyBrazzz

    EckyBrazzz Active Member

    885
    186
    43
    Mar 28, 2018
    >>>>Click here<<<< i'm nearby......
    Ratings:
    +343
    Local Time:
    9:00 AM
    Latest
    Latest
    Because I didn't know where to look, yes,
     
  4. EckyBrazzz

    EckyBrazzz Active Member

    885
    186
    43
    Mar 28, 2018
    >>>>Click here<<<< i'm nearby......
    Ratings:
    +343
    Local Time:
    9:00 AM
    Latest
    Latest
    Perect, even added a tracking code so that I can see what countries have the prioritie to start!
    Project_CMM_7241.png
     
  5. EckyBrazzz

    EckyBrazzz Active Member

    885
    186
    43
    Mar 28, 2018
    >>>>Click here<<<< i'm nearby......
    Ratings:
    +343
    Local Time:
    9:00 AM
    Latest
    Latest
    :cry::cry::cry::cry: 100 domains now show another page when made a change @ cloudflare
    Project_CMM_7244.png
    A completely other site.....hosted on a com.br domain
    Project_CMM_7245.png
     
    Last edited: Jun 9, 2019
  6. eva2000

    eva2000 Administrator Staff Member

    46,238
    10,510
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,293
    Local Time:
    10:00 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    strange you can check their curl headers
    Code (Text):
    curl -I http://domain.com
    

    Code (Text):
    curl -I http://www.domain.com
    

    Code (Text):
    curl -I https://domain.com
    

    Code (Text):
    curl -I https://www.domain.com
    

    did you create domains via centmin.sh menu option 2, 22 etc or just not setting it and pointing DNS only to centmin mod server ? if so make sure IP is correct and not mistyped
     
  7. EckyBrazzz

    EckyBrazzz Active Member

    885
    186
    43
    Mar 28, 2018
    >>>>Click here<<<< i'm nearby......
    Ratings:
    +343
    Local Time:
    9:00 AM
    Latest
    Latest
    Well, disabling Cloudflare resolved it. I only created the DNS but had also the Proxy on. So disabling the proxy resolved the issue.

    Now, for example, the domain ir.domain.com for Ireland gives the index.html (converted maintenance page with a tracker) again. And au.domain.com for Australia. Only I can't use https. But I placed all links from the countie sites on serval sites to get response, and that works.

    Project_CMM_7247.png

    So I still have the possibility to check the priority for the countries where we should start our new sites.

    With this way, I don't have to create domains with option 2 or 22 and still get my valuable info. Just created for 100+ countries a DNS a record with the IP pointing to the server.

    Only very strange that Cloudflare gives the content of other domain when I activate the Proxy. That domain was the domain where I installed the mamoto analytics.
     
    Last edited: Jun 9, 2019
  8. eva2000

    eva2000 Administrator Staff Member

    46,238
    10,510
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,293
    Local Time:
    10:00 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    is the geo country logic handled via nginx geo/geoip ? if so you need to setup proper Cloudflare real IP passthrough otherwise nginx won't see proper visitor geo location IP metadata when Cloudflare proxying is enabled

    If you use a reverse proxy like Cloudflare, Sucuri, or Incapsula in front of Centmin Mod Nginx, you need to setup nginx realip to be passed onto Nginx.

    See Getting Started Guide step 5 and setting correct real ip via nginx module config at http://centminmod.com/nginx_configure_cloudflare.html. The tools/csfcf.sh cronjob mentioned below helps maintain the whitelisted CSF Firewall IPs, but you still need to setup nginx realip in your nginx vhost.

    If using Centmin Mod 123.09beta01 and newer, there's an added tools/csfcf.sh script to aid in this. Details at:
     
  9. EckyBrazzz

    EckyBrazzz Active Member

    885
    186
    43
    Mar 28, 2018
    >>>>Click here<<<< i'm nearby......
    Ratings:
    +343
    Local Time:
    9:00 AM
    Latest
    Latest
    --with-http_realip_module was already installed.

    Next steps
     
  10. EckyBrazzz

    EckyBrazzz Active Member

    885
    186
    43
    Mar 28, 2018
    >>>>Click here<<<< i'm nearby......
    Ratings:
    +343
    Local Time:
    9:00 AM
    Latest
    Latest
    Guess this is my server IP?

    Still need to setup cron?
     
  11. EckyBrazzz

    EckyBrazzz Active Member

    885
    186
    43
    Mar 28, 2018
    >>>>Click here<<<< i'm nearby......
    Ratings:
    +343
    Local Time:
    9:00 AM
    Latest
    Latest
    realip was already installed.

    Guess this is my server ip?

    Setup the cron, but is this necessary after adding the above to the /etc/centminmod/custom_config.inc file?
     
  12. EckyBrazzz

    EckyBrazzz Active Member

    885
    186
    43
    Mar 28, 2018
    >>>>Click here<<<< i'm nearby......
    Ratings:
    +343
    Local Time:
    9:00 AM
    Latest
    Latest
    Updated the page, now even showing domain name:):)
    Project_CMM_7261.png

    Code (Text):
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1"/>
        <script src="//use.fontawesome.com/84c9ca0cf8.js"></script>
        <title>Site Construction</title>
    
        <style type="text/css">
            @import url('//fonts.googleapis.com/css?family=Roboto');
            body {
                background: #212327;
                color: #D7D7D7;
                font: 16px/1.3 "Roboto", sans-serif;
            }
            header {
                width: 100%;
                margin:0px auto;
            }
            h1 {
                text-align: center;
                color:#D7D7D7;
                font: 30px/1 "Roboto";
                text-transform: uppercase;
                display: block;
                margin: 5% auto 5%;
                margin-bottom: 35px;
            }
            p {
                font: 12px/1.3 "Roboto", sans-serif;
            }
    
            article { display: block; text-align: center; width: 650px; margin: 10px auto; }
    
            @media screen and (max-width: 720px) {
                article { display: block; text-align: center; width: 450px; margin: 0 auto; }
                h1 { font: 25px/1 "Roboto"; margin-bottom: 25px; }
            }
    
            @media screen and (max-width: 480px) {
                article { display: block; text-align: center; width: 300px !important; margin: 0 auto; }
                h1 { font: 20px/1 "Roboto"; margin-bottom: 15px;}
            }
        </style>
    
        <!--[if IE]><script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
    
    
    
    </head>
    <body>
    <div class="wrap">
        <article>
            <header>
                <h1 id="fittext1">Site Maintenance & Contruction</h1>
            </header>
            <p id="fittext2">Performing some site maintenance and construction.</p>
            <p id="fittext3">Check our updated page in  <script>
    document.getElementById("fittext3").innerHTML =
    "Check our updated page " + window.location.hostname;
    </script> in a few days!</p>
    
    
            <i class="fa fa-cog fa-spin fa-5x fa-fw"></i>
        </article>
    </div>
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
    <script src="//cdnjs.cloudflare.com/ajax/libs/FitText.js/1.2.0/jquery.fittext.js"></script>
    <script type="text/javascript">
        $("#fittext1").fitText(1.2);
        $("#fittext2").fitText(1.9);
        $("#fittext3").fitText(1.7);
    </script>
    </body>
    <!-- Matomo -->
    <script type="text/javascript">
      var _paq = window._paq || [];
      /* tracker methods like "setCustomDimension" should be called before "trackPageView" */
      _paq.push(["setCookieDomain", "*.domain.com"]);
      _paq.push(['trackPageView']);
      _paq.push(['enableLinkTracking']);
      (function() {
        var u="https://analytics.domain.com/";
        _paq.push(['setTrackerUrl', u+'matomo.php']);
        _paq.push(['setSiteId', '9']);
        var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
        g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
      })();
    </script>
    <noscript><p><img src="https://analytics.domain.com/matomo.php?idsite=9&amp;rec=1" style="border:0;" alt="" /></p></noscript>
    <-- End Matomo Code -->
    </html>
    
     
    Last edited: Jun 18, 2019
  13. EckyBrazzz

    EckyBrazzz Active Member

    885
    186
    43
    Mar 28, 2018
    >>>>Click here<<<< i'm nearby......
    Ratings:
    +343
    Local Time:
    9:00 AM
    Latest
    Latest
    Now figuring out how to autotranslate it based on browser language!

    Obs. Posting image on test domain, so IP of server keeps secret!
    Project_CMM_7262.png
     
    Last edited: Jun 18, 2019
  14. Earl

    Earl New Member

    8
    4
    3
    Sep 17, 2015
    Ratings:
    +5
    Local Time:
    5:30 PM
    Yes, I can confirm this. I'm facing the same issue.
    Code:
    sitestatus off
    sets the whole server into maintenance mode. URI Exclude setting doesn't work.

    here is the maintenance.conf file
    Code (Text):
         # IPs you can whitelist from maintenance mode
         geo $maint_whitelist {
              include /usr/local/nginx/conf/sitestatus.conf;
              127.0.0.1 0;
              #124.43.196.31 0;
              #YOURIPADDRESS 0;
         }
    
         map $http_host$uri $exclude_url {
              default                                                0;
              "~^newdomain1.com/js/jquery.fittext.js"                1;
              "~^newdomain1.com/blog/js/jquery.fittext.js"           1;
              "~^under-maintenance-domain.com/" 1;
         }
    
         map $maint_whitelist$exclude_url $maintenance {
              default        1;
              10             1;
              11             1;
              00             0;
              01             0;
         }
    

    this puts the whole server into maintenance mode including under-maintenance-domain.com

    Any update?
     
  15. eva2000

    eva2000 Administrator Staff Member

    46,238
    10,510
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,293
    Local Time:
    10:00 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    Are you using Cloudflare in front of site on Centmin Mod Nginx ?