When using a VirtualHost there should be no need to change anything in the httpd.conf file which is best left as the installation default.
If you have changed anything then revert to the default whilst testing your vhost conf file or again you may experience unusual errors.
Drive letters should not be used in a USB portable drive if indeed you wish your USB to be portable to other PCs or the alternate PC may not give the USB drive letter F if that drive is already in use, it will simply give it the next available drive letter and then your USB and VirtualHosts, in this case, will be broken.
The localhost should be first in the list so if there are any problems Apache will use the default localhost which is also an indication that the vhost conf is not quite right, which is why you were always being sent to the XAMPP Welcome page at localhost.
Any vhost's DocumentRoot not in the Apache server's DocumentRoot must have directory access permissions defined or an access denied error may ensue - the defaults in the httpd.conf file are restrictive for obvious security reasons, you don't want any Tom, Dick or Script Kiddie poking around inside your PC via your web server when connected to the Internet.
Try this and then add more vhosts if this works.
- Code: Select all
NameVirtualHost *:80
<VirtualHost *:80>
ServerName localhost
DocumentRoot /xampp/htdocs
</VirtualHost>
<VirtualHost *:80>
ServerName backup
DocumentRoot /Inetpub/backup
<Directory /Inetpub/backup >
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Adding the next vhost should then be configured based on the working 'backup' vhost.
Better to test with only one vhost then add more when that works as intended or there will be confusion otherwise which one is giving issues.
Check your paths and folder/file case as mentioned above and always save the file and restart Apache after editing any conf or ini file.
Make sure you only use a text editor like notepad not a RTF or word processor for editing files in XAMPP.
To check your vhosts conf file open a command prompt in the /xampp/apache/bin folder and type the command
apache S to see if there are any errors -
apache p will test the httpd.conf file.
Make sure that no part of your USB installation carries a drive letter or you will have errors and no portability - the readme_en.txt file is quite clear on that score by advising not to run the setup_xampp.bat file which will place a drive letter in all the paths.
Your next vhosts should look like this when you have the first 2 up and working as intended.
- Code: Select all
<VirtualHost *:80>
ServerName code
DocumentRoot /Inetpub/code
<Directory /Inetpub/code>
Options Indexes FollowSymLinks ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Good luck and please let us know how it went this time.