My ISP is closing down one server, and requiring that we move to another server ourselves.
The old server, for strange, arcane and of course unsafe reasons, had apache running as root. On the new server this is not the case. Apache is no longer running as root.
On the new server I am now unable to perform backups using a php script (moodle) of large files (100MB).
The part that hangs is using
1) zip (The path to zip, usr/bin/zip, is set correctly).
2) I think that it is using "cd" to move the zipped files between a temporary and destination directory.
The process is hanging, failing to finish, saying the files could not be moved (but it could be that the zip is failing).
Something about the user privelidge that my php is using on the new system is hanging due to file size.
I know that php settings include a limit on uploadable file size but that is not the problem. I know that the upload file limit is set to 200MB and anyway, I have uploadep by ftp to a directory where php can access the file.
The permissions of the desitination director are set to 777. I have chmodded -R 0777 all the files and directories. And anyway, I can perform backups and zips on smaller files.
So it is something to do with the privelidges relating to max file size, of my user/process.
The apache/php script is attempting to use zip, and shell commands (cd?) (via suexec?) to handle files, but failing when the files are too large.
I have asked at moodle, particularly here:
but I don't think that this is a moodle problem, rather some linux, zip or conceivably php setting.
Is there some way of stipulating in Linux the size of file that:
a user can zip?
a user can manipulate using php/apache called shell commands (cd? perhaps via suexec or whatever php or apache command allows a user to call shell commands)?
If there are such setting, I would be very grateful if you Linux folks could let me know.
My Research Here!
After writing this post, and hitting the "click to find similar threads" button I come accross
which mentions "ulimit"!
core file size (blocks, -c) 0
data seg size (kbytes, -d) unlimited
file size (blocks, -f) unlimited
max locked memory (kbytes, -l) 4
max memory size (kbytes, -m) unlimited
open files (-n) 1024
pipe size (512 bytes, -p) 8
stack size (kbytes, -s) 10240
cpu time (seconds, -t) unlimited
max user processes (-u) 7168
virtual memory (kbytes, -v) unlimited
I am not sure what this means, exactly, or which of these might limit the size of file that my user can zip or move (cd). But this looks good. I guess that I have been "ulimit"-ed. Is that it?
Which of the above should I ask my SYSop to change? The "stack size" and "pipe size" and "open file size" all look promising. Where are they set? via shell commands?
Future Research Possibilities
To be honest (sotto voice), I can run phpshell (I upload it then immediately delete it for the occasional chmod, which I can't do over ftp). What would be the command to find out the "ulimit" limits placed on users? If I use phpshell and do a "ulimit -a" will that tell me what limits are placed on my user?! Sounds promising.
Ps I have used some jargon, like "suexec" and "ulimit" in the above, but I assure you that I don't really know what I am talking about, because I am a newbie when it comes to Linux.