Learn about Centmin Mod LEMP Stack today
Become a Member

Blesta Billing software

Discussion in 'Other Web Apps usage' started by nehafarzana, Aug 8, 2014.

  1. nehafarzana

    nehafarzana New Member

    12
    1
    3
    Jul 24, 2014
    Ratings:
    +1
    Local Time:
    11:14 AM
    1.7.3
    5.5.38
    Hello,
    Anyone has experience with Blesta & installing blesta on Centminmod? It requires ioncube and InnoDB enabled. I was able to install ioncube on centminmod but not sure how to enable InnoDB on mariadb.


    Any help please?
     
  2. eva2000

    eva2000 Administrator Staff Member

    53,883
    12,161
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,713
    Local Time:
    3:44 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    yeah ioncube should be easier with Centmin Mod beta Addon ioncube loader Addon [beta] | Centmin Mod Community

    but never used or even heard of Blesta

    as to enabling Innodb just edit /etc/my.cnf and comment out skip-innodb option and restart mysql server
     
  3. dooma

    dooma Active Member

    326
    34
    28
    Oct 15, 2016
    Cairo
    Ratings:
    +49
    Local Time:
    7:44 AM
    Hi @eva2000,
    What should be the nginx rewrite rules that should be added to domain.com.ssl.conf file ? because when I go to my domain.com/blesta it takes me to the main site and gives me this message " The requested page could not be found." ??

    Thanks
     
  4. dooma

    dooma Active Member

    326
    34
    28
    Oct 15, 2016
    Cairo
    Ratings:
    +49
    Local Time:
    7:44 AM
    I found this mod reweite rules on github for blesta, where should that be added ? as my ssl.conf file has its rewrites ?
    Code (Text):
    server {
        listen      80;
        server_name my.example.com;
        return 301 https://my.example.com$request_uri;
    }
    server {
            listen  123.456.789.988:443 ssl; #SSL Only
            server_name my.example.com;
            root /home/myfolder/blesta3/public_html;
            index index.php index.html index.htm;
            error_log  /home/myfolder/logs/nginx_error.log  warn;
            # Turn on SSL
            ssl on;
        ssl_certificate /etc/nginx/certs/my_example_com.pem;
        ssl_certificate_key /etc/nginx/certs/my.example.com.key;
        ssl_session_cache shared:SSL:10m;
        ssl_session_timeout 3m;
        # Protect against BEAST, POODLE, FREAK TLS attacks
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:ECDHE-RSA-AES128-GCM-SHA256:AES256+EECDH:DHE-RSA-AES128-GCM-SHA256:AES256+EDH:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:DES-CBC3-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4";
        ssl_prefer_server_ciphers on;
        # config to enable HSTS(HTTP Strict Transport Security)
        add_header Strict-Transport-Security "max-age=31536000; includeSubdomains;";
        # Forward Secrecy & Diffie Hellman Ephemeral Parameters must be generated.
        ssl_dhparam /etc/ssl/certs/dhparam.pem;
        client_body_buffer_size 32m;
           
            # Only for nginx-naxsi used with nginx-naxsi-ui : process denied requests
            #location /RequestDenied {
            #       proxy_pass http://127.0.0.1:8080;
            #}
    
            #error_page 404 /404.html;
    
            # redirect server error pages to the static page /50x.html
            # Set to directory of error files
            error_page 500 502 503 504 /50x.html;
            location = /50x.html {
                    root /usr/share/nginx/www;
            }
    
            # pass the PHP scripts to PHP FPM
            #
    location ~ \.php$ {
                    try_files $uri =404;
                    # Tweak for Nginx to work with PHP from vendors
                    fastcgi_split_path_info ^(.+\.php)(/.+)$;
                    # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
                    fastcgi_connect_timeout 60;
                    fastcgi_send_timeout 180;
                    fastcgi_read_timeout 180;
                    # Buffer settings increase to compensate for increased time/size due to SSL
                    fastcgi_buffer_size 128k;
                    fastcgi_buffers 4 256k; #
                    fastcgi_busy_buffers_size 256k;
                    fastcgi_temp_file_write_size 256k;
                    fastcgi_intercept_errors on;
                    # With php5-cgi alone:
                    #fastcgi_pass 127.0.0.1:9000;
                    # With php5-fpm (recommended)
                    fastcgi_pass unix:/var/run/php5-fpm.sock;
                    fastcgi_index index.php;
                    include fastcgi_params;
            }
           
    # Disallow access to any file with .pdt extension      
    location ~ (\.pdt) {
        return 403;
    }
    
    # Ported from Blesta's .htaccess
    # There are more than one way to accomplish this.
    # You can use try_files rather than using IF ... rewrite;
    location / {
      error_page     404 = @blesta; #IF file doesn't exist
      log_not_found  off;
    # For access to install file
    if ($request_uri ~ "^(.*)/install.php$"){
        rewrite install.php /%1/install/ redirect;
      }
    }
     
    #Core rewrite
    location @blesta {
      rewrite ^(.*)$ /index.php last;
    }
    
    
    }


    Thanks for your help
     
  5. eva2000

    eva2000 Administrator Staff Member

    53,883
    12,161
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,713
    Local Time:
    3:44 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    was 2+ yrs ago since i played with blesta 3.4 trial and posted my vhost config at Nginx Rewrite Oddity - Front End Links Ok, Backend Links Not? maybe use that as starting point

    not idea if latest blesta would work
    Code (Text):
    # Centmin Mod Getting Started Guide
    # must read [URL]http://centminmod.com/getstarted.html[/URL]
    
    # 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 newdomain.com;
    #            return 301 $scheme://www.newdomain.com$request_uri;
    #       }
    
    server {
      server_name newdomain.com www.newdomain.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;
    
      # limit_conn limit_per_ip 16;
      # ssi  on;
    
      access_log /home/nginx/domains/newdomain.com/log/access.log combined buffer=256k flush=60m;
      error_log /home/nginx/domains/newdomain.com/log/error.log;
    
      root /home/nginx/domains/newdomain.com/public;
    
    location ~ (\.pdt) {
    return 403;
    }
    
    location / {
           try_files $uri $uri/ /index.php?$args;
    }
    
      include /usr/local/nginx/conf/staticfiles_blesta.conf;
      include /usr/local/nginx/conf/php.conf;
      include /usr/local/nginx/conf/drop.conf;
    }
    

    For /usr/local/nginx/conf/staticfiles_blesta.conf include file it's just created from default /usr/local/nginx/conf/staticfiles.conf with a css and html context locations commented out
    Code (Text):
    cp -a /usr/local/nginx/conf/staticfiles.conf /usr/local/nginx/conf/staticfiles_blesta.conf
    

    then comment out css and html context locations commented out from /usr/local/nginx/conf/staticfiles_blesta.conf

    you'd have to adjust rewrites to /blesta subdirectory

    i.e.

    from
    Code (Text):
    location / {
           try_files $uri $uri/ /index.php?$args;
    }
    

    to
    Code (Text):
    location /blesta {
           try_files $uri $uri/ /blesta/index.php?$args;
    }
    
     
    Last edited: Jul 28, 2017
  6. dooma

    dooma Active Member

    326
    34
    28
    Oct 15, 2016
    Cairo
    Ratings:
    +49
    Local Time:
    7:44 AM
    It worked fine now :) ...... when I cp the statistics-besta file all html/css are already commented out so I didn't do anything with this file. is that correct ?
     
  7. dooma

    dooma Active Member

    326
    34
    28
    Oct 15, 2016
    Cairo
    Ratings:
    +49
    Local Time:
    7:44 AM
    Working with friendly URLs. :)

    The blesta cron should be added at crontab -e ??
     
    Last edited: Jul 28, 2017
  8. dooma

    dooma Active Member

    326
    34
    28
    Oct 15, 2016
    Cairo
    Ratings:
    +49
    Local Time:
    7:44 AM
    Hi @eva2000 , suddenly while using blesta and everything is fine. I got the below error !!
    403 forbidden
    nginx
     
  9. dooma

    dooma Active Member

    326
    34
    28
    Oct 15, 2016
    Cairo
    Ratings:
    +49
    Local Time:
    7:44 AM
    and this url /blesta/admin

    it gives : 404 not found
     
  10. eva2000

    eva2000 Administrator Staff Member

    53,883
    12,161
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,713
    Local Time:
    3:44 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    yes

    Centmin Mod is provide as is, so short of scripted related bugs or issues, any further optimisation to the web stack components - nginx, php-fpm, mariadb mysql, csf firewall etc or web app specific configurations are left to the Centmin Mod user to deal with. So I do not provide any free support for such web apps like Blesta.

    However, Centmin Mod users are free to help each other out and ask questions or give answers on this community forum. My hopes are that this community forum evolves so that more veteran long time Centmin Mod users help new Centmin Mod users out :)

    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)

    what is output of these commands in ssh
    Code (Text):
    curl -I https://domain.com
    

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

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

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

    wrap output in CODE tags
     
  11. eva2000

    eva2000 Administrator Staff Member

    53,883
    12,161
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,713
    Local Time:
    3:44 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    If on Centmin Mod 123.09beta01, you may have ran into the new tools/autoprotect.sh cronjob feature outlined at Beta Branch - autoprotect.sh - apache .htaccess check & migration to nginx deny all | Centmin Mod Community You uploaded scripts may have .htaccess deny from all type files in their directories which may need bypassing autoprotect. It's a security feature that no other nginx based stack has as far as I know :)

    So instead, all .htaccess 'deny from all' detected directories now get auto generated Nginx equivalent location match and deny all setups except if you want to manually bypass the directory from auto protection via a .autoprotect-bypass file - details below here.

    You can read a few threads below on how autoprotect.sh may have caught some folks web apps falsely and the workarounds or improvements made to autoprotect.sh with the help of users feedback and troubleshooting.
     
  12. dooma

    dooma Active Member

    326
    34
    28
    Oct 15, 2016
    Cairo
    Ratings:
    +49
    Local Time:
    7:44 AM
    Hello Thanks for answer :

    MYdomain.com is working fine 100%. The issue with mydomain.com/blesta.

    The outputs :
    Code (Text):
    curl -I https://mydomain.com/blesta
    HTTP/1.1 301 Moved Permanently
    Date: Fri, 28 Jul 2017 22:51:53 GMT
    Content-Type: text/html
    Content-Length: 178
    Location: https://mydomain.com/blesta
    Connection: keep-alive
    Server: nginx centminmod
    X-Powered-By: centminmod
    


    Code (Text):
    curl -I https://mydomain.com
    HTTP/1.1 200 OK
    Date: Fri, 28 Jul 2017 22:51:35 GMT
    Content-Type: text/html; charset=UTF-8
    Content-Length: 58672
    Connection: keep-alive
    Vary: Accept-Encoding
    Expires: Thu, 19 Nov 1981 08:52:00 GMT
    Cache-control: private, max-age=0
    Set-Cookie: xf_session=8d72d28471a9ab933e7fd4232262f84a; path=/; secure; httponly
    X-Frame-Options: SAMEORIGIN
    X-Xss-Protection: 1
    Last-Modified: Fri, 28 Jul 2017 22:51:35 GMT
    Server: nginx centminmod
    X-Powered-By: centminmod
    


    Code (Text):
     curl -I http://mydomain.com/blesta
    HTTP/1.1 302 Moved Temporarily
    Date: Fri, 28 Jul 2017 22:55:15 GMT
    Content-Type: text/html
    Content-Length: 154
    Connection: keep-alive
    Location: https://mydomain.com/blesta
    Server: nginx centminmod
    X-Powered-By: centminmod
    


    Code (Text):
    curl -I http://mydomain.com
    HTTP/1.1 302 Moved Temporarily
    Date: Fri, 28 Jul 2017 22:56:21 GMT
    Content-Type: text/html
    Content-Length: 154
    Connection: keep-alive
    Location: https://mydomain.com/
    Server: nginx centminmod
    X-Powered-By: centminmod
    


    Code (Text):
    cat /usr/local/nginx/conf/conf.d/mydomain.com.ssl.conf
    # Centmin Mod Getting Started Guide
    # must read http://centminmod.com/getstarted.html
    # For SPDY SSL Setup
    # read http://centminmod.com/nginx_configure_https_ssl_spdy.html
    
    # redirect from www to non-www  forced SSL
    # uncomment, save file and restart Nginx to enable
    # if unsure use return 302 before using return 301
      server {
            listen   80;
            server_name mydomain.com www.mydomain.com;
            return 302 https://$server_name$request_uri;
      }
    
    server {
      listen 443 ssl http2;
      server_name mydomain.com www.mydomain.com;
    
      ssl_dhparam /usr/local/nginx/conf/ssl/mydomain.com/dhparam.pem;
      ssl_certificate      /usr/local/nginx/conf/ssl/mydomaincom/ssl-unified.crt;
      ssl_certificate_key  /usr/local/nginx/conf/ssl/mydomaincom/mydomain_com.key;
      include /usr/local/nginx/conf/ssl_include.conf;
    
      http2_max_field_size 16k;
      http2_max_header_size 32k;
      # mozilla recommended
      ssl_ciphers EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+ECDSA+AESGCM:EECDH+aRSA+AESGCM:EECDH+ECDSA+SHA256:EECDH+ECDSA+SHA384:EECDH+aRSA+SHA256:EECDH+aRSA+SHA384:EECDH+AES128:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS:!RC4:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA:!CAMELLIA;
      ssl_prefer_server_ciphers   on;
      #add_header Alternate-Protocol  443:npn-spdy/3;
    
      # before enabling HSTS line below read centminmod.com/nginx_domain_dns_setup.html#hsts
      #add_header Strict-Transport-Security "max-age=31536000; includeSubdomains;";
      #add_header X-Frame-Options SAMEORIGIN;
      #add_header X-Xss-Protection "1; mode=block" always;
      #add_header X-Content-Type-Options "nosniff" always;
      #spdy_headers_comp 5;
      ssl_buffer_size 1369;
      ssl_session_tickets on;
    
      # enable ocsp stapling
      resolver 8.8.8.8 8.8.4.4 valid=10m;
      resolver_timeout 10s;
      ssl_stapling on;
      ssl_stapling_verify on;
      ssl_trusted_certificate /usr/local/nginx/conf/ssl/mydomaincom/ssl-trusted.crt;
    
    # 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;
    
      # limit_conn limit_per_ip 16;
      # ssi  on;
    
      access_log /home/nginx/domains/mydomain.com/log/access.log combined buffer=256k flush=5m;
      error_log /home/nginx/domains/mydomain.com/log/error.log;
    
      include /usr/local/nginx/conf/autoprotect/mydomain.com/autoprotect-mydomain.com.conf;
      root /home/nginx/domains/mydomain.com/public;
    
     location / {
         index index.php index.html index.htm;
         try_files $uri $uri/ /index.php?$uri&$args;
    }
    
    location /admin.php {
         auth_basic "Private";
         auth_basic_user_file /usr/local/nginx/conf/htpasswd_admin_php;
         include /usr/local/nginx/conf/php.conf;
          }
    
    location /install/ {
         auth_basic "Private";
         auth_basic_user_file /usr/local/nginx/conf/htpasswd_admin_php;
         include /usr/local/nginx/conf/php.conf;
          }
    
    location /internal_data/ {
         internal;
         allow 127.0.0.1;
         #allow YOURIPADDRESS;
         deny all;
    }
    
    location /library/ {
         internal;
         allow 127.0.0.1;
         #allow YOURIPADDRESS;
         deny all;
    }
    
    location ~ (\.pdt) {
    return 403;
    }
    
    location /blesta {
           try_files $uri $uri/ /blesta/index.php?$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;
    }


    The domain.conf file was disabled to allow SSL forcing.

    Thanks for your replay.
     
  13. eva2000

    eva2000 Administrator Staff Member

    53,883
    12,161
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,713
    Local Time:
    3:44 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    this below needs correcting
    Code (Text):
      server {
           listen   80;
           server_name mydomain.com www.mydomain.com;
           return 302 https://$server_name$request_uri;
      }
    
    server {
      listen 443 ssl http2;
      server_name mydomain.com www.mydomain.com;
    

    for 1st part instead of $server_name use the preferred domain name mydomain.com or the www version

    for 2nd part server_name should only list the preferred domain name mydomain.com or the www version
    Code (Text):
    server {
      listen 443 ssl http2;
      server_name mydomain.com www.mydomain.com;
    

    so if preferred domain name to use is mydomain.com
    Code (Text):
      server {
           listen   80;
           server_name mydomain.com www.mydomain.com;
           return 302 https://mydomain.com$request_uri;
      }
    
    server {
      listen 443 ssl http2;
      server_name mydomain.com;
    

    this curl header check shows a possible issue
    Code (Text):
    curl -I https://mydomain.com/blesta
    HTTP/1.1 301 Moved Permanently
    Date: Fri, 28 Jul 2017 22:51:53 GMT
    Content-Type: text/html
    Content-Length: 178
    Location: https://mydomain.com/blesta
    Connection: keep-alive
    Server: nginx centminmod
    X-Powered-By: centminmod
    


    your vhost has no 301 permanent redirects, only a 302 temp redirect so the 301 redirect is coming from somewhere else causing https version of your mydomain.com/blesta url to redirect to itself - redirect loop.

    you can grep filter for 301 instances in vhost config directory at /usr/local/nginx/conf/conf.d
    Code (Text):
    grep -rn '301' /usr/local/nginx/conf/conf.d
    

    show matches in context with 5 lines before and after the matched 301
    Code (Text):
    grep -rn '301' -C5 /usr/local/nginx/conf/conf.d
    
     
  14. dooma

    dooma Active Member

    326
    34
    28
    Oct 15, 2016
    Cairo
    Ratings:
    +49
    Local Time:
    7:44 AM
    @eva2000 . Here are the denied directives. I think that's the issue . ???
    Code (Text):
    grep location /usr/local/nginx/conf/autoprotect/mydomain.com/autoprotect-mydomain.com.conf
    location ~* ^/blesta/plugins/phpids/lib/IDS/ { allow 127.0.0.1; deny all; }
    location /blesta/ {
      location ~ ^/blesta/(.+/)?(.+)\.(js)$ { allow all; expires 30d; }
      location ~ ^/blesta/(.+/)?(.+)\.(css)$ { allow all; expires 30d; }
      location ~ ^/blesta/(.+/)?(.+)\.(gif|jpe?g|png|webp|eot|svg|ttf|woff|woff)$ { allow all; expires 30d; }
      location ~ ^/blesta/(.+/)?(.+)\.(php|cgi|pl|php3|php4|php5|php6|phtml|shtml)$ { allow 127.0.0.1; deny all; }
    # location /library/ {
    # location /internal_data/ {
    
     
  15. eva2000

    eva2000 Administrator Staff Member

    53,883
    12,161
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,713
    Local Time:
    3:44 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  16. dooma

    dooma Active Member

    326
    34
    28
    Oct 15, 2016
    Cairo
    Ratings:
    +49
    Local Time:
    7:44 AM
    So it's autoprotect issue ?
    --------
    The output of the grep :
    Code (Text):
    grep -rn '301' /usr/local/nginx/conf/conf.d
    /usr/local/nginx/conf/conf.d/mydomain.com.conf-disabled:6:# if unsure us                         e return 302 before using return 301
    /usr/local/nginx/conf/conf.d/mydomain.com.conf-disabled:10:                                      return 301 $scheme://www.mydomain.com$request_uri;
    /usr/local/nginx/conf/conf.d/mydomain.com.ssl.conf:8:# if unsure use ret                         urn 302 before using return 301
    /usr/local/nginx/conf/conf.d/demodomain.com.conf:6:            return 301 $schem                         e://www.demodomain.com$request_uri;
    


    Code (Text):
    grep -rn '301' -C5 /usr/local/nginx/conf/conf.d
    /usr/local/nginx/conf/conf.d/mydomain.com.conf-disabled-1-# Centmin Mod                          Getting Started Guide
    /usr/local/nginx/conf/conf.d/mydomain.com.conf-disabled-2-# must read ht                         tp://centminmod.com/getstarted.html
    /usr/local/nginx/conf/conf.d/mydomain.com.conf-disabled-3-
    /usr/local/nginx/conf/conf.d/mydomain.com.conf-disabled-4-# redirect fro                         m non-www to www
    /usr/local/nginx/conf/conf.d/mydomain.com.conf-disabled-5-# uncomment, s                         ave file and restart Nginx to enable
    /usr/local/nginx/conf/conf.d/mydomain.com.conf-disabled:6:# if unsure us                         e return 302 before using return 301
    /usr/local/nginx/conf/conf.d/mydomain.com.conf-disabled-7- server {
    /usr/local/nginx/conf/conf.d/mydomain.com.conf-disabled-8-             l                         isten   80;
    /usr/local/nginx/conf/conf.d/mydomain.com.conf-disabled-9-             s                         erver_name mydomain.com;
    /usr/local/nginx/conf/conf.d/mydomain.com.conf-disabled:10:                                      return 301 $scheme://www.mydomain.com$request_uri;
    /usr/local/nginx/conf/conf.d/mydomain.com.conf-disabled-11-        }
    /usr/local/nginx/conf/conf.d/mydomain.com.conf-disabled-12-
    /usr/local/nginx/conf/conf.d/mydomain.com.conf-disabled-13-server {
    /usr/local/nginx/conf/conf.d/mydomain.com.conf-disabled-14-
    /usr/local/nginx/conf/conf.d/mydomain.com.conf-disabled-15-  server_name                          mydomain.com www.mydomain.com;
    --
    /usr/local/nginx/conf/conf.d/mydomain.com.ssl.conf-3-# For SPDY SSL Setu                         p
    /usr/local/nginx/conf/conf.d/mydomain.com.ssl.conf-4-# read http://centm                         inmod.com/nginx_configure_https_ssl_spdy.html
    /usr/local/nginx/conf/conf.d/mydomain.com.ssl.conf-5-
    /usr/local/nginx/conf/conf.d/mydomain.com.ssl.conf-6-# redirect from www                          to non-www  forced SSL
    /usr/local/nginx/conf/conf.d/mydomain.com.ssl.conf-7-# uncomment, save f                         ile and restart Nginx to enable
    /usr/local/nginx/conf/conf.d/mydomain.com.ssl.conf:8:# if unsure use ret                         urn 302 before using return 301
    /usr/local/nginx/conf/conf.d/mydomain.com.ssl.conf-9-  server {
    /usr/local/nginx/conf/conf.d/mydomain.com.ssl.conf-10-        listen   8                         0;
    /usr/local/nginx/conf/conf.d/mydomain.com.ssl.conf-11-        server_nam                         e mydomain.com www.mydomain.com;
    /usr/local/nginx/conf/conf.d/mydomain.com.ssl.conf-12-        return 302                          https://mydomain.com$request_uri;
    /usr/local/nginx/conf/conf.d/mydomain.com.ssl.conf-13-  }
    --
    /usr/local/nginx/conf/conf.d/demodomain.com.conf-1-
    /usr/local/nginx/conf/conf.d/demodomain.com.conf-2-# redirect from non-www to ww                         w
    /usr/local/nginx/conf/conf.d/demodomain.com.conf-3-server {
    /usr/local/nginx/conf/conf.d/demodomain.com.conf-4-            listen   80;
    /usr/local/nginx/conf/conf.d/demodomain.com.conf-5-            server_name demod                         omain.com;
    /usr/local/nginx/conf/conf.d/demodomain.com.conf:6:            return 301 $schem                         e://www.demodomain.com$request_uri;
    /usr/local/nginx/conf/conf.d/demodomain.com.conf-7-
    /usr/local/nginx/conf/conf.d/demodomain.com.conf-8-       }
    /usr/local/nginx/conf/conf.d/demodomain.com.conf-9-
    /usr/local/nginx/conf/conf.d/demodomain.com.conf-10-server {
    /usr/local/nginx/conf/conf.d/demodomain.com.conf-11-            listen   80;
     
  17. dooma

    dooma Active Member

    326
    34
    28
    Oct 15, 2016
    Cairo
    Ratings:
    +49
    Local Time:
    7:44 AM
    Hello @eva2000 now my blesta back to work :D

    Here's what I have done and tell me please if there's any mistake or no need step :

    1- I created .autoprotect-bypass file in the blesta directory and I put this rule inside it :
    Code (Text):
    location ~* ^/blesta { deny all; }


    2-I ran this :
    Code (Text):
    /usr/local/src/centminmod/tools/autoprotect.sh


    3-I added the below rules to this file /home/nginx/domains/domain.com/public/blesta/.htaccess :
    Code (Text):
    # /home/nginx/domains/domain.com/public/blesta
    location ~* ^/blesta { deny all; }


    and it worked. The nginx restarted auto when I ran step number 2.

    4- I already have the autoprotect include file placed above the root definition in my /usr/local/nginx/conf/conf.d/domain.com.ssl.conf

    Is there any mistake or do you suggest modification ?

    Regarding the previous replay what do you advise to edit with the 301 and 302 ??

    Thanks
     
  18. dooma

    dooma Active Member

    326
    34
    28
    Oct 15, 2016
    Cairo
    Ratings:
    +49
    Local Time:
    7:44 AM
    I added it but till now the cron doesn't run?! should I restart the nginx ?
     
  19. eva2000

    eva2000 Administrator Staff Member

    53,883
    12,161
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,713
    Local Time:
    3:44 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    .autoprotect-bypass can be blank doesn't need anything in it - it just needs to exist
     
    Last edited: Jul 29, 2017
  20. eva2000

    eva2000 Administrator Staff Member

    53,883
    12,161
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,713
    Local Time:
    3:44 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    cron is on schedule so only runs scheduled times not all the time