Welcome to Centmin Mod Community
Become a Member

Install DigitalOcean VPS installation questions

Discussion in 'Install & Upgrades or Pre-Install Questions' started by dooma, Nov 2, 2016.

  1. dooma

    dooma Active Member

    326
    34
    28
    Oct 15, 2016
    Cairo
    Ratings:
    +49
    Local Time:
    10:25 AM
    I replaced the first part and its still down and I didnt get you where can I add the second part?

    thanks

    Code (Text):
     cat /usr/local/nginx/conf/conf.d/domain.com.conf
    # Centmin Mod Getting Started Guide
    # must read http://centminmod.com/getstarted.html
    
    # redirect from non-www to www
    # uncomment, save file and restart Nginx to enable
    # if unsure use return 302 before using return 301
    #server {
    #            listen   80;
    #            server_name mydomaint.com;
    #            return 301 $scheme://www.domain.com$request_uri;
    #       }
    
    server {
    
      server_name mydomain.com www.domain.com;
    
    # ngx_pagespeed & ngx_pagespeed handler
    #include /usr/local/nginx/conf/pagespeed.conf;
    #include /usr/local/nginx/conf/pagespeedhandler.conf;
    #include /usr/local/nginx/conf/pagespeedstatslog.conf;
    
      #add_header X-Frame-Options SAMEORIGIN;
      #add_header X-Xss-Protection "1; mode=block" always;
      #add_header X-Content-Type-Options "nosniff" always;
    
      # limit_conn limit_per_ip 16;
      # ssi  on;
    
      access_log /home/nginx/domains/myodomain.com/log/access.log main_ext buffer=256k flush=60m;
      error_log /home/nginx/domains/mydomaint.com/log/error.log;
    
      include /usr/local/nginx/conf/autoprotect/xmydomain.com/autoprotect-myodomain.com.conf;
      root /home/nginx/domains/mydomain.com/public;
      # uncomment cloudflare.conf include if using cloudflare for
      # server and/or vhost site
      #include /usr/local/nginx/conf/cloudflare.conf;
      include /usr/local/nginx/conf/503include-main.conf;
    
      # prevent access to ./directories and files
      #location ~ (?:^|/)\. {
      # deny all;
      #}
    
    location / {
               index index.php index.html index.htm;
                try_files $uri $uri/ /index.php?$uri&$args;
    
            }
    
      include /usr/local/nginx/conf/staticfiles.conf;
      include /usr/local/nginx/conf/php.conf;
      include /usr/local/nginx/conf/drop.conf;
      #include /usr/local/nginx/conf/errorpage.conf;
      include /usr/local/nginx/conf/vts_server.conf;
    }
    


     
  2. Sunka

    Sunka Well-Known Member

    1,150
    325
    83
    Oct 31, 2015
    Pula, Croatia
    Ratings:
    +525
    Local Time:
    10:25 AM
    Nginx 1.17.9
    MariaDB 10.3.22
    I belive this:

    Code:
    location / {
               index index.php index.html index.htm;
                try_files $uri $uri/ /index.php?$uri&$args;
    
            }
    
      include /usr/local/nginx/conf/staticfiles.conf;
      include /usr/local/nginx/conf/php.conf;
      include /usr/local/nginx/conf/drop.conf;
      #include /usr/local/nginx/conf/errorpage.conf;
      include /usr/local/nginx/conf/vts_server.conf;
    }
    Shoud be like this:
    Code:
        location / {
               index index.php index.html index.htm;
                try_files $uri $uri/ /index.php?$uri&$args;
            }
    
         location /internal_data/ {
            internal;
            allow 127.0.0.1;
            #allow my ISP ip;
            deny all;
            }
    
         location /library/ {
            internal;
            allow 127.0.0.1;
            #allow my ISP ip;
            deny all;
            }
    
      include /usr/local/nginx/conf/staticfiles.conf;
      include /usr/local/nginx/conf/php.conf;
      include /usr/local/nginx/conf/drop.conf;
      #include /usr/local/nginx/conf/errorpage.conf;
      include /usr/local/nginx/conf/vts_server.conf;
    }
     
  3. dooma

    dooma Active Member

    326
    34
    28
    Oct 15, 2016
    Cairo
    Ratings:
    +49
    Local Time:
    10:25 AM
    Thanks for help but still down !! :(

    Code (Text):
    cat /usr/local/nginx/conf/conf.d/mysite.com.conf
    # Centmin Mod Getting Started Guide
    # must read http://centminmod.com/getstarted.html
    
    # redirect from non-www to www
    # uncomment, save file and restart Nginx to enable
    # if unsure use return 302 before using return 301
    #server {
    #            listen   80;
    #            server_name mysite.com;
    #            return 301 $scheme://www.mysite.com$request_uri;
    #       }
    
    server {
    
      server_name mysite.com www.mysite.com;
    
    # ngx_pagespeed & ngx_pagespeed handler
    #include /usr/local/nginx/conf/pagespeed.conf;
    #include /usr/local/nginx/conf/pagespeedhandler.conf;
    #include /usr/local/nginx/conf/pagespeedstatslog.conf;
    
      #add_header X-Frame-Options SAMEORIGIN;
      #add_header X-Xss-Protection "1; mode=block" always;
      #add_header X-Content-Type-Options "nosniff" always;
    
      # limit_conn limit_per_ip 16;
      # ssi  on;
    
      access_log /home/nginx/domains/mysite.com/log/access.log main_ext buffer=256k flush=60m;
      error_log /home/nginx/domains/mysite.com/log/error.log;
    
      include /usr/local/nginx/conf/autoprotect/mysite.com/autoprotect-mysite.com.conf;
      root /home/nginx/domains/mysite.com/public;
      # uncomment cloudflare.conf include if using cloudflare for
      # server and/or vhost site
      #include /usr/local/nginx/conf/cloudflare.conf;
      include /usr/local/nginx/conf/503include-main.conf;
    
      # prevent access to ./directories and files
      #location ~ (?:^|/)\. {
      # deny all;
      #}
    
    location / {
               index index.php index.html index.htm;
                try_files $uri $uri/ /index.php?$uri&$args;
            }
    
    location /internal_data/ {
           internal;
            allow 127.0.0.1;
            #allow my ISP ip;
            deny all;
            }
    
            location /library/ {
            internal;
            allow 127.0.0.1;
            #allow my ISP ip;
            deny all;
            }
    
    
    
      include /usr/local/nginx/conf/staticfiles.conf;
      include /usr/local/nginx/conf/php.conf;
      include /usr/local/nginx/conf/drop.conf;
      #include /usr/local/nginx/conf/errorpage.conf;
      include /usr/local/nginx/conf/vts_server.conf;
    }
    
     
  4. Sunka

    Sunka Well-Known Member

    1,150
    325
    83
    Oct 31, 2015
    Pula, Croatia
    Ratings:
    +525
    Local Time:
    10:25 AM
    Nginx 1.17.9
    MariaDB 10.3.22
    nginx -t
     
  5. eva2000

    eva2000 Administrator Staff Member

    58,894
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    6:25 PM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    did you restart nginx after editing nginx vhost files ?
    Code (Text):
    service nginx restart

    or command shortcut
    Code (Text):
    ngxrestart

    Also as @Sunka mentioned nginx -t can check nginx config syntax
     
  6. dooma

    dooma Active Member

    326
    34
    28
    Oct 15, 2016
    Cairo
    Ratings:
    +49
    Local Time:
    10:25 AM
    I forgot to restart. Thank you :)
     
  7. dooma

    dooma Active Member

    326
    34
    28
    Oct 15, 2016
    Cairo
    Ratings:
    +49
    Local Time:
    10:25 AM
    How to protect the install and admin folder without using static IP ?

    and What is the best method to install my SSL I purchased from namecheap ?


    Thanks
     
    Last edited: Nov 6, 2016