My laborious journey at upgrading XAMPP continues...I'm having the same problem with virtual hosts as described above; getting the same "Access Forbidden..." message when trying to access the home pages of my virtual sites.
From my
httpd-conf file:
line 118: Uncommented the rewrite module (need this for my CMSs to use clean URLs)...
- Code: Select all
LoadModule rewrite_module modules/mod_rewrite.so
line 177: DocumentRoot is set as (note I'm not using this DocRoot for anything)...
- Code: Select all
DocumentRoot "C:/xampp/htdocs"
line 203: I set the default <Directory /> container to the same as DocumentRoot, as the file says to do...
- Code: Select all
<Directory "C:/xampp/htdocs/">
line 498: Ensured the httpd-vhosts.conf line was uncommented...
- Code: Select all
Include conf/extra/httpd-vhosts.conf
Sample contents of my
httpd-vhosts.conf file:
With the following contents I don't get any errors or warnings in the command prompt when I start XAMPP, but I still get the "Access Forbidden..." error if I try and access a site home page.
- Code: Select all
NameVirtualHost 127.0.0.1:80
<VirtualHost 127.0.0.1:80>
DocumentRoot C:/xampp/htdocs
ServerName localhost
ServerAdmin admin@localhost
</VirtualHost>
<VirtualHost local.site1.com:80>
DocumentRoot C:/_txp/site1
ServerName local.site1.com
ServerAdmin admin@local.site1.com
<Directory "C:/_txp/site1">
Options Indexes FollowSymLinks
AllowOverride FileInfo
</Directory>
</VirtualHost>
<VirtualHost local.site2.com:80>
DocumentRoot C:/_txp/site2
ServerName local.site2.com
ServerAdmin admin@local.site2.com
<Directory "C:/_txp/site2">
Options Indexes FollowSymLinks
AllowOverride FileInfo
</Directory>
</VirtualHost>
If I remove the beginning VirtualHostName line and the first default block (which seems redundant anyway against the httpd-conf file), then I get the following warning in the command prompt when starting XAMPP:
VirtualHost local.site1.com:80 overlaps with VirtualHost local.site2.com:80 The first has precendence, perhaps you need a NameVirtualHost directive.
I've tried reading Apache's docs on Virtual Hosts, but they're not the most understandable.
The only difference between the VirtualHosts above and those that used to work for me in my old XAMPP install is that I had a VirtualHostName line for each VirtualHost block. That worked before. However, I've tried that here too, and it doesn't work, and in any case I don't think I need a separate VirtualHostName for each block, do I?
I'm sure my blocks are wrong, any suggestions? And yes, my Windows
hosts file is configured properly to not create DNS conflicts.