LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 01-15-2010, 08:36 PM   #1
dhrumantgoradia
Member
 
Registered: Nov 2004
Distribution: CentOS & Ubuntu
Posts: 30

Rep: Reputation: Disabled
install php as cgi


I need to install php as cgi like in the first picture under ubuntu, but i've tried many different things to no avail.

I have system 1 (pic 1) which is working perfectly and need to configure system 2 (pic 2) to be exactly the same.

The system configurations are attached as images.
Attached Thumbnails
Click image for larger version

Name:	system1.png
Views:	23
Size:	27.6 KB
ID:	2495   Click image for larger version

Name:	system2.png
Views:	20
Size:	31.7 KB
ID:	2496  
 
Old 01-17-2010, 11:16 AM   #2
janoszen
Member
 
Registered: Oct 2009
Location: Budapest
Distribution: Mostly Gentoo, sometimes Debian/(K)Ubuntu
Posts: 143

Rep: Reputation: 22
CGI

I'm guessing, you wish to use FastCGI. First, you need to select your FCGI handler. Either mod_fastcgi or mod_fcgid. Then, create a wrapper script for the php-cgi process to set some nice parameters like the php.ini location. If you want to use suexec, you need to let the user own the wrapper script you want it to run as. You should see the Apache suexec documentation for this. Next, configure your webserver to use the FastCGI version for PHP. Depending on which module you chose, this might look different.
 
Old 01-18-2010, 02:11 AM   #3
dhrumantgoradia
Member
 
Registered: Nov 2004
Distribution: CentOS & Ubuntu
Posts: 30

Original Poster
Rep: Reputation: Disabled
Yes I think this is what I want, and suexec as well as I need users to be able to run under their users.
Thing is however, I have no idea how to do this.

Fcgid is already enabled via a2enmod fcgid.

But don't know how to do the rest.
 
Old 01-18-2010, 03:03 AM   #4
janoszen
Member
 
Registered: Oct 2009
Location: Budapest
Distribution: Mostly Gentoo, sometimes Debian/(K)Ubuntu
Posts: 143

Rep: Reputation: 22
Well, you're going to have to read the docs. There are plenty of tutorials out there, just google for "mod_fcgid tutorial" and find sites like this one.
 
Old 01-19-2010, 03:28 PM   #5
dhrumantgoradia
Member
 
Registered: Nov 2004
Distribution: CentOS & Ubuntu
Posts: 30

Original Poster
Rep: Reputation: Disabled
Ok i followed this tutorial.

I followed most of it exactly but my document roots are in /home/[username]/public_html

Everything worked fine until i try to go to phpmyadmin via domain.com/phpmyadmin, which then shows whats in pic1.png. If i do domain.com/phpmyadmin/index.php it works fine.

the vhosts file looks like so:

<VirtualHost 192.168.0.60:80>
ServerName domain.com
ServerAlias www.domain.com
ServerAdmin admin@domain.com
DocumentRoot /home/adhocrac/public_html/

<IfModule mod_fcgid.c>
SuexecUserGroup adhocrac adhocrac
PHP_Fix_Pathinfo_Enable 1
<Directory /home/adhocrac/public_html/>
Options +ExecCGI
AllowOverride All
AddHandler fcgid-script .php
FCGIWrapper /var/www/fcgi/adhocrac/fcgi-starter .php
Order allow,deny
Allow from all
</Directory>
</IfModule>

# ErrorLog /var/log/apache2/error.log
# CustomLog /var/log/apache2/access.log combined
ServerSignature Off

Alias /explorer /home/adhocrac/explorer
<IfModule mod_fcgid.c>
SuexecUserGroup adhocrac adhocrac
PHP_Fix_Pathinfo_Enable 1
<Directory /home/adhocrac/explorer>
Options +ExecCGI
AllowOverride All
AddHandler fcgid-script .php
FCGIWrapper /var/www/fcgi/adhocrac/fcgi-starter .php
Order allow,deny
Allow from all
</Directory>
</IfModule>
</VirtualHost>

The hostname of the server is host.foo.com and if i go to host.foo.com/phpmyadmin, it works fine. The vhosts file for host.foo.com looks like:

<VirtualHost 192.168.0.60:80>
ServerName host.foo.com
ServerAdmin admin@foo.com
DocumentRoot /home/rackelas/public_html/

<IfModule mod_fcgid.c>
SuexecUserGroup rackelas rackelas
PHP_Fix_Pathinfo_Enable 1
<Directory /home/rackelas/public_html/>
Options +ExecCGI
AllowOverride All
AddHandler fcgid-script .php
FCGIWrapper /var/www/fcgi/rackelas/fcgi-starter .php
Order allow,deny
Allow from all
</Directory>
</IfModule>

# ErrorLog /var/log/apache2/error.log
# CustomLog /var/log/apache2/access.log combined
ServerSignature Off

</VirtualHost>

I can't figure out why this is happening, any help is appreciated.
 
Old 01-19-2010, 05:13 PM   #6
dhrumantgoradia
Member
 
Registered: Nov 2004
Distribution: CentOS & Ubuntu
Posts: 30

Original Poster
Rep: Reputation: Disabled
SOLVED, i restarted the server and now it works.
 
  


Reply

Tags
cgi, php, suexec, ubuntu



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: How to Install Apache2 webserver with PHP,CGI and Perl Support in Ubuntu Server LXer Syndicated Linux News 0 10-17-2008 06:10 PM
php apache or php cgi - php learner rblampain Linux - Security 3 12-17-2004 11:10 PM
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 - Distributions > Ubuntu

All times are GMT -5. The time now is 07:19 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