LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-15-2003, 03:35 PM   #1
Agento-
LQ Newbie
 
Registered: Jan 2003
Location: Montana
Distribution: Redhat 7.3
Posts: 10

Rep: Reputation: 0
Running CGI version of PHP


I have a chrooted web hosting solution setup. I am trying to run php as a cgi instead of an apache module so it runs suexec as the chrooted user that owns the domain. So they have control of their own php.ini and uploaded files are owned by the correct user. I am having problems with this however.

I added a "Action" for the .php, .php3... file types and added in User and Group entries for the virtual host but when it tries to load up the file.. it calls up the default document root and then appends on the location of the action. like /var/www/html/usr/bin/php or something. Any one have any experience in setting this sort of thing up?

Thanks in advance
 
Old 02-15-2003, 03:54 PM   #2
markus1982
Senior Member
 
Registered: Aug 2002
Location: Stuttgart (Germany)
Distribution: Debian/GNU Linux
Posts: 1,467

Rep: Reputation: 46
Well, one question aside, how do you manage to get functions like MAIL to work properly ?

Regarding your question you could set some kind of variables on a per virtual host bases like:
Quote:
...
<Location />
php_admin_value doc_root "/server/http/htdocs/virtual_hosts/XYZ/"
php_admin_value open_basedir "/server/http/htdocs/virtual_hosts/XYZ/:/server/http/binary/lib/php/"
php_admin_value phpa on
</Location>
...
 
Old 02-15-2003, 08:47 PM   #3
Agento-
LQ Newbie
 
Registered: Jan 2003
Location: Montana
Distribution: Redhat 7.3
Posts: 10

Original Poster
Rep: Reputation: 0
I havent gotten to that point yet. Why couldn't you get mail working. Wouldn't you just have to give the user access to sendmail? I'm just worried about getting apache parsing php through cgi... and running the script as the owner of the site. Do you know how to get that running?
 
Old 02-16-2003, 02:50 AM   #4
markus1982
Senior Member
 
Registered: Aug 2002
Location: Stuttgart (Germany)
Distribution: Debian/GNU Linux
Posts: 1,467

Rep: Reputation: 46
I'm running PHP as module and using the documentroot, etc restrictions which are nice. Also I have the directory set up pretty strict ...

About getting mail working, when you chroot apache there will not be a sendmail in your chroot ... I think the best solution would be PHP supporting mail servers (IP, SMTP authentification) rather than just that sendmail function ... I think this is an important feature missing!
 
Old 02-18-2003, 06:39 PM   #5
Agento-
LQ Newbie
 
Registered: Jan 2003
Location: Montana
Distribution: Redhat 7.3
Posts: 10

Original Poster
Rep: Reputation: 0
Well i have a complete chroot enviroment for the user. Not just a chrooted apache. So the sendmail binary can be accessable by php in a chrooted session. I'm just looking for instructions on how to get php running as a cgi so i can have it run php scripts as a different user.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
php apache or php cgi - php learner rblampain Linux - Security 3 12-17-2004 11:10 PM
php running as CGI twk Programming 1 05-25-2004 08:26 AM
php as cgi nakkaya Linux - Software 3 03-18-2003 02:42 AM
php cgi jayakrishnan Linux - General 1 11-27-2002 09:43 AM
PHP/CGI help ugenn Programming 2 08-23-2002 02:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration