Welcome to Centmin Mod Community
Become a Member

Xenforo Making files writable for one click upgrades

Discussion in 'Forum software usage' started by CarpCharacin, Mar 14, 2019.

  1. CarpCharacin

    CarpCharacin Member

    265
    21
    18
    Oct 13, 2016
    Salt Lake City
    Ratings:
    +34
    Local Time:
    10:46 AM
    1.15.x
    MariaDB 10.1
    When I try to do a 1 click upgrade to XF 2.1.1, it says I can't, because the files aren't writable. What files/directories do I need to make writable in order for it to work? upgrade.PNG
     
  2. eva2000

    eva2000 Administrator Staff Member

    39,155
    8,647
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +13,296
    Local Time:
    2:46 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    • Like Like x 2
  3. JoeDer

    JoeDer Premium Member Premium Member

    41
    11
    8
    Feb 22, 2015
    Ratings:
    +31
    Local Time:
    7:46 PM
    Nginx 1.15.x
    MariaDB 10.3.x
    Try these commands from: Nginx Rewrites for Xenforo Friendly Urls - CentminMod.com LEMP Nginx web stack for CentOS
    Code:
    find /home/nginx/domains/newdomain.com/public/ -type f -print0 | xargs -0 chmod 0640
    find /home/nginx/domains/newdomain.com/public/ -type d -print0 | xargs -0 chmod 0750
    find /home/nginx/domains/newdomain.com/public/internal_data/ -type f -print0 | xargs -0 chmod 0660
    find /home/nginx/domains/newdomain.com/public/data/ -type f -print0 | xargs -0 chmod 0660
    find /home/nginx/domains/newdomain.com/public/internal_data/ -type d -print0 | xargs -0 chmod 0770
    find /home/nginx/domains/newdomain.com/public/data/ -type d -print0 | xargs -0 chmod 0770
    chmod 0755 /home/nginx/domains/newdomain.com/public
     
    • Informative Informative x 2
  4. CarpCharacin

    CarpCharacin Member

    265
    21
    18
    Oct 13, 2016
    Salt Lake City
    Ratings:
    +34
    Local Time:
    10:46 AM
    1.15.x
    MariaDB 10.1
    I just tried them, and now it says HTTP error 500 :(
     
  5. CarpCharacin

    CarpCharacin Member

    265
    21
    18
    Oct 13, 2016
    Salt Lake City
    Ratings:
    +34
    Local Time:
    10:46 AM
    1.15.x
    MariaDB 10.1
    I had to restore the VPS from a backup, but I still need to get the permissions set up correctly to get 1 click upgrades working.
     
  6. eva2000

    eva2000 Administrator Staff Member

    39,155
    8,647
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +13,296
    Local Time:
    2:46 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    what's permissions for the following directories right now before any chmod changes
    • /home/nginx/domains/newdomain.com/public/
    • /home/nginx/domains/newdomain.com/public/internal_data/
    • /home/nginx/domains/newdomain.com/public/data/
    output for
    Code (Text):
    ls -lAh /home/nginx/domains/newdomain.com/public/

    and
    Code (Text):
    getfacl -L --absolute-names /home/nginx/domains/newdomain.com/public/internal_data/
    getfacl -L --absolute-names /home/nginx/domains/newdomain.com/public/data/
    

    wrap output in CODE/CODEB tags

    where newdomain.com is your domain name
     
  7. JoeDer

    JoeDer Premium Member Premium Member

    41
    11
    8
    Feb 22, 2015
    Ratings:
    +31
    Local Time:
    7:46 PM
    Nginx 1.15.x
    MariaDB 10.3.x
    • Agree Agree x 2
  8. CarpCharacin

    CarpCharacin Member

    265
    21
    18
    Oct 13, 2016
    Salt Lake City
    Ratings:
    +34
    Local Time:
    10:46 AM
    1.15.x
    MariaDB 10.1
    Here is the output for ls -lAh /home/nginx/domains/utahfishkeepers.us/public/
    Code (Text):
    total 160K
    -rw-rw-r--  1 nginx nginx 1.6K Nov  3  2016 403.html
    -rw-rw-r--  1 nginx nginx 1.6K Nov  3  2016 404.html
    -rw-rw-r--  1 nginx nginx 2.1K Nov  3  2016 500.html
    -rw-rw-r--  1 nginx nginx 2.1K Nov  3  2016 502.html
    -rw-rw-r--  1 nginx nginx 2.2K Nov  3  2016 503.html
    -rw-rw-r--  1 nginx nginx 7.6K Nov  3  2016 503.jpg
    -rw-rw-r--  1 nginx nginx 2.1K Nov  3  2016 504.html
    -rw-rw-r--  1 nginx nginx 2.2K Nov  3  2016 50x.html
    -rw-rw-r--  1 nginx nginx 1.8K Sep 13  2018 admindav.php
    -rw-r--r--  1 root  root   302 Mar 14 03:48 admin.php
    -rw-r--r--  1 nginx nginx 1.3K May 15  2018 CHANGELOG.md
    -rw-r--r--  1 root  root   324 Mar 14 03:48 cmd.php
    -rw-r--r--  1 root  root  1.9K Mar 14 03:48 connected_account.php
    -rw-r--r--  1 root  root   813 Mar 14 03:48 css.php
    drwxrwxrwx  6 root  root  4.0K Mar 13 21:47 data
    -rw-rw-r--  1 nginx nginx 1.2K Sep 13  2018 deferred.php
    -rw-rw-r--  1 root  root  6.1K Nov  3  2016 .DS_Store
    -rw-rw-r--  1 nginx nginx  181 Nov  3  2016 error_log
    -rw-rw-r--  1 nginx nginx 1.2K Nov 28  2016 favicon.ico
    -rw-rw-r--  1 nginx nginx  541 Sep 13  2018 fb_channel.php
    -rw-rw-r--  1 nginx nginx   53 Nov  3  2016 google07808cfc19ed7a2f.html
    -rw-r--r--  1 root  root  1.2K Mar  3 11:11 .htaccess
    -rw-r--r--  1 root  root  1.2K Mar 14 03:48 htaccess.txt
    -rw-r--r--  1 root  root   377 Mar 14 03:48 index.php
    drwxr-xr-x  5 root  root  4.0K Mar 14 03:48 install
    drwxrwxrwx 12 root  root  4.0K Mar 13 21:47 internal_data
    -rw-r--r--  1 root  root  1.4K Mar 14 03:48 job.php
    drwxr-xr-x 19 root  root  4.0K Mar 14 03:48 js
    drwxr-xr-x 10 root  root  4.0K Mar 14 03:48 library
    -rw-rw-r--  1 nginx nginx 1.7K Nov  3  2016 maintenance.html
    -rw-r--r--  1 root  root   863 Mar 14 03:48 oembed.php
    -rw-r--r--  1 root  root  1.7K Mar 14 03:48 payment_callback.php
    -rw-r--r--  1 root  root   983 Mar 14 03:48 proxy.php
    -rw-rw-r--  1 nginx nginx 1.1K Sep 13  2018 rgba.php
    -rw-r--r--  1 root  root   376 Mar 14 03:48 sitemap.php
    drwxr-xr-x  6 root  root  4.0K Mar 14 03:48 src
    drwxr-xr-x 11 root  root  4.0K Mar 14 03:48 styles
    -rw-r--r--  1 root  root  1.6K Mar 14 03:48 unfurl.php
    

    getfacl -L --absolute-names /home/nginx/domains/utahfishkeepers.us/public/internal_data/
    Code (Text):
    # file: /home/nginx/domains/utahfishkeepers.us/public/internal_data/
    # owner: root
    # group: root
    user::rwx
    group::rwx
    other::rwx
    

    getfacl -L --absolute-names /home/nginx/domains/utahfishkeepers.us/public/data/
    Code (Text):
    # file: /home/nginx/domains/utahfishkeepers.us/public/data/
    # owner: root
    # group: root
    user::rwx
    group::rwx
    other::rwx
    


    I ended up doing the upgrade to 2.1.1 manually, but after that, the upload add-on via archive option stopped working.
     
  9. eva2000

    eva2000 Administrator Staff Member

    39,155
    8,647
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +13,296
    Local Time:
    2:46 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    your files are owned by root user and not nginx so you don't do chown command outlined by @JoeDer in post #7 and in getting started guide step 2 https://centminmod.com/getstarted.html - whenever you upload files via root sftp user, you need to chown and make files owned by nginx user/group
    replace newdomain.com with your domain name for path to public for chown command
     
    • Like Like x 1
  10. CarpCharacin

    CarpCharacin Member

    265
    21
    18
    Oct 13, 2016
    Salt Lake City
    Ratings:
    +34
    Local Time:
    10:46 AM
    1.15.x
    MariaDB 10.1
    So then I can run the other commands after running that one?
     
  11. eva2000

    eva2000 Administrator Staff Member

    39,155
    8,647
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +13,296
    Local Time:
    2:46 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    you can though you probably only need that chown command to make sure file/directories are owned by nginx
     
    • Like Like x 1
  12. CarpCharacin

    CarpCharacin Member

    265
    21
    18
    Oct 13, 2016
    Salt Lake City
    Ratings:
    +34
    Local Time:
    10:46 AM
    1.15.x
    MariaDB 10.1
    Awesome, I ran the one command, and the add-on archive uploader is working again!
     
    • Like Like x 2
..