CentOS 7: Flarum Directorys are not writable SOLVED

  Flarum

Saw a cool looking forum software, Flarum and fancied giving it a try! It certainly was “trying” but I got it working, here’s how.

1) Create a new Server Block in your Nginx config
2) Follow instruction here Easy.

Oh, you didn’t get “Install Flarum”.” did you, you got a bunch of requirements like GD, DOM then installed them and felt all excited and went back again and STILL it didn’t say “Install Flarum” it said “Directorys are not writable” you tried to chmod all them finds and it still didn’t help. It’s ok I feel you pain. It’s ok though, it’s easy to fix, even a grumpy sod like me can do it easily enough.

4) It’s nothing to do with file permissions, it’s that SELINUX baddie, don’t disable him though, he’s ok once you get to know him. Just run this:

semanage fcontext -a -t httpd_sys_rw_content_t '/path/to/you/www/example.com(/.*)?'
restorecon -R /path/to/you/www/example.com

Before:
ls -Z index.php
-rw-r--r--. user group unconfined_u:object_r:httpd_sys_content_t:s0 index.php

After:
-rw-r--r--. user group unconfined_u:object_r:httpd_sys_rw_content_t:s0 index.php

Cool, you got rw now.

5) Fix them permissions you broke earlier when trying to fix it, by running these slutty commands:

find /path/to/you/www/example.com -type d -exec chmod 0755 {} ;
find /path/to/you/www/example.com -type f -exec chmod 0755 {} ;

6) Create your database and user

7) Go back and NOW…. Enter your details and click “Install Flarum”. Boom!