Php – virtual hosts with Apache 2.4 windows

apache-2.4PHPwindows-server-2012

Trying to upgrade the PHP version from 5.3 to 5.5

Environment:
Windows 2012 Server,
Apache 2.4,
PHP 5.5,

Upgrading from PHP 5.3 and Apache 2.2 for
*MySQL and *Drupal

I was able to get the Apache2.4/PHP 5.5 config to work using the base document root. I am able to navigate to 'http://sitetest' and call index.html or a created phpinfo.php with correct php version.

Issue is getting virtual hosts to work that are sub folders of the base document root.
sitetest/sitenet
sitetest/siteorg
get

Internal Server Error

The server encountered an internal error or misconfiguration and was
unable to complete your request.

From httpd.conf

DocumentRoot "C:/sitefolder/web"
<Directory "C:/sitefolder/web">
    Options FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>

AccessFileName .htaccess
...
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
...
LoadModule php5_module "C:/php/php55/php5apache2_4.dll"
PHPIniDir "C:/php/php55"
AddType application/x-httpd-php .php

from the httpd-vhosts.conf

<VirtualHost *:80>
    DocumentRoot  C:/sitefolder/web
    ServerName sitetest
    ServerAdmin admin@site.local
<Directory "C:/sitefolder/web">
    Options FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>
</VirtualHost>

NameVirtualHost *:80
<VirtualHost *:80>
    DocumentRoot "C:/sitefolder/web/sitenet"
    ServerName sitenet
    ServerAdmin admin@site.local
    ErrorLog "C:/sitefolder/web/sitenet/logs/error.log" 
<Directory "C:/sitefolder/web/sitenet">
    Options FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>        
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot  "C:/sitefolder/web/siteorg"
    ServerName siteorg
    ServerAdmin admin@site.local
    ErrorLog "C:/sitefolder/web/siteorg/logs/error.log" 
<Directory "C:/sitefolder/web/siteorg">
    Options FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>    
</VirtualHost>

It doesnt matter if I try to read another easy HTML or php page in either of the sites. I tried not defining the directories for the virtual hosts and I still get the internal error.

I have read several different documents for virtual hosting and was able to get the Apache2.2 with 5.3 to work, but have run into a standstill here.

Thanks in advance.

Best Answer

I think I found the issue and Using the document: http://httpd.apache.org/docs/2.4/upgrading.html

I found an error in the logs::

Invalid command 'Order', perhaps misspelled or defined by a module not included in the server configuration

The docs suggest to use:

load module mod_access_compat, or update configuration to 2.4 authorization directives.

To say the least, Apache 2.4 does things differently than 2.2