[CentOS 5.6 x86_64] mod_fcgid problem with Apache2 virtualhosts

Discussion in 'Installation/Configuration' started by jambek2003, Jun 2, 2011.

  1. jambek2003

    jambek2003 New Member

    [CentOS 5.6 x86_64][solved] mod_fcgid problem with Apache2 virtualhosts

    I followed the how-to How To Set Up Apache2 With mod_fcgid And PHP5 On CentOS 5.2 And I double checked everything but I can't get virtualhosts working with mod_fcgid:confused:

    This is a example of testing. conf virtualhost located in /etc/httpd/conf.d/;
    Code:
    <VirtualHost *:80>
      	ServerName 	testing.example.com
      	ServerAdmin 	webmaster@localhost
      	ErrorLog 	/var/log/httpd/testing.example.com/error_log
      	TransferLog 	/var/log/httpd/testing.example.com/access_log
      	DocumentRoot 	/var/www/testing.example.com/public_html/
      	#AccessFileName	.htaccess
      	<IfModule mod_fcgid.c>
        		SuexecUserGroup john john
        		PHP_Fix_Pathinfo_Enable 1
        		<Directory /var/www/testing.example.com/public_html/>
          			Options +ExecCGI
          			AllowOverride All
          			AddHandler fcgid-script .php
          			FCGIWrapper /var/www/php-fcgi-scripts/testing.example.com/php-fcgi-starter .php
          			Order allow,deny
          			Allow from all
        		</Directory>
      	</IfModule>
      	ServerSignature Off
    	LogLevel 	debug
    	HostNameLookups off
    </VirtualHost>
    
    I've got index.html files working for virtualhosts. When trying the url with index.php as default it simply throws
    Code:
    You don't have permission to access / on this server.
    Checking the error_log at /var/log/httpd/testing.example.com/error_log and this is what I get
    Code:
    [Thu Jun 02 20:24:38 2011] [error] [client 192.168.1.130] Directory index forbidden by Options directive: /var/www/testing.example.com/public_html/
    [Thu Jun 02 20:24:38 2011] [error] [client 192.168.1.130] File does not exist: /var/www/testing.example.com/public_html/favicon.ico
    
    I checked permissions and owner of documentroot and php-fcgi-script-folder and they are the same as in the conf of virtualhost.
    Code:
    drwxr-xr-x 10 root    root    4096 Jun  1 22:17 .
    drwxr-xr-x 21 root    root    4096 Jun  1 21:11 ..
    drwxr-xr-x  2 root    root    4096 May  4 12:54 cgi-bin
    drwxr-xr-x  3 root    root    4096 Jun  1 21:11 error
    drwx------  3 apache  apache  4096 Jun  1 23:48 html
    drwxr-xr-x  3 root    root    4096 Jun  1 21:16 icons
    drwxr-xr-x  3 john john 4096 Jun  1 22:14 modx.example.com
    drwxr-xr-x  5 john john 4096 Jun  1 22:17 php-fcgi-scripts
    drwxr-xr-x  3 john john 4096 Jun  1 22:13 testing.example.com
    
    I'm lost. What (step) did I overlook?:(
     
    Last edited: Jun 3, 2011
  2. jambek2003

    jambek2003 New Member

    I fixed it! Read through the apache-docs and I changed some stuff;

    Set permission of script-directory to mod_fcgid user (somewhere down the line I've changed it to root)
    Added DirectoryIndex index.html index.php to virtualHost-config

    Now the php-file runs perfect with persmissions set to 0700.
     

Share This Page