Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 9th September 2012, 19:01
centurianii centurianii is offline
Junior Member
 
Join Date: Mar 2009
Posts: 13
Thanks: 1
Thanked 0 Times in 0 Posts
 
Default apache & suexec & mod_fcgid & mod_userdir

After following Falco's tutorial I managed to have working virtual hosts one per file.
Now, I want to access a user's home from the following url: http://www.example.com/~john/info.php with the help of mod_userdir.
Is this possible with suexec?

Let's see how john is configured at: /etc/apache2/sites-available/
Code:
#default virtual host
<VirtualHost *:80>
  ServerName www.john.example.com
  ServerAlias john.example.com
  ServerAdmin webmaster@john.example.com
  DocumentRoot /var/www/john/web/
  SuexecUserGroup john john
  <Directory /var/www/john/web/>
    Options +ExecCGI
    Options -Indexes
    AllowOverride All
    AddHandler fcgid-script .php
    #FCGIWrapper /var/www/php-fcgi-scripts/john/php-fcgi-starter .php
    FcgidWrapper /var/www/php-fcgi-scripts/john/php-fcgi-starter .php
    Order allow,deny
    Allow from all
  </Directory>

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

</VirtualHost>
As you can see directive
Code:
SuexecUserGroup john john
is indeed a problem but as Apache states (http://httpd.apache.org/docs/2.2/suexec.html#usage):
"Requests that are processed by mod_userdir will call the suEXEC wrapper to execute CGI programs under the userid of the requested user directory."

I tried to modify file john (after enabling mod_userdir) to work for any user as follows:
Code:
<VirtualHost *:80>
  ServerAlias *.example.com
  ServerAdmin webmaster@example.com

  ##################
  ### solution ###
  ##################
  #mod_userdir directives for requests: http://www.example.com/~user
  UserDir disabled root
  UserDir /var/www/*/web

  #reduntant if using requests: http://www.example.com/~user
  #SuexecUserGroup john john
  <Directory /var/www/*/web/>
    Options +ExecCGI
    Options -Indexes
    AllowOverride All
    AddHandler fcgid-script .php
    #move to .htaccess
    #FCGIWrapper /var/www/php-fcgi-scripts/*/php-fcgi-starter .php
    #FcgidWrapper /var/www/php-fcgi-scripts/*/php-fcgi-starter .php
    Order allow,deny
    Allow from all
  </Directory>

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

</VirtualHost>
As you can see I also created a .htaccess file with the directive:
Code:
FcgidWrapper /var/www/php-fcgi-scripts/john/php-fcgi-starter .php
(there is no meaning to keep * now in the path for wrapper script) but the result is for Apache to send the .php file info.php for download with no error logs!?

Any idea how to achive this?
Thanks.
Reply With Quote
Sponsored Links
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
sessions not being saved gavimobile General 6 15th January 2012 16:05
mpm-itk + suexec + php-cgi grungy Installation/Configuration 2 25th March 2010 23:17
/home ad symlink after rsync run DreamK General 4 8th March 2010 13:44
trying to install roundcubemail ressel Installation/Configuration 13 24th December 2009 21:13
CENTOS 5 Ping Problem gAnDo Server Operation 11 28th March 2008 21:58


All times are GMT +2. The time now is 16:18.


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