Learn about Centmin Mod LEMP Stack today
Register Now

Sysadmin How do i setup multiple sites (access locally) in Centminmod?

Discussion in 'System Administration' started by sfs00784, Oct 15, 2018.

  1. sfs00784

    sfs00784 Member

    35
    4
    8
    Nov 8, 2017
    Ratings:
    +13
    Local Time:
    12:18 AM
    I tested this but doesn't work.
    Code:
    server {
                listen 8080;
                server_name ttce.com;
                root /home/nginx/domains/ttce.com/public;
    
      access_log /home/nginx/domains/ttce.com/log/access.log combined buffer=256k flush=5m;
      error_log /home/nginx/domains/ttce.com/log/error.log;
     
      include /usr/local/nginx/conf/autoprotect/ttce.com/autoprotect-ttce.com.conf;
    # 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;
    
            location /nginx_status {
            stub_status on;
            access_log   off;
            allow 127.0.0.1;
            #allow youripaddress;
            deny all;
            }
    
                location / {
    
    # 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/phpmyadmin.conf;
    include /usr/local/nginx/conf/staticfiles.conf;
    include /usr/local/nginx/conf/include_opcache.conf;
    include /usr/local/nginx/conf/php.conf;
    #include /usr/local/nginx/conf/phpstatus.conf;
    include /usr/local/nginx/conf/drop.conf;
    #include /usr/local/nginx/conf/errorpage.conf;
    #include /usr/local/nginx/conf/vts_mainserver.conf;
    
           }
    


     
    Last edited: Oct 18, 2018
  2. eva2000

    eva2000 Administrator Staff Member

    58,905
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    2:18 AM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    FYI, or posting code or output from commands to keep the formatting, you might want to use CODE tags for code How to use forum BBCODE code tags :)

    Can you explain on what you mean doesn't work ? What do you mean local access ? you mean different port from 80/443 ? Like on port 8080 so domain.com:8080 ?

    Centmin Mod uses CSF Firewall to protect the server, so for non-standard port access for HTTP/HTTPS like domain.com:8080, you need to whitelist the port by adding the custom port you want in TCP_IN/TCP_OUT and TCP6_IN and TCP6_OUT comma separated list of ports in CSF Firewall config file at /etc/csf/csf.conf. You can edit, add or remove ports you require and then restart CSF Firewall service for it to take effect. You can see a list of default Centmin Mod CSF Firewall handled ports at CSF - Centmin Mod LEMP stack CSF Firewall default port listing.

    In SSH you can type this command to have a quick overview of existing ports for the respective variables.
    Code (Text):
    egrep '^TCP_|^TCP6_|^UDP_|^UDP6_' /etc/csf/csf.conf
    

    Output will be a comma separated list of port numbers that are white listed by CSF Firewall
    Code (Text):
    TCP_IN =
    TCP_OUT =
    UDP_IN =
    UDP_OUT =
    TCP6_IN =
    TCP6_OUT =
    UDP6_IN =
    UDP6_OUT =
    

    To restart CSF Firewall
    Code (Text):
    csf -r