Virtual Host not working

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Virtual Host not working

Postby nerotic » 19. May 2013 16:59

Hello,

I used WAMP for a few years but today I've set up XAMPP for the first time. So far I'm happy but I'm trying to move a Magento store working locally under a virtual domain.

I've been reading for hours and trying everything that I've seen but it's not working for me, especially this post http://community.apachefriends.org/f/viewtopic.php?f=16&t=53898 which is so similar to my issue.

I want to use dougals.dev as my domain but right now every time I access that url I'm sent to dougals.dev/xampp/ which should me the XAMPP localhost homepage.

My hosts has these entries:
Code: Select all
127.0.0.1 dougals.dev
127.0.0.1 www.dougals.dev


I've added this to httpd-vhosts.conf

Code: Select all
<VirtualHost *:80>
    DocumentRoot "C:/xampp/htdocs"
    ServerName localhost
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "C:/xampp/htdocs/dougals"
    ServerName dougals.dev
    <Directory "C:/xampp/htdocs/dougals">
        Order allow,deny
        Allow from all
        Require all granted
    </Directory>
</VirtualHost>


And I've changed the urls in the magento database accordingly.

Error.log only throws a couple of notices:
Code: Select all
[Sun May 19 16:45:10.573262 2013] [mpm_winnt:notice] [pid 8932:tid 304] AH00354: Child: Starting 150 worker threads.
[Sun May 19 16:47:42.839971 2013] [core:warn] [pid 8232:tid 292] AH00098: pid file C:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Sun May 19 16:47:43.227993 2013] [mpm_winnt:notice] [pid 8232:tid 292] AH00455: Apache/2.4.3 (Win32) OpenSSL/1.0.1c PHP/5.4.7 configured -- resuming normal operations
[Sun May 19 16:47:43.227993 2013] [mpm_winnt:notice] [pid 8232:tid 292] AH00456: Server built: Aug 18 2012 12:41:37
[Sun May 19 16:47:43.227993 2013] [core:notice] [pid 8232:tid 292] AH00094: Command line: 'c:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache'
[Sun May 19 16:47:43.234994 2013] [mpm_winnt:notice] [pid 8232:tid 292] AH00418: Parent: Created child process 9184
[Sun May 19 16:47:44.300055 2013] [mpm_winnt:notice] [pid 9184:tid 304] AH00354: Child: Starting 150 worker threads.


In the access.log it's a bit weird, I get different results from FF and Chrome:
Code: Select all
127.0.0.1 - - [19/May/2013:17:19:46 +0200] "GET / HTTP/1.1" 302 - "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20130518 Firefox/24.0"
127.0.0.1 - - [19/May/2013:17:19:46 +0200] "GET / HTTP/1.1" 302 - "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20130518 Firefox/24.0"
127.0.0.1 - - [19/May/2013:17:19:46 +0200] "GET /xampp/ HTTP/1.1" 200 594 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20130518 Firefox/24.0"
127.0.0.1 - - [19/May/2013:17:19:46 +0200] "GET /xampp/head.php HTTP/1.1" 200 1393 "http://www.dougals.dev/xampp/" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20130518 Firefox/24.0"
127.0.0.1 - - [19/May/2013:17:19:46 +0200] "GET /xampp/start.php HTTP/1.1" 200 1067 "http://www.dougals.dev/xampp/" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20130518 Firefox/24.0"
127.0.0.1 - - [19/May/2013:17:19:46 +0200] "GET /xampp/navi.php HTTP/1.1" 200 3921 "http://www.dougals.dev/xampp/" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20130518 Firefox/24.0"
127.0.0.1 - - [19/May/2013:17:19:48 +0200] "GET / HTTP/1.1" 302 - "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.81 Safari/537.36"
127.0.0.1 - - [19/May/2013:17:19:48 +0200] "GET /xampp/ HTTP/1.1" 200 594 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.81 Safari/537.36"
127.0.0.1 - - [19/May/2013:17:19:49 +0200] "GET /xampp/head.php HTTP/1.1" 200 1393 "http://localhost/xampp/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.81 Safari/537.36"
127.0.0.1 - - [19/May/2013:17:19:49 +0200] "GET /xampp/start.php HTTP/1.1" 200 1067 "http://localhost/xampp/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.81 Safari/537.36"
127.0.0.1 - - [19/May/2013:17:19:49 +0200] "GET /xampp/navi.php HTTP/1.1" 200 3921 "http://localhost/xampp/" "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.81 Safari/537.36"


I've flushed my DNS and browser caches many times but nothing changes.

I should also note that http://localhost/dougal/ redirects to http://www.dougals.dev/xampp/ and the welcome screen as well.

Any and all help would be appreciated.
nerotic
 
Posts: 4
Joined: 19. May 2013 15:48
Operating System: Win7 x64

Re: Virtual Host not working

Postby JJ_Tagy » 19. May 2013 18:53

Is there still an index.php in document root forwarding to xampp?
JJ_Tagy
 
Posts: 788
Joined: 30. January 2012 13:44
XAMPP version: 5.5.15
Operating System: Windows 10 Pro x64

Re: Virtual Host not working

Postby nerotic » 19. May 2013 19:04

Hi JJ...there is and I just renamed it and now it works. Thank you very much :)

Does this mean that I need to hit localhost/xampp to get to the homepage? It's awkward that hitting Admin in the control panel would lead to the success page.
nerotic
 
Posts: 4
Joined: 19. May 2013 15:48
Operating System: Win7 x64

Re: Virtual Host not working

Postby JJ_Tagy » 19. May 2013 19:28

No, absolutely no need. You can put your own index file there and access it using dougals.dev. Just remember that your document root is dougals while localhost points to just htdocs.
JJ_Tagy
 
Posts: 788
Joined: 30. January 2012 13:44
XAMPP version: 5.5.15
Operating System: Windows 10 Pro x64

Re: Virtual Host not working

Postby nerotic » 19. May 2013 21:35

Not sure you understand my question, or I didn't understand the answer.

If having an index.php in htdocs causes the subdirs to redirect then how do I add an index.php
nerotic
 
Posts: 4
Joined: 19. May 2013 15:48
Operating System: Win7 x64

Re: Virtual Host not working

Postby Altrea » 19. May 2013 22:19

\xampp\htdocs\index.php contains a redirect to the orange XAMPP Administration page \xampp\htdocs\xampp\
If you get redirected by requesting dougals.dev then your second vhost haven't matched or another (not XAMPP) rewrite/redirect matches.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: Virtual Host not working

Postby nerotic » 19. May 2013 22:29

It's interesting that you bring up a non-XAMPP rewrite. Where would that happen exactly?

I have one in WAMP but it's completely disabled and none of the services are active (which would immediately set off a conflict alert I'm pretty positive). Do you think it could be related to that somehow?
nerotic
 
Posts: 4
Joined: 19. May 2013 15:48
Operating System: Win7 x64

Re: Virtual Host not working

Postby Altrea » 19. May 2013 22:59

In most cases that will be inside of a .htaccess file of your webapplication.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 80 guests