my system is:
wx3# uname -a
FreeBSD wx3 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Tue Jan 3 07:46:30 UTC 2012 root@farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64
wx3#
packages installed:
wx3# pkg_info | grep -Ei '^apache|^ap22-mod_fastcgi|^php5-5.3|^spawn-fcgi'
ap22-mod_fastcgi-2.4.6_2 A fast-cgi module for Apache
apache-2.2.21 Version 2.2.x of Apache web server with prefork MPM.
php5-5.3.8 PHP Scripting Language
spawn-fcgi-1.6.3 spawn-fcgi is used to spawn fastcgi applications
wx3#
apache's configuration files:
wx3# cat mod_fastcgi.conf
LoadModule fastcgi_module libexec/apache22/mod_fastcgi.so
<IfModule mod_fastcgi.c>
AddHandler php5-fastcgi .php
FastCgiExternalServer /usr/local/www/apache22/data/php -socket /var/run/spawn_fcgi.sock
</IfModule>
wx3#
this is me trying to hit phpinfo.php file from a remote
mbp:~ alexus$ curl -I X.X.X.X/php/phpinfo.php
HTTP/1.1 200 OK
Date: Tue, 13 Mar 2012 01:28:14 GMT
Server: Apache/2.2.21 (FreeBSD) mod_ssl/2.2.21 OpenSSL/0.9.8q DAV/2 mod_python/3.3.1 Python/2.7.2 mod_fastcgi/2.4.6
X-Powered-By: PHP/5.3.8
Content-Type: text/html
mbp:~ alexus$
now, I'm trying to create a virtualhost, so I copying already working fastcgi to get php to work:
wx3# cat X.conf
<VirtualHost *:*>
ServerName X.X.X
DocumentRoot /home/X/X/htdocs/
<IfModule mod_fastcgi.c>
AddHandler php5-fastcgi .php
FastCgiExternalServer /home/X/X/htdocs/php -socket /var/run/spawn_fcgi.sock
</IfModule>
LogLevel debug
CustomLog /home/X/X/logs/access_log combined
ErrorLog /home/X/X/logs/error_log
</VirtualHost>
wx3#
hitting same phpscript
mbp:~ alexus$ curl -I X.X.X/php/phpinfo.php
HTTP/1.1 200 OK
Date: Tue, 13 Mar 2012 01:31:33 GMT
Server: Apache/2.2.21 (FreeBSD) mod_ssl/2.2.21 OpenSSL/0.9.8q DAV/2 mod_python/3.3.1 Python/2.7.2 mod_fastcgi/2.4.6
Last-Modified: Mon, 12 Mar 2012 21:08:11 GMT
ETag: "97c8ef-14-4bb1223c8a4c0"
Accept-Ranges: bytes
Content-Length: 20
Content-Type: application/x-httpd-php
mbp:~ alexus$
What am I missing? Why would it work for default host and won't work it for virtualhost even though I pretty much copy and paste a working configuration from default host and just change a directory?