Get the most out of your Centmin Mod LEMP stack
Become a Member

How To: WordPress + HTML/PHP Websites + XenForo 2 + TeamSpeak3?

Discussion in 'Install & Upgrades or Pre-Install Questions' started by iamjonsnow, Dec 3, 2019.

  1. iamjonsnow

    iamjonsnow New Member

    5
    1
    1
    Dec 3, 2019
    Ratings:
    +1
    Local Time:
    12:21 AM
    Hi! I have just purchased a Linux Server with the following specifications:

    RAM: 8GB | SSD: 200GB | CPU: 4 Cores | Port: 200Mbits/s | OS: CentOS 7.7 (7.1908.0.el7.centos)

    (Don't have anything installed on the server apart from the OS)

    Applications to Install on the Same Server:

    1. WordPress Websites (With WP-Rocket Plugin + MaxCDN + Every Possible Cache & Minify)
    2. Stand Alone PHP / HTML Website
    3. XenForo Forum (MaxCDN if possible, Cache - Every Possible to Speedup)
    4. TeamSpeak Server (Latest TeamSpeak TS3)

    How should I proceed further with this requirements? I'm looking for the best options and guidance. I don't have much experience with the CLI or Linux. I used to use cPanel/WHM my whole life. But, now because of budget issues, I can't afford cPanel anymore.

    I've heard a lot about @eva2000 on multiple forums and I even read various threads before even joining this server. I really appreciate your help if you could help me setting a bit?

    I did read your threads which you link in all your introduction welcome messages. But, I am still unable to understand a lot of stuff.

    Secondly, some of them are bit old like some XenForo stuff is from 2014 when it was Version 1.

    Looking for some detailed help from this community.

    Reason to pain myself with all this CLI stuff and not going with easy route of cPanel or CyberPanel is also that I've read Centminmod is fast.

    P.S.: I have MaxCDN so I have access to multiple pull-zones throughout their network. So I can load images or static files from various locations to speedup the loading times.

    Thanks.
     
    • Like Like x 1
  2. eva2000

    eva2000 Administrator Staff Member

    42,346
    9,560
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,732
    Local Time:
    4:51 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    Is wordpress site on same domain as xenforo or separate domains ? If same domains is it like wordpress frontpage index and xenforo on same domain at same /forums directory ?

    My advice is setup a test hourly billed VPS with test data or copy of your forums live data to test separately without changing domain DNS so you can keep live site(s) running on existing server and learn ropes on test VPS with test Centmin Mod install Guide to learning more about Centmin Mod

    You can see example of using centmin.sh menu option 22 for wordpress install https://servermanager.guide/122/how-to-install-wordpress-on-centmin-mod-lemp-stack-guide/ if you have xenforo and wordpress on same domain, then I'd do wordpress install first via centmin.sh menu option 22 and then manually configure xenforo in same domain generated nginx vhost

    If separate domains for wordpress and xenforo, then do centmin.sh menu option 22 for wordpress and centmin.sh menu option 2 for xenforo or your plain html/php sites. Alternative to centmin.sh menu option 2 is the nv command line also outlined at https://community.centminmod.com/th...-nginx-vhost-site-mysql-database-setup.12904/

    For MySQL database/users mysqladmin_shell.sh Shell based Addon

    But yes intro thread reply has most info you need https://community.centminmod.com/threads/hi-im-new-here.18774/#post-79823 including must read sections after initial install for Getting Started Guide, FAQ, Config Files and centmin.sh guide.
     
    • Like Like x 1
  3. iamjonsnow

    iamjonsnow New Member

    5
    1
    1
    Dec 3, 2019
    Ratings:
    +1
    Local Time:
    12:21 AM
    Thanks for the reply. I really appreciate you coming here and helping.

    > Multiple WordPress Websites.
    > 1 x XenForo (on Domain.com) OR 1 x WordPress (On Domain.com) and XenForo (on domain.com/forum) [Still Deciding the option]
    > Standalone HTML / PHP Websites (Kind of like Portfolio Websites / Single Page Landing Pages)
    > TeamSpeak Server - TS3 Latest Stable Build

    (I use CloudFlare for the DNS Management and MaxCDN for the CDN)

    Right now, I don't have anything setup. Neither WordPress nor XenForo anywhere so I can do the testing without worrying about the Live Production. But I want to setup the stuff asap since, I want to release everything asap.

    Hmm, I hope I'm able to clear some of the confusing part here. I've actually read a lot of them to be honest.

    1. I'm not that techie
    2. Some of them are really old (specially XenForo). Are you sure, I can still follow them?
    3. There is a plugin, LSCache on XenForo Resources (Official), there people are claiming that LSCache on LiteSpeed is doing really good for them and performs better than any other web-server. What do you think of it?
    4. How do I manage the multiple domains with the centminmod (Like in cPanel you can do it like, How to install application specifically for the specific domain, like in cPanel, you install WordPress within the Domain's directory).
    5. I read somewhere that centminmod is not having stable support for the PHP7. Is that true? Because, WordPress now needs 7.x for better quality and security. (My Previous host was running on Php5. And, WordPress used to throw error/notification).

    You've missed to mention anything about TeamSpeak and MemCache and any other kind of Cache for the XenForo and WordPress. Since, I'll be using WP-Rocket for the WordPress which uses a lot of Caching.

    Please Guide Me!

    Thanks.

     
  4. eva2000

    eva2000 Administrator Staff Member

    42,346
    9,560
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,732
    Local Time:
    4:51 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    this https://community.centminmod.com/th...on-centmin-mod-123-09beta01-lemp-stack.16060/ should be fine

    won't work fully with centmin mod nginx though as you need litespeed cache module for it

    You'd have to install it manually if they're all on same domain i.e. domain.com has wordpress on index domain.com/forum has forums, domain.com/newsletter web app etc would all need to be manually installed after centmin.sh wordpress install via centmin.sh, would do forums at /forums and newsletter at /newsletter.

    Centmin Mod 123.08stable only supports to max PHP 7.0.33. Centmin Mod latest 123.09beta01 supports PHP 7.0, 7.1, 7.2, 7.3 and 7.4 and 8.0 dev see https://community.centminmod.com/th...-4-vs-7-3-vs-7-2-vs-7-1-vs-7-0-php-fpm.18741/

    centmin.sh menu option 22 has it's own wordpress caching options

    In context of Wordpress caching for centmin.sh menu option 22 wordpress auto installer for Centmin Mod 123.09beta01 and newer, you have 3 offered wordpress caching options:
    1. Redis Nginx Level Caching - centmin.sh menu option 22 will auto install redis if not detected if you choose this in centmin.sh menu option 22 setup. Otherwise, need to install redis yourself. Best combined with Autoptimize WP plugin
    2. KeyCDN Cache Enabler for full page static html caching (safest choice for balance of performance and reliability). Best combined with Autoptimize WP plugin
    3. WP Super Cache for full page static html caching. Best combined with Autoptimize WP plugin
    1. redis caching at nginx level can be fastest but needs fine tuning and deep understanding of your web app and it's plugins to get right i.e. woocommerce etc. So can be problematic too. Most caching is are for guest caching only.

    2. keycdn cache enabler wp plugin - better version of wp super cache for full page static caching of wordpress. Least problematic and closest to set and forget with maybe some tuning needed depending on wp plugins and site configuration. Config is for guest caching only.

    And regardless of caching method, having right server(s) hardware and configuration and LEMP stack and system TCP level configurations to handle the traffic is a must otherwise regardless of caching used, it won't scale. So you would want non-OpenVZ based VPS like KVM or dedicated. Choosing OpenVZ VPS will limit your scalability.

    FYI, all caching methods = generally higher memory consumption and sometimes higher cache related cpu consumption. The goal of caching in context of wordpress is usually to lessen the load placed on php/php-fpm as that is the weakest part of any LEMP/LAMP setup in terms of scalability. So sometimes caching isn't necessary faster just scales better in high concurrent traffic environments.

    You can see centmin.sh menu option 22 wordpress installed demo and benchmarks on my Wordpress7 demo site and also on my latest Wordpress blog at https://servermanager.guide

    TeamSpeak, I have no experience with unfortunately. Configuration wise you made need to tweak your CSF Firewall's UDP rate limits for it see @Tythus post at https://community.centminmod.com/th...on-my-packet-loss-goes-through-the-roof.2368/ and my replies

    Xenforo 2 can use redis cache also outlined in https://community.centminmod.com/th...on-centmin-mod-123-09beta01-lemp-stack.16060/ no need for memcached
     
    • Like Like x 1
  5. iamjonsnow

    iamjonsnow New Member

    5
    1
    1
    Dec 3, 2019
    Ratings:
    +1
    Local Time:
    12:21 AM
    Hi, Thanks.

    I'm going to check all of them next-thing in the morning. Hmm, My Server is KVM. (Screenshot, I hope I am right)

    One thing which I think is a misunderstanding:

    With Multiple Domains Here:

    What I meant there is that, suppose I am going to host 10-20 domains such as xyz.com, abc.com, pbc.com and so on.. How do I handle them with the centminmod?

    In the cPanel you have File Manager, Add-On Domain Adding Section. It becomes easy to install there since, as soon as you add an add-on domain, it makes a library and link the domain to that library folder. So if you enter the domain name in the URL Bar, it loads wordpress and you install it (even if you uploaded files via. FTP).

    How to do multiple domains installation with the centminmod?

    (Same thing you can do with the CyberPanel as well)

    Thanks
     
  6. eva2000

    eva2000 Administrator Staff Member

    42,346
    9,560
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,732
    Local Time:
    4:51 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    see Getting Started Guide step 2 http://centminmod.com/getstarted.html and how Config files are structured for each domain site you add via centmin.sh menu option 2, 22 or nv command line at http://centminmod.com/configfiles.html

    Also general cPanel to Centmin Mod migration guide at https://community.centminmod.com/th...-whm-sites-to-centmin-mod-lemp-servers.11610/ which outlines differences between cpanel and Centmin Mod file/directory structure wise for each domain site in 2nd post.
     
  7. iamjonsnow

    iamjonsnow New Member

    5
    1
    1
    Dec 3, 2019
    Ratings:
    +1
    Local Time:
    12:21 AM
    Okay. Thanks for the reply. One thing more.

    I want to install SSL on my hostname.

    My Hosting Provider provides me something like vs3545.domain.com (This is my hostname)

    How can I install SSL to this?
     
  8. eva2000

    eva2000 Administrator Staff Member

    42,346
    9,560
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,732
    Local Time:
    4:51 AM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    The only thing that can mess up virtual.conf main host is if you install phpmyadmin.sh addon. Otherwise, you can manually setup main hostname outlined in Getting Started Guide step 1 with HTTPS using vhost generator at Generate Centmin Mod Nginx Vhost - CentminMod.com LEMP Nginx web stack for CentOS

    type on domain fieldin main host name domain which has to have valid DNS A record pointing to server ip i.e. host.domain.com and check box that says Generate Self-Signed SSL / Letsencrypt SSL HTTPS Vhost (File ONLY) *

    Vhost type = basic and hit submit

    follow first 3 acme.sh commands only to get letsencrypt ssl cert but edit web root from
    /home/nginx/domains/host.domain.com/public to point to /usr/local/nginx/html and remove www. domain from -d

    enable letsencrypt in 123.09beta01 - 3 commands
    Code (Text):
    touch /etc/centminmod/custom_config.inc
    echo "LETSENCRYPT_DETECT='y'" >> /etc/centminmod/custom_config.inc
    /usr/local/src/centminmod/addons/acmetool.sh acmeupdate
    

    get letsencrypt ssl cert - 1 line cmd - webroot defined by -w /usr/local/nginx/html
    Code (Text):
    /root/.acme.sh/acme.sh --force --issue --days 60 -d host.domain.com -w /usr/local/nginx/html -k 2048 --useragent centminmod-centos-acmesh-webroot --log /root/centminlogs/acmetool.sh-debug-log-host.domain.com.log --log-level 2
    

    install letsencrypt ssl cert - 2 line cmds
    Code (Text):
    mkdir -p /usr/local/nginx/conf/ssl/host.domain.com
    /root/.acme.sh/acme.sh --installcert -d host.domain.com --certpath /usr/local/nginx/conf/ssl/host.domain.com/host.domain.com-acme.cer --keypath /usr/local/nginx/conf/ssl/host.domain.com/host.domain.com-acme.key --capath /usr/local/nginx/conf/ssl/host.domain.com/host.domain.com-acme.cer --reloadCmd /usr/bin/ngxreload --fullchainpath /usr/local/nginx/conf/ssl/host.domain.com/host.domain.com-fullchain-acme.key
    

    then make a copy of /usr/local/nginx/conf/conf.d/virtual.conf as /usr/local/nginx/conf/conf.d/virtual.ssl.conf
    Code (Text):
    cp -a /usr/local/nginx/conf/conf.d/virtual.conf /usr/local/nginx/conf/conf.d/virtual.ssl.conf
    

    now edit within /usr/local/nginx/conf/conf.d/virtual.ssl.conf with ssl cert lines so looks like
    Code (Text):
    server {
      listen 443 ssl http2;
      server_name host.domain.com;
    
      ssl_certificate      /usr/local/nginx/conf/ssl/host.domain.com/host.domain.com-acme.cer;
      ssl_certificate_key  /usr/local/nginx/conf/ssl/host.domain.com/host.domain.com-acme.key;
      include /usr/local/nginx/conf/ssl_include.conf;
    
      http2_max_field_size 16k;
      http2_max_header_size 32k;
      http2_max_requests 5000;
      # dual cert supported ssl ciphers
      ssl_ciphers TLS13-AES-128-GCM-SHA256:TLS13-AES-256-GCM-SHA384:TLS13-CHACHA20-POLY1305-SHA256:TLS13-AES-128-CCM-8-SHA256:TLS13-AES-128-CCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS;
      ssl_prefer_server_ciphers   on;
      #add_header Alternate-Protocol  443:npn-spdy/3;
      #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/host.domain.com/host.domain.com-acme.cer;
    
            root   html;
            access_log              /var/log/nginx/localhost.access.log     combined buffer=8k flush=1m;
            error_log               /var/log/nginx/localhost.error.log      error;
    
    # 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;
         
                }
    
    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;
    
           }
    

    restart nginx
    Code (Text):
    ngxrestart
    

    now you should be able to access both https and non-https hostname and then if all is working do a non-https to https 302 temp redirect



    If you do have phpmyadmin.sh installed phpmyadmin, you can probably try this to fix the conflict via these steps.

    1. Get the contents of /usr/local/nginx/conf/phpmyadmin_https.conf and place it in your above created
    /usr/local/nginx/conf/conf.d/virtual.ssl.conf main hostname HTTPS nginx vhost within server{} context

    2. Backup locally copy of phpmyadmin.sh auto generated self-signed SSL cert HTTPS vhost at /usr/local/nginx/conf/conf.d/phpmyadmin_ssl.conf

    3. Then take the below following values contained within /usr/local/nginx/conf/conf.d/phpmyadmin_ssl.conf and transpose them into your above created
    /usr/local/nginx/conf/conf.d/virtual.ssl.conf main hostname HTTPS nginx vhost within server{} context
    Code (Text):
    keepalive_timeout 3000;
    client_body_buffer_size 256k;
    client_body_timeout 3000s;
    client_header_buffer_size 256k;
    ## how long a connection has to complete sending
    ## it's headers for request to be processed
    client_header_timeout 60s;
    client_max_body_size 512m;
    connection_pool_size 512;
    directio 512m;
    ignore_invalid_headers on;
    large_client_header_buffers 8 256k;
    


    4. Then remove /usr/local/nginx/conf/conf.d/phpmyadmin_ssl.conf

    5. Test Nginx config & Restart Nginx & PHP-FPM
    Code (Text):
    nginx -t
    nprestart