Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have disabled mod_php on a RHEL6 apache server and installed mod_fcgid. PHP test scripts (info.php) work on the localhost. I know this since info.php returns the apache api as Server API=CGI/FastCGI. However via the public IP assigned to the server a browser pointed to IP/~user/info.php or IP/~user/joomla/info.php returns the source code in plain text. HTML pages in place of info.php for either URL works.

/home/public_html/user/joomla

The /etc/hosts looks like this (public IP not shown)

xxx.xx.xxx.xxx user.dept.university.edu

127.0.0.1 joomla.dept.univeristy.edu

So why does mod_fcgid work on the localhost but not through the public IP?

This is an excerpt from httpd.conf (actual domains not used).

<VirtualHost *:80>
  ServerName user.dept.university.edu
  ServerAlias user
  DocumentRoot /var/www/html
</VirtualHost>

<VirtualHost *:80>
  ServerName joomla.dept.university.edu
  ServerAlias joomla
  DocumentRoot /home/user/public_html
  <IfModule mod_fcgid.c>
    SuexecUserGroup user user
      <Directory /home/user/public_html>
         Options +ExecCGI
         DirectoryIndex index.php index.html
         AllowOverride All
         AddHandler fcgid-script .php
         FcgiWrapper /var/www/php-fcgi-scripts/mpnl/php-fcgi-starter .php
         Order allow,deny
         Allow from all
     </Directory>
  </IfModule>
</VirtualHost>
share|improve this question
    
When you do a request for user.dept.university.edu it will get served by the first virtualhost, where you have not configured fcgi. So the server is behaving exactly as you have told it too. –  Krist van Besien Mar 28 '13 at 6:00
    
Ok, got it. As an temporary fix, I commented out the first vhost block. Now, if I access via the public IP IP/~user/joomla or IP/~user/joomla/info.php I get this entry in suexec.log [2013-03-28 10:09:18]: command not in docroot (/var/www/php-fcgi-scripts/user/php-fcgi-starter) –  Kirk Woellert Mar 28 '13 at 14:13
    
I don't get it. I thought the whole point of fcgid and suxec was to able to serve content from ~/public_html user directories, under the user:user account. For others benefit I relied on this tutorial: howtoforge.com/… –  Kirk Woellert Mar 28 '13 at 14:21
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.