#1  
Old 13th September 2006, 15:42
qtam0 qtam0 is offline
Junior Member
 
Join Date: Sep 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Post SuExec compiling

Hello,

I have a homeserver, which has apache 2.0.54 as webserver. I've installed fastcgi and compiled php5 to run as FastCGI.

I've tried to get fastcgi use suexec wrapper mechanism. It does work, but only on my primary web-address (www.example.com).
My vhosts are set so that /www/example.com is docroot for the primary address, and /www/vhost1.example.com is for vhost1 /www/vhost2.example.com for vhost2 etc.

Because I want FastCGI to use suexec, I used this howto: http://www.howtoforge.com/forums/showthread.php?t=4606
and complied php and suexec (I didn't edit suexec.c, because I want suexec to check file owner).

But there's a problem on suexec compile, when I do "./suexec -V" after "make suexec" it says:

Quote:
-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"
even if I modified suexec.h like:

#define AP_DOC_ROOT DEFAULT_EXP_HTDOCSDIR
replaced with
#define AP_DOC_ROOT "/www"

before "make suexec". I even tried to edit ap_config_layout.h so that #define DEFAULT_EXP_HTDOCSDIR "/www"
#define DEFAULT_EXP_HTDOCSDIR "/www"
but it didn't help. After make it still says "-D AP_DOC_ROOT="/var/www""

The reason why my primary domain works is (or I think it is...) that I have symlinked /var/www to /www/example.com like this:
Quote:
server:/var# ls -l www
lrwxrwxrwx 1 root root 17 2006-09-09 22:26 www -> /www/example.com
Does anyone know why settings from suexec.h won't apply?

ps. sorry about my bad english, I tried to make it understandable

Last edited by qtam0; 13th September 2006 at 15:45.
Reply With Quote
Sponsored Links
  #2  
Old 14th September 2006, 20:05
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,722 Times in 2,563 Posts
Default

Quote:
Originally Posted by qtam0
The reason why my primary domain works is (or I think it is...) that I have symlinked /var/www to /www/example.com like this:
suExec doesn't accept symlinks for security reasons.
Usually you'd specify the suExec docroot when you compile Apache (in the Apache configure statement).
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 14th September 2006, 22:52
qtam0 qtam0 is offline
Junior Member
 
Join Date: Sep 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by falko
suExec doesn't accept symlinks for security reasons.
Well I in fact solved the problem by making /var/www symlink to /www and now SuExec works fine... (not the finest way, I know.)

I didn't want to compile apache, as I have installed it by the-easy-way, apt-get

Now there is only one problem, php scripts work only on my userdir (public_html), and on other users it says "No input file specified.". So now set so apache's mod php will handle .php files (works fine on everywhere), but if I use .htaccess file like this to get php use FastCGI-SuExeced-php (what a word..):

Quote:
RemoveHandler .php
AddType application/fastcgi-php php
Action application/fastcgi-php "/php5.fcgi"
This works on public_html, I don't know the right path for vhosts (as "/www/vhost1.example.com/php5.fcgi" and "/php5.fcgi" didn't work) so this doesn't work on vhosts...
Reply With Quote
  #4  
Old 15th September 2006, 19:57
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,722 Times in 2,563 Posts
Default

What's the output of
Code:
updatedb
locate php5.fcgi
?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #5  
Old 19th September 2006, 20:39
qtam0 qtam0 is offline
Junior Member
 
Join Date: Sep 2006
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Code:
server:/www# updatedb
server:/www# locate php5.fcgi
/home/me/public_html/php5.fcgi (works fine...)
/home/user/public_html/php5.fcgi (if handler php5.fcgi is in use, "No input file specified." message appears)
/www/www.example.com/php5.fcgi (uses Apache 2.0 Handler, changing handler to php5.fcgi in .htaccess doesn't effect)
/www/vhost1.example.com/php5.fcgi (uses Apache 2.0 Handler, changing handler to php5.fcgi in .htaccess doesn't effect)
server:/www#
.htaccess in all directories listed above is
Code:
RemoveHandler .php
AddType application/fastcgi-php php
Action application/fastcgi-php "/php5.fcgi"
and all directories listed above include the php5.fcgi file..
Code:
#!/bin/sh
PHP_FCGI_CHILDREN=4
export PHP_FCGI_CHILDREN
PHP_FCGI_MAX_REQUESTS=5000
export PHP_FCGI_MAX_REQUESTS
exec /usr/bin/php

Last edited by qtam0; 19th September 2006 at 20:42.
Reply With Quote
  #6  
Old 20th September 2006, 18:11
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,722 Times in 2,563 Posts
Default

Quote:
Originally Posted by qtam0
Code:
/www/www.example.com/php5.fcgi (uses Apache 2.0 Handler, changing handler to php5.fcgi in .htaccess doesn't effect)
/www/vhost1.example.com/php5.fcgi (uses Apache 2.0 Handler, changing handler to php5.fcgi in .htaccess doesn't effect)
server:/www#
Are /www/www.example.com and /www/vhost1.example.com the document root of your web sites?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Should I user suexec or not? kanour Installation/Configuration 2 11th June 2006 08:51
Suexec Problems mphayesuk General 21 8th May 2006 22:05
Tools required for compiling sources cchamb2 General 1 9th March 2006 21:30
suExec? lerra Installation/Configuration 1 8th February 2006 16:40
SuExec linutzy Server Operation 1 16th August 2005 23:09


All times are GMT +2. The time now is 04:08.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.