Apache2 or Imagemagick problem??
Posted: 2008-11-24T02:17:21-07:00
I am a learn-as-you-go-along programmer and a newbie to Linux and I could really use some advice. I am SO close to getting my new server running with Imagemagick. I just need pointed in the right direction.
For years I have run a Apache2 website under Windows with a lot of art. I wrote a binary cgi (placed in the cgi-bin) that builds a nice gallery out of found images and calls "convert.exe" whenever it sees that a thumbnail needs to be made. This homemade use of Imagemagick has worked like a champ for years.
However this year I've seen a huge increase in hack attempts. So I decided to switch my server over to Ubuntu. I'm in completely new waters. I've configured Ubuntu's Apache2 to run each Vhosts as their own linux user/group, chmod each folder so only there user has access, and chrooted /var/www just for good measure. I didn't want a bunch of libraries so I compiled Imagemagick as a static (convert is a 9 meg file). Apache & PHP runs as their own users and even my own binary scripts recompiled on Linux run fine from the cgi-bin.
I can run this "convert" from the command line fine. However, if my binary script from Apache2 cgi-bin tries to call convert (within the chroot) I get a Doserror: 8 back from convert which I assume means apache2 is not giving convert enough memory?? Or could this be a compile error with some library missing due to chroot?
To get this far I've been reading for months but I'm stumped ATM. Is there a way to tell Apache2 to give Imagemagick more memory via being run from "cgi-bin"(it didn't seem to be an issue under win32 Apache2)? Or is there a way to tell if I need to add a missing library inside the chroot?
Thanks for any help/advice! I really need some right now.
WS
For years I have run a Apache2 website under Windows with a lot of art. I wrote a binary cgi (placed in the cgi-bin) that builds a nice gallery out of found images and calls "convert.exe" whenever it sees that a thumbnail needs to be made. This homemade use of Imagemagick has worked like a champ for years.
However this year I've seen a huge increase in hack attempts. So I decided to switch my server over to Ubuntu. I'm in completely new waters. I've configured Ubuntu's Apache2 to run each Vhosts as their own linux user/group, chmod each folder so only there user has access, and chrooted /var/www just for good measure. I didn't want a bunch of libraries so I compiled Imagemagick as a static (convert is a 9 meg file). Apache & PHP runs as their own users and even my own binary scripts recompiled on Linux run fine from the cgi-bin.
I can run this "convert" from the command line fine. However, if my binary script from Apache2 cgi-bin tries to call convert (within the chroot) I get a Doserror: 8 back from convert which I assume means apache2 is not giving convert enough memory?? Or could this be a compile error with some library missing due to chroot?
To get this far I've been reading for months but I'm stumped ATM. Is there a way to tell Apache2 to give Imagemagick more memory via being run from "cgi-bin"(it didn't seem to be an issue under win32 Apache2)? Or is there a way to tell if I need to add a missing library inside the chroot?
Thanks for any help/advice! I really need some right now.
WS