Learn about Centmin Mod LEMP Stack today
Register Now

How to install Chevereto on centminmod?

Discussion in 'Other Web Apps usage' started by Kuro, Dec 14, 2018.

Tags:
  1. Kuro

    Kuro Member

    109
    13
    18
    Feb 8, 2018
    Ratings:
    +25
    Local Time:
    11:05 PM
    1.15.10
    10.3
    Hi Eva, i want to install chevereto on centminmod but i can't add the rules to nginx config because then nginx will boot error.


    [​IMG]

    i added it (full details here) into /usr/local/nginx/conf/conf.d/mydomain.conf
    and "nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed"
    I installed it through index.php file here
    I do not have much experience with server and I'm hoping you have a full tutorial :D
    Thanks!
     
  2. eva2000

    eva2000 Administrator Staff Member

    54,883
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,811
    Local Time:
    2:05 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    When you create a new nginx vhost domain via centmin.sh menu option 2 or menu option 22 or via /usr/bin/nv cli command line, you will create the Nginx vhost files and directories. You will get an outputted the path location where it will create the domain name's vhost conf file named newdomain.com.conf (and newdomain.com.ssl.conf if you selected yes to self signed SSL)
    • Nginx vhost conf path will be at /usr/local/nginx/conf/conf.d/newdomain.com.conf
    • Nginx HTTP/2 SSL vhost conf path will be at /usr/local/nginx/conf/conf.d/newdomain.com.ssl.conf
    • Nginx Self-Signed SSL Certificate Directory at /usr/local/nginx/conf/ssl/newdomain.com
    • Vhost public web root will be at /home/nginx/domains/newdomain.com/public
    • Vhost log directory will be at /home/nginx/domains/newdomain.com/log
    Please post the contents of /usr/local/nginx/conf/conf.d/newdomain.com.conf and if applicable /usr/local/nginx/conf/conf.d/newdomain.com.ssl.conf wrapped in CODE tags (outlined at How to use forum BBCODE code tags)
     
  3. Kuro

    Kuro Member

    109
    13
    18
    Feb 8, 2018
    Ratings:
    +25
    Local Time:
    11:05 PM
    1.15.10
    10.3
    Hi, my vhost config and I didn't select self signed SSL

    Code:
    # 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 domain.com;
    #            return 301 $scheme://www.domain.com$request_uri;
    #       }
    
    server {
     
      server_name domain.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;
      #add_header Referrer-Policy "strict-origin-when-cross-origin";
    
      # limit_conn limit_per_ip 16;
      # ssi  on;
    
      access_log /home/nginx/domains/domain.com/log/access.log combined buffer=256k flush=5m;
      error_log /home/nginx/domains/domain.com/log/error.log;
    
      include /usr/local/nginx/conf/autoprotect/domain.com/autoprotect-domain.com.conf;
      root /home/nginx/domains/domain.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;
    
      location / {
      include /usr/local/nginx/conf/503include-only.conf;
    
    # block common exploits, sql injections etc
    #include /usr/local/nginx/conf/block.conf;
    
      # Enables directory listings when index file not found
      #autoindex  on;
    
      # Shows file listing times as local time
      #autoindex_localtime on;
    
      # Wordpress Permalinks example
      #try_files $uri $uri/ /index.php?q=$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;
    }
    
    #Chevereto: Disable access to sensitive files
    location ~* /(app|content|lib)/.*\.(po|php|lock|sql)$ {
        deny all;
    }
    #Chevereto: CORS headers
    location ~* /.*\.(ttf|ttc|otf|eot|woff|woff2|font.css|css|js) {
        add_header Access-Control-Allow-Origin "*";
    }
    #Chevereto: Upload path for image content only and set 404 replacement
    location ^~ /images/ {
        location ~* (jpe?g|png|gif) {
            log_not_found off;
            error_page 404 /content/images/system/default/404.gif;
        }
        return 403;
    }
    #Chevereto: Pretty URLs
    location / {
        index index.php;
        try_files $uri $uri/ /index.php?$query_string;
    }
     
  4. eva2000

    eva2000 Administrator Staff Member

    54,883
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,811
    Local Time:
    2:05 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    only one location / public web root context is needed so you need to replace the existing one and rules need to be within server{} context like
    Code (Text):
    # 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 domain.com;
    #            return 301 $scheme://www.domain.com$request_uri;
    #       }
    
    server {
    
      server_name domain.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;
      #add_header Referrer-Policy "strict-origin-when-cross-origin";
    
      # limit_conn limit_per_ip 16;
      # ssi  on;
    
      access_log /home/nginx/domains/domain.com/log/access.log combined buffer=256k flush=5m;
      error_log /home/nginx/domains/domain.com/log/error.log;
    
      include /usr/local/nginx/conf/autoprotect/domain.com/autoprotect-domain.com.conf;
      root /home/nginx/domains/domain.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;
    
      location / {
      include /usr/local/nginx/conf/503include-only.conf;
    
       #Chevereto: Pretty URLs
       index index.php;
       try_files $uri $uri/ /index.php?$query_string;
      }
    
    #Chevereto: Disable access to sensitive files
    location ~* /(app|content|lib)/.*\.(po|php|lock|sql)$ {
       deny all;
    }
    #Chevereto: CORS headers
    location ~* /.*\.(ttf|ttc|otf|eot|woff|woff2|font.css|css|js) {
       add_header Access-Control-Allow-Origin "*";
    }
    #Chevereto: Upload path for image content only and set 404 replacement
    location ^~ /images/ {
       location ~* (jpe?g|png|gif) {
           log_not_found off;
           error_page 404 /content/images/system/default/404.gif;
       }
       return 403;
    }
    
      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;
    }
    
     
  5. Kuro

    Kuro Member

    109
    13
    18
    Feb 8, 2018
    Ratings:
    +25
    Local Time:
    11:05 PM
    1.15.10
    10.3
    Thanks ;)
    Good Night! :ROFLMAO: