Recovering from deletion of web files

I have a database that I had set up and until a few days ago, was running fine with Vanilla 2.6.1. I lost all of the web files and I need to reinstall them, but I want to keep the existing database. I tried installing Vanilla 2.6.3 via the normal install-from-scratch method but using the same database, and I could see the categories, topics and posts (minus images)... mostly okay... but things are somewhat messed up. The Colors plugin theme switching no longer works, the mobile Colors theme are ALL selected simultaneously on the Mobile Themes page, the branding icons were missing, post images are gone, user account images are gone, etc. I get a weird error box when I try to fix the user account images but even though it seems like it failed, it actually worked (but this weird error box comes up every time I try to change the user account image).

Am I out of luck? Should I try a different way to resolve this?

Comments

  • Okay... I ran through the same process again. I think the problem was, the Colors theme files weren't writable by the Apache user.

    Can someone direct me to a doc that describes what the file permissions should be for the Vanilla install directories and files?

  • The saga continues. Now when I try to enable the Advanced Editor (or ANY plugin), the switch fails to flip, and a black error box pops up on the lower left. I have no idea what it means...

  • And it seems like another permissions problem. I've chown'd the whole mess to the Apache user. Not sure why it needs to have write access to so much.

  • R_JR_J Cheerleader & Troubleshooter Munich Moderator

    @eddieray7 said:
    Okay... I ran through the same process again. I think the problem was, the Colors theme files weren't writable by the Apache user.

    Can someone direct me to a doc that describes what the file permissions should be for the Vanilla install directories and files?

    All files must be readable by the web user (no surprise)
    /cache must be writable by the web user
    /uploads must be writable by the web user
    /conf/config.php must be writable by the web user

    This is a short script I run in a new Vanilla installation to get things like I want them to be:

    find ./ -type d -exec chmod 755 {} +
    find ./ -type f -exec chmod 644 {} +
    chmod -R 775 cache/
    chmod -R 775 uploads
    chmod 775 conf/config.php
    chown -R root:root ./
    chown -R www-data:www-data cache/
    chown -R www-data:www-data uploads/
    chown www-data:www-data conf/
    chown www-data:www-data conf/config.php
    


  • Thanks!

    It seems the theme directory and sub-directories may in some cases need to be writable or things get screwy there too (as mentioned in my first fix).

  • R_JR_J Cheerleader & Troubleshooter Munich Moderator

    If a theme folder needs write permission it is written poorly: configuration/settings should go to /conf/config.php (saveToConfig()) or directly to the database ('Gdn::set()`) and "new"/custom files should be written to /uploads (there is the Gdn_Upload class for handling that)

    But to be fair: looking at that theme I can see a lot of rubbish (sorry to be so harsh, but WTF should that "click.js" be good for?), but nothing which would require write permissions.


  • Yeah... the Colors theme is kinda ugly internally... but it makes the forums look like I want (mostly) and works on both a PC and mobile browser in a reasonable way and my users can see the features they need to see (we are coming from PHPBB2).

  • But to be fair: looking at that theme I can see a lot of rubbish (sorry to be so harsh, but WTF should that "click.js" be good for?), but nothing which would require write permissions.

    Maybe it was something with the conf folder that also affected Colors when it was enabled and I still had permissions issues. The thing I did to make it work was making all of the Colors directories and files writable by the Apache user tho'.

Sign In or Register to comment.