Learn about Centmin Mod LEMP Stack today
Become a Member

Add a sub domain, Wordpress menu 22

Discussion in 'Install & Upgrades or Pre-Install Questions' started by Mrbo, Jun 5, 2019.

  1. Mrbo

    Mrbo Member

    112
    7
    18
    Jun 17, 2018
    Ratings:
    +7
    Local Time:
    1:15 AM
    Hi, can I add a sub domain through the menu option 22? If so, do I have to take any additional actions afterwards?
     
  2. eva2000

    eva2000 Administrator Staff Member

    45,662
    10,360
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,079
    Local Time:
    4:15 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    adding subdomain is same as non-subdomain, at prompt just enter subdomain name you want :)
    Code (Text):
    -------------------------------------------------------------
    Setup full Nginx vhost + Wordpress + WP Plugins
    -------------------------------------------------------------
    
    ---------------------------------------------------------------
    Important Information
    ---------------------------------------------------------------
    
    You are about to create an Wordpress based Nginx vhost site with
    or without HTTPS/SSL support.
    Also read the continually updated Getting Started Guide
    at centminmod.com/getstarted.html if you haven't already
    ---------------------------------------------------------------
    403 Permission denied message handling
    if after vhost site setup you encounter 403 permission denied errors,
    check https://community.centminmod.com/threads/11215/ to see if your
    site needs tools/autoprotect.sh tweaking & whitelisting
    ---------------------------------------------------------------
    
    Do you want to continue with Nginx vhost site creation ? [y/n] y
    
    Enter vhost domain name you want to add (without www. prefix): subdomain.domain.com
    
     
  3. Mrbo

    Mrbo Member

    112
    7
    18
    Jun 17, 2018
    Ratings:
    +7
    Local Time:
    1:15 AM
    Awesome, thanks!
     
  4. vivek singh

    vivek singh New Member

    7
    1
    3
    Sep 20, 2020
    Ratings:
    +1
    Local Time:
    11:45 PM
    i craeted a wordpress from option 22 now I want to create a subdomain for cdn to server static content from wp-conetent so for that I need to set a sub domain pointing to wp-content folder can anyone guide me how to do this.
     
  5. eva2000

    eva2000 Administrator Staff Member

    45,662
    10,360
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,079
    Local Time:
    4:15 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    is CDN 3rd party of own self-hosted CDN ? If 3rd party CDN, then subdomain is created at DNS record level i.e. a CDN for cdn.yourdomain.com target to CDN providers subdomain and doesn't involve Nginx vhost configuration. Your 3rd party CDN provider would have instructions for such.
     
  6. vivek singh

    vivek singh New Member

    7
    1
    3
    Sep 20, 2020
    Ratings:
    +1
    Local Time:
    11:45 PM
    Using cloudflare and i just want to add subdomain pointing to wp-content folder.
     
  7. eva2000

    eva2000 Administrator Staff Member

    45,662
    10,360
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,079
    Local Time:
    4:15 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    then just add a DNS A record for subdomain to same Centmin Mod server IP as main Wordpress site and then edit Wordpress site's Nginx vhost conf file's server_name entries and add the new subdomain to the existing list i.e. if subdomain is cdn.domain.com
    Code (Text):
    server_name domain.com www.domain.com cdn.domain.com

    then restart Nginx server

    Then you can reference links like
    Code (Text):
    cdn.domain.com/wp-content/
     
  8. vivek singh

    vivek singh New Member

    7
    1
    3
    Sep 20, 2020
    Ratings:
    +1
    Local Time:
    11:45 PM
    Thanks for reply sir but my issue is I want cdn.domain.com points directly to wp-content/ folder so if I open cdn.domain.com then it shows an index of wp-content/ folder as the root folder for this domain.
     
  9. eva2000

    eva2000 Administrator Staff Member

    45,662
    10,360
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,079
    Local Time:
    4:15 AM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    You'd need to create a separate nginx vhost for cdn.domain.com via centmin.sh menu option 2 or nv command line with HTTPS Letsencrypt SSL and edit the roo directive path to path of wp-content directory.