Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Tue Mar 18, 2008 9:21 pm 
Offline
Junior Member

Joined: Tue Dec 04, 2007 12:51 am
Posts: 22
If the site suddenly starts reporting 500 Server Error and /home/<user>/logs/error.log looks similar to this:
Code:
[Wed Mar 19 00:31:38 2008] [warn] (104)Connection reset by peer: mod_fcgid: read data from fastcgi server error.
[Wed Mar 19 00:31:38 2008] [error] [client 1.2.3.4] Premature end of script headers: php-fcgi-wrapper

it is probable that your distribution has updated the apache2 package and replaced your /usr/lib/apache2/suexec file.

You can check by looking at the AP_DOC_ROOT it reports. It should be "/home":
Code:
$ sudo /usr/lib/apache2/suexec -V
 -D AP_DOC_ROOT="/var/www"
 -D AP_GID_MIN=100
 -D AP_HTTPD_USER="www-data"
 -D AP_LOG_EXEC="/var/log/apache2/suexec.log"
 -D AP_SAFE_PATH="/usr/local/bin:/usr/bin:/bin"
 -D AP_UID_MIN=100
 -D AP_USERDIR_SUFFIX="public_html"

Oops - wrong!

You will need to download the source code for the installed version of apache2-common and follow the first article's instructions up until you've installed the corrected version to /usr/lib/apache2/suexec.

Those instructions start with:
Code:
$ mkdir SourceCode
$ cd SourceCode
$ sudo  apt-get  build-dep apache2.2-common

_________________
TJ.
IntuitiveNipple

The only intuitive interface is the nipple; everything else is learned.


Top
   
PostPosted: Thu Apr 10, 2008 1:28 pm 
Offline

Joined: Thu Apr 10, 2008 1:21 pm
Posts: 1
Hello,

I am looking for someone to set up this configuration for me. I have a newly create linode. Right now the linode is Ubuntu 7.1, but I can change it to another distribution if necessary. I will need the VM configured to optimized to run Magento.

See here


http://www.magentocommerce.com/blog/com ... rformance/


Top
   
 Post subject:
PostPosted: Mon Jul 14, 2008 8:42 pm 
Offline
Senior Member

Joined: Fri May 02, 2008 8:44 pm
Posts: 1121
..........


Last edited by hybinet on Tue Apr 19, 2011 2:52 pm, edited 2 times in total.

Top
   
 Post subject: Happiness.
PostPosted: Tue Dec 02, 2008 2:35 pm 
Offline

Joined: Tue Dec 02, 2008 2:22 pm
Posts: 1
AOL: patg4362
Location: Sharon, NH
You're site is a great help. I'm a perl guy - I'm even the maintainer for DBD::mysql. I do like PHP though, and have been given the task lately of implementing PHP offerings at Lycos for Tripod.com users. I have been trying like mad to find a way to set open_basedir per user. We don't use UIDs/useraccounts on tripod. We have a big NFS directory, each user logged in has a directory. I want to limit what users can open with open_basedir to this directory. We're using fastcgi with a wrapper script, which works fine. I was trying to do:

exec /usr/bin/php-cgi -d open_basedir=$REDIRECT_site_root
Didn't work. It seemed to ignore -d. I would run php-cgi -d open_basedir=/path/to/user by command line and it worked, but in CGI mode, it didn't.

Then I saw on this wonderful site

open_basedir= ${HOME}/...

In the php.ini file. This made me realize I could do

open_basedir= ${REDIRECT_site_root}

Which works great!

Thanks mucho muchly!


Top
   
 Post subject:
PostPosted: Tue Feb 10, 2009 7:36 am 
Offline
Newbie

Joined: Tue Feb 10, 2009 7:24 am
Posts: 4
I'm trying to model linode on my local server before actually purchase one, but I've got some problem with setting up php-cgi mode. I have followed all how-to here, and managed to run simple php site (with phpinfo() in the code) but when I transfered my existing typo3 based site, it shows me empty-body page. "tail /var/log/apache2/error.log" shows following:
Code:
[Tue Feb 10 11:17:47 2009] [info] Server built: May  2 2008 16:35:55
[Tue Feb 10 11:17:47 2009] [debug] worker.c(1740): AcceptMutex: sysvsem (default: sysvsem)
[Tue Feb 10 11:17:47 2009] [debug] proxy_util.c(1670): proxy: grabbed scoreboard slot 0 in child 19378 for worker proxy:reverse
[Tue Feb 10 11:17:47 2009] [debug] proxy_util.c(1689): proxy: worker proxy:reverse already initialized
[Tue Feb 10 11:17:47 2009] [debug] proxy_util.c(1761): proxy: initialized worker 0 in child 19378 for (*) min=0 max=25 smax=25
[Tue Feb 10 11:17:47 2009] [debug] proxy_util.c(1670): proxy: grabbed scoreboard slot 0 in child 19407 for worker proxy:reverse
[Tue Feb 10 11:17:47 2009] [debug] proxy_util.c(1689): proxy: worker proxy:reverse already initialized
[Tue Feb 10 11:17:47 2009] [debug] proxy_util.c(1761): proxy: initialized worker 0 in child 19407 for (*) min=0 max=25 smax=25
[Tue Feb 10 11:17:52 2009] [info] mod_fcgid: server /hsphere/local/home/ywamrest/ywamrestenas.se/cgi-bin/php5-default/php-fcgi-wrapper(19437) started
[Tue Feb 10 11:17:55 2009] [info] mod_fcgid: server /hsphere/local/home/ywamrest/ywamrestenas.se/cgi-bin/php5-default/php-fcgi-wrapper(19439) started

access.log shows:
Code:
192.168.0.64 - - [10/Feb/2009:11:14:31 +0000] "GET /fileadmin/templates/ywamrestenas/scripts/functions.js HTTP/1.1" 304 - "http://ywamrestenas.base/" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.5) Gecko/2008121622 Ubuntu/8.10 (intrepid) Firefox/3.0.5"
192.168.0.64 - - [10/Feb/2009:11:14:31 +0000] "GET /typo3temp/javascript_757c080409.js HTTP/1.1" 304 - "http://ywamrestenas.base/" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.5) Gecko/2008121622 Ubuntu/8.10 (intrepid) Firefox/3.0.5"
192.168.0.64 - - [10/Feb/2009:11:17:52 +0000] "GET / HTTP/1.1" 200 720 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.5) Gecko/2008121622 Ubuntu/8.10 (intrepid) Firefox/3.0.5"
192.168.0.64 - - [10/Feb/2009:11:17:54 +0000] "GET /typo3temp/stylesheet_e99aac0be0.css HTTP/1.1" 304 - "http://ywamrestenas.base/" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.5) Gecko/2008121622 Ubuntu/8.10 (intrepid) Firefox/3.0.5"
192.168.0.64 - - [10/Feb/2009:11:17:54 +0000] "GET /fileadmin/templates/ywamrestenas/scripts/newsfader.js HTTP/1.1" 304 - "http://ywamrestenas.base/" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.5) Gecko/2008121622 Ubuntu/8.10 (intrepid) Firefox/3.0.5"
192.168.0.64 - - [10/Feb/2009:11:17:54 +0000] "GET /stylesheet.spp HTTP/1.1" 200 7607 "http://ywamrestenas.base/" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.5) Gecko/2008121622 Ubuntu/8.10 (intrepid) Firefox/3.0.5"
192.168.0.64 - - [10/Feb/2009:11:17:54 +0000] "GET /rte.spp HTTP/1.1" 200 2690 "http://ywamrestenas.base/" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.5) Gecko/2008121622 Ubuntu/8.10 (intrepid) Firefox/3.0.5"
192.168.0.64 - - [10/Feb/2009:11:17:54 +0000] "GET /objects.spp HTTP/1.1" 200 2589 "http://ywamrestenas.base/" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.5) Gecko/2008121622 Ubuntu/8.10 (intrepid) Firefox/3.0.5"
192.168.0.64 - - [10/Feb/2009:11:17:55 +0000] "GET /fileadmin/templates/ywamrestenas/scripts/functions.js HTTP/1.1" 304 - "http://ywamrestenas.base/" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.5) Gecko/2008121622 Ubuntu/8.10 (intrepid) Firefox/3.0.5"
192.168.0.64 - - [10/Feb/2009:11:17:55 +0000] "GET /typo3temp/javascript_757c080409.js HTTP/1.1" 304 - "http://ywamrestenas.base/" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.5) Gecko/2008121622 Ubuntu/8.10 (intrepid) Firefox/3.0.5"

So, it does look like everything should be all right, but the same site is working perfectly on the other server with php5-mode. What am I doing wrong here?


Top
   
 Post subject:
PostPosted: Tue Feb 24, 2009 7:09 am 
Offline
Newbie

Joined: Tue Feb 10, 2009 7:24 am
Posts: 4
anyone?


Top
   
 Post subject:
PostPosted: Tue Feb 24, 2009 8:43 am 
Offline
Senior Member
User avatar

Joined: Tue Aug 17, 2004 11:37 pm
Posts: 262
Website: http://www.our-lan.com
WLM: nf@our-lan.com
Location: Brisbane, Australia
check that you have all the modules properly enabled.

and can you paste the output of the suexec logs?

_________________
ServerAdmin - www.our-lan.com
"Diplomacy is the art of saying nice doggy whilst looking for a really big stick"
"In my experiece, any attempt to make any system idiot proof will only challenge God to make a better idiot"


Top
   
 Post subject:
PostPosted: Tue Feb 24, 2009 9:20 am 
Offline
Newbie

Joined: Tue Feb 10, 2009 7:24 am
Posts: 4
where to find suexec logs? I have passed some logs in previous post


Top
   
 Post subject:
PostPosted: Tue Feb 24, 2009 9:25 am 
Offline
Newbie

Joined: Tue Feb 10, 2009 7:24 am
Posts: 4
Ok sorry, I have found suexec.log in the same directory that error.log and access.log located but suexec.log is empty.

After a few refreshes, suexec.log shows following:
Code:
[2009-02-24 13:27:39]: uid: (1000/ywamrest) gid: (1000/1000) cmd: php-fcgi-wrapper
[2009-02-24 13:27:43]: uid: (1000/ywamrest) gid: (1000/1000) cmd: php-fcgi-wrapper


By the way, header of the page is generated, but no content or anything related to content.


Top
   
 Post subject:
PostPosted: Tue Feb 24, 2009 6:07 pm 
Offline
Junior Member

Joined: Fri Feb 25, 2005 7:34 pm
Posts: 26
Slightly offtopic, but if I were to configure apache in the way described in this thread, how would that affect the use of perl/python?

Cheers.


Top
   
 Post subject:
PostPosted: Mon Apr 13, 2009 2:41 am 
Offline
Senior Member

Joined: Wed Oct 20, 2004 8:55 am
Posts: 120
Someone appears to have acquired your tutorial
http://www.unixguru.biz/?p=40


Top
   
 Post subject:
PostPosted: Sun Jun 07, 2009 8:46 am 
Offline
Senior Member

Joined: Wed Oct 20, 2004 8:55 am
Posts: 120
I had a bit of time on the weekend and I thought I'd give hybinet's script a run on Debian Lenny.

First thing that came up was I didn't have permission to access /fcgi-bin/wrapper/test.php on the server. After a day and a bit, I found I had to change the following bit of code from this:
Code:
<Location /fcgi-bin/>
                SetHandler fcgid-script
                Options +ExecCGI
        </Location>


to this:
Code:
<Location /fcgi-bin/>
             SetHandler fcgid-script
             Options +ExecCGI
             Order allow,deny
             Allow from all
     </Location>

I don't know why it didn't work. No one else in this tread reported a problem with not having the Order and Allow. (might just be my server setup or a Lenny thing)

Next it spat errors in suexec.log. Something about terminating. Tracked that one down to the spaces in front of the wrapper text in the build script:
Code:
cat > $dirn/cgi-bin/php5-fcgi-wrapper/wrapper <<- _EOF1_
   #!/bin/sh
   export PHPRC=$dirn/conf
   export PHP_FCGI_CHILDREN=1
   export PHP_FCGI_MAX_REQUESTS=5000
   exec /usr/bin/php5-cgi
_EOF1_


Changing the script to this fixed it:
Code:
cat > $dirn/cgi-bin/php5-fcgi-wrapper/wrapper <<- _EOF1_
#!/bin/sh
export PHPRC=$dirn/conf
export PHP_FCGI_CHILDREN=1
export PHP_FCGI_MAX_REQUESTS=5000
exec /usr/bin/php5-cgi
_EOF1_


The last thing that turned up was:
Code:
/etc/init.d/apache2 reload

needed to be:
Code:
/etc/init.d/apache2 restart


Really nice script now that I have it working.
If anyone knows the answer to why I found what I did when no one else did, let me know.


Top
   
 Post subject:
PostPosted: Tue Apr 20, 2010 10:04 pm 
Offline
Junior Member

Joined: Wed Jan 27, 2010 1:48 pm
Posts: 22
Location: Las Vegas, NV
Does anyone know how to get this working with the current version on Virtualmin. Virtualmin does the custom SUEXEC stuff now but it installs apach2-mpm-prefork and libapach2-mod-php5 and if I switch to apach2-mpm-worker the browser offers php files for download. If I leave it all this gets ignored and nothing changes.


Top
   
 Post subject:
PostPosted: Tue Apr 20, 2010 11:17 pm 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
If it's offering php files to download then the handler's aren't set correctly.

You probably need

AddHandler application/x-httpd-php .php

Somewhere in your apache configuration.


Top
   
 Post subject:
PostPosted: Wed Apr 21, 2010 12:02 am 
Offline
Junior Member

Joined: Wed Jan 27, 2010 1:48 pm
Posts: 22
Location: Las Vegas, NV
Do you have any idea where it should go. I'm relatively new to this.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group