Directorys are not writable.
- Edited
@Dominion @Toby I tried with the Beta 2 and I still get an error. See attached screenshot:
The commands I ran were:
chmod 0755 /var/www/sub.domain.com
chmod -R 0755 /var/www/sub.domain.com/assets
chmod -R 0755 /var/www/sub.domain.com/extensions
chmod -R 0755 /var/www/sub.domain.com/flarum/storage
They all returned successful. Any ideas?
- Edited
BlameDylan who owns the files? If it's not writeable by the webserver, then it's not writeable.
0755 isn't a arbitary number. It means (in order)
- No special bit
- Owner of files may read, write, execute
- Group of files may read and execute
- Everyone else may read and execute
If you have the group of the files be the webserver and change permissions to 0775 or change the owner of the files to the webserver, either should fix that.
Kulga
It is owned by nginx, the Nginx web-server user defined in the nginx.conf
file.
- Edited
can you switch to that user? Something like
sudo su nginx
and run something like
touch /var/www/sub.domain.com/extensions/foo
and see if it succeeds or fails?
Edit: @luceos is correct. nginx isn't the user here. Not to mention this is a php issue and nginx doesn't actually deal with that..
The user accessing the file is not nginx, but the php cgi client, this might be php-fpm. And normally the user is called www-data or www-run or something like that. Just check the php configuration.
Nginx is simply a proxy to php.
- Edited
luceos excerpt from my www.conf:
listen.owner = nginx
listen.group = nginx
listen.mode = 0776
; Unix user/group of processes
; Note: The user is mandatory. If the group is not set, the default user's group
; will be used.
; RPM: apache Choosed to be able to access some dir as httpd
user = nginx
; RPM: Keep a group allowed to write in log dir.
group = nginx
And my nginx.conf:
user nginx;
This account is currently not available.
BlameDylan Read luceos's post more carefully.
The user accessing the file is not nginx, but the php cgi client, this might be php-fpm. And normally the user is called www-data or www-run or something like that. Just check the php configuration.
You just posted your nginx config, which is exactly what luceos just said is irrelevant
- Edited
Toby Ah.. but that looks like a fpm pool file -> probably from /etc/php5/fpm/pool.d/www.conf
So the nginx user is indeed well.. nginx.
Personally, I would create a new pool and make the owner / group to whatever user you want owning the files. I circumvent a lot of permission stuff it seems that way. (Modifyed slightly for nginx webserver user.)
Here's a pool I have for my demo install of flarum where the very limited user demoflarum sends its php requests.
[demoflarum]
user = demoflarum
group = demoflarum
listen = /var/run/php5-fpm.$pool.sock
process.priority = -5
listen.owner = nginx
listen.group = nginx
pm = ondemand
pm.max_children = 1
pm.max_requests = 2000
pm.process_idle_timeout = 20s
chdir = /
Nginx related config
fastcgi_pass unix:/var/run/php5-fpm.demoflarum.sock;
- Edited
Kulga Ah.. but that looks like a fpm pool file -> probably from /etc/php5/fpm/pool.d/www.conf
So the nginx user is indeed well.. nginx.
Oops! Sorry @BlameDylan! I should leave server support to the professionals
- Edited
Toby Kulga Okay I created a user flarum
, created a pool with the syntax above (however demoflarum => flarum), then I edited my nginx.conf
, restarted php-fpm
and nginx
, chowned
my files to flarum
, same error. If you all want to come on my server and take a look, add me on skype dylan_3304
. Thanks for all your support thus far and I see some light at the end of the tunnel!
- Edited
BlameDylan Ok. I'm impressed you managed to handle the instructions properly (including reloading everything lol)
Just so we know where we are -
If you can (all within the flarum user)
- purge the relevant database (you separate all databases into users - right?)
- clear all files in the install directory
- re-extract the flarum.zip to the directory
- run install process
I'd be interested in seeing what's up but I don't anything along the lines of skype.. you can email me at njybarrtfpwpedb@ObjectMail.com though
- Edited
Kulga
1. I don't understand.
2. I switched to the flarum user su flarum
and completed all tasks.
3. I downloaded the .zip
via wget
and extracted it.
4. I visited my domain and got the same error, did the chmods
and same problem.
Edit: check your email.
- Edited
BlameDylan Like I said before, the offer still stands if it would be easier for you to come on my server and check things out.
Sure - email me whatever info you need (keys or whatever)
1. I don't understand.
That's a critical one. Otherwise 4 is guaranteed to fail (since it's already populated). Um... Drop everything in the database? This is partially why I said have databases split into users, if you accidentally drop EVERYHING, only what you have access to is destroyed. You can follow something like this
Edit: Ok I will.
Kulga Oh well I never did get to the part about initalizing the database. It makes much more since because I didn't know you were talking about MySQL! Haha, we will talk via email.
- Edited
luceos Ah yes, I was going to comment.
This is a strange one. There are no php issues since the install came up about the non-writeable directories - that was fine (I also went through each config ensuring they were correct.)
The strange part is the permissions were 100% fine and yet reported they were unwritable.
Not only does the owner of the files (flarum) have its own php process (which should of been enough by itself) but the nginx user (nginx) and flarum were both put into a group named webserver. Then all files were chowned (recursively) to flarum:webserver. and given permissions of 775 - which I confirmed by both owner:group and octal permissions, as well as checking more top-level directories (/var and /var/www)
The next logical step would be to simply su to each user that might be trying to access the directory and run touch /dir/foo and seeing if it succeeds. I would also ensure no caching is in effect..
I only had a short time and was a guest to the server, so I (very understandably) couldn't do much more then review and make suggestions. I've never had a permissions problem I couldn't solve so this is frustrating to say I don't know why it's not working..
It was also running CentOS.. I might start a discussion on what OS people are installing this on - cause I've noticed people having issues with CentOS here before..
Did you see anything that suggested suphp was being used? Or some other container system like cloudlinux?