Hello everybody,
I've googled all night long to find someone having the same problem...
Found 1 topic here on the mailing list, but not resolved, so I'm asking for your help !

My problem is here :
I have an Apache server, with several hosts, each user having their files in their home directory. I want the users to see their home as the root directory, when using fopen or opendir functions from PHP. I first changed the base directory in mod_php5 settings (with php_admin_value open_basedir), so they can't open files or list directories outside of their home.
That's a good start, but I want that users even not SEE those directories...

So I tried mod_suphp, with the chroot option enabled, but when trying to execute PHP scripts (even a simple echo), it shows me an Internal Server Error.
In /var/log/apache2/error.log is written :
Caused by SystemException in API_Linux.cpp:465: chdir() failed : No such file or directory

To have more informations, I modified the source code and recompiled suPHP, to show the chdir argument. The result was : Caused by SystemException in API_Linux.cpp:465: chdir(/home/deder6) has failed!! : No such file or directory

In my suphp.conf, I have :
webserver_user=www-data
docroot=/home/deder6
chroot=/home/deder6

I did chown -R deder6:deder6 /home/deder6 to fix permissions
I checked that Apache is running under www-data user
/home/deder6 exists, of course
I really don't know what is going on, I should have missed something...
If I remove the chroot option, everything is working fine (except users are not chrooted of course lol) !

As I said I found a topic on this mailinglist. They had a patch to apply on the source code, to recompile suPHP. The patch fixed the error, I just needed to copy php-cgi binary and useful libraries to /home/deder6, and the chroot worked! But it gave an other error "No input files specified.", showing in the browser page.

So I don't know if you have an idea of what I could do, or if there is an other way to chroot web users in their home directories, please let me know.
Thank you very much !
Arnaud.


_______________________________________________
suPHP mailing list
[email protected]
https://lists.marsching.com/mailman/listinfo/suphp

Reply via email to