It's been impossible for me to setup a vhost in XAMPP for Linux, I've followed all documents that I've found online but problem persists. I'm using Ubuntu Jaunty 9.04 i386, xampp-linux-1.7.1
This is what I have done so far:
I've already uncommented the line in the /opt/lampp/etc/http.conf file:
- Code: Select all
Include conf/extra/httpd-vhosts.conf
I've also have added the information to the /opt/lampp/etc/extra/httpd-vhosts.con file:
- Code: Select all
NameVirtualHost *:80
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot /opt/lampp/htdocs
ServerName localhost
ServerAlias www.localhost.com
ErrorLog logs/localhost-error_log
CustomLog logs/localhost_log common
</VirtualHost>
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host2.example.com
DocumentRoot /opt/lampp/htdocs/testsite1
ServerName testsite1.com
ErrorLog logs/testsite1-error_log
CustomLog logs/testsite1-access_log common
</VirtualHost>
I've changed /etc/hosts file with the appropriated entries:
- Code: Select all
127.0.0.1 testsite1.com
Of course I've created the respective folder: /opt/lampp/htdocs/testsite1
If I type "localhost" or "127.0.0.1" in Firefox I get to the XAMPP page, which is what I want and it's fine, BUT, if I try to access "http://testsite1.com" the browser doesn't opens any index file, what's more, it prompts me to download a PHTML file which contains the following text:
- Code: Select all
<?php
if (!empty($_SERVER['HTTPS']) && ('on' == $_SERVER['HTTPS'])) {
$uri = 'https://';
} else {
$uri = 'http://';
}
$uri .= $_SERVER['HTTP_HOST'];
header('Location: '.$uri.'/xampp/');
exit;
?>
Something is wrong with the XAMPP installation :-(
The strange thing is that a similar setup works perfectly on Windows, of course with the appropriated differences in folder structure.
Any hints on this?
Oh! I forgot, I removed everything and then reinstalled at least three times, checking all steps from ground up, and the problem repeated itself