[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/;
    <VirtualHost *:80>
      	ServerName 	testing.example.com
      	ServerAdmin 	[email protected]
      	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
      	ServerSignature Off
    	LogLevel 	debug
    	HostNameLookups off
    I've got index.html files working for virtualhosts. When trying the url with index.php as default it simply throws
    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
    [Thu Jun 02 20:24:38 2011] [error] [client] Directory index forbidden by Options directive: /var/www/testing.example.com/public_html/
    [Thu Jun 02 20:24:38 2011] [error] [client] 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.
    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