Learn about Centmin Mod LEMP Stack today
Register Now

Nginx Using different location for root

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by andybond, May 20, 2019.

  1. andybond

    andybond New Member

    14
    7
    3
    Jun 1, 2017
    Ratings:
    +8
    Local Time:
    8:25 PM
    1.13.4
    10
    Please fill in any relevant information that applies to you:
    • CentOS Version: CentOS 7 64bit
    • Centmin Mod Version Installed: 123.09beta01
    • Nginx Version Installed: 1.15.3
    • PHP Version Installed: 7.2.9
    • MariaDB MySQL Version Installed:10.0.x
    • When was last time updated Centmin Mod code base ? : 5 minutes ago
    I have used centminmod to host two of my sites. One has almost outgrown the capacity in my server. I have added a second drive and mounted.

    Am I correct in saying I can just adjust the relevant folders and copy content to them to point to the newly mounted drive?

    eg

    root /home/nginx/domains/TLD/public;

    to

    root /home2/nginx/domains/TLD/public;


    Would it be a better action to move the data to the other drive then create a symbolic link?

    Any advice is appreciated.
     
  2. eva2000

    eva2000 Administrator Staff Member

    40,634
    9,023
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +13,891
    Local Time:
    5:25 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    Just create a new disk mount for /home/nginx on the new disk and have your data moved there. You do move /home or just /home/nginx - both would have similar instructions as https://serverfault.com/a/908602/34814

    Oh if you do recreate on a new mount /home/nginx, you'll need to recreate /home/nginx/domains too with some permissions specific for /home/nginx below as root user in SSH
    Code (Text):
    umask 027
    mkdir -p /home/nginx/domains
    mkdir -p /home/nginx/domains/demodomain.com/{public,private,log,backup}
    chown -R nginx:nginx /home/nginx
    chmod g+s /home/nginx
    chmod g+s /home/nginx/domains/
    umask 022
    
     
  3. andybond

    andybond New Member

    14
    7
    3
    Jun 1, 2017
    Ratings:
    +8
    Local Time:
    8:25 PM
    1.13.4
    10
    I would like to be able to keep one of my sites on the home and the other on home2.

    There isnt the option to be able to create one large drive move etc then drop the old drive
     
    style="display:inline-block;min-width:400px;max-width:970px;width:95%;height:90px" data-ad-client="ca-pub-6669518204467592" data-ad-slot="4024536743" data-ad-format="auto">
  4. eva2000

    eva2000 Administrator Staff Member

    40,634
    9,023
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +13,891
    Local Time:
    5:25 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    If you trust your web host or server provider, they can take site offline and clone the old drive to the new one.
     
  5. andybond

    andybond New Member

    14
    7
    3
    Jun 1, 2017
    Ratings:
    +8
    Local Time:
    8:25 PM
    1.13.4
    10
    I am the provider :)

    I dont have the capacity on the server to add in a single larger drive. I only have the option to add in the second drive.

    Hence wanting one site to goto home and the other home2

    I dont want to cause an outage to either site which are currently held on home either .