Multiple sites, Vhosts, host file and other problems

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

Multiple sites, Vhosts, host file and other problems

Postby Chris Brown » 20. August 2011 15:59

Long story short. I had Apache / Perl installed on Win XP. All I had to do to run sites was switch on Apache, convert the "host.sam" file to "hosts", and I was away.

Tried that on "Windows 7", and ran into all sorts of problems, so switched to XAMPP.

I'm up and running with that - if not correctly - so wondered if anyone can give me a few pointers.

Now my offline test server site names are the same as the online sites, and the only way around it so far was the "drivers/etc/host" file with the names listed as DNS:

127.0.0.2 http://www.zippi-download
127.0.0.3 http://www.web20sitemakerpro.com

and so on for 22 sites.

These same sites are also set up in "vhost" conf file

With apache server on, and file named as "host", it loads the offline development sites.

When I switch off apache, I have to rename the "hosts" file to "hosts.sam", and then I can access those same sites offline.

So double question:Is this the correct method, or is there a simpler way? Ditto: can I get the Xampp control interface to run an extra batch file to implement the host file renames? (Tried adding dos commands to the "apache-start.bat" and "apache-stop.bat", but they don't seem to make any difference)

Next "problem"

My online server uses "usr/bin/perl" as the shebang, whereas the installation uses "C:/xampp/perl/bin" or similar. I've read that I should not move the standard installation folder as it would make updates harder. I did some research, and I THINK I can get the interpreter to execute from the differnt folder by creating a 'symlink(?)', but what code to use, or where to put it, I don't know

Anyone able to shed any light?
Chris Brown
 
Posts: 2
Joined: 20. August 2011 15:40

Re: Multiple sites, Vhosts, host file and other problems

Postby JonB » 20. August 2011 20:36

In the past (I guess now) Symbolic Links were limited to Unix style filesystems

I actually started with:
I don't think you can create symbolic links on Windows.

wrong-o again

I have zero idea if Apache can process this logic

http://msdn.microsoft.com/en-us/library/aa365680(v=VS.85).aspx

http://www.windows7home.net/how-to-create-symbolic-link-in-windows-7/

Google IS your (and my) friend...

8)
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: Multiple sites, Vhosts, host file and other problems

Postby Chris Brown » 20. August 2011 21:24

Might be some confusion here. I don't need to run the symlinks in the Windows environ, we're talking about Apache here which is I think a Unix based language that's been ported to work on Windows, (effectively running as a Unix server) That's my understanding.

I've also found another error to the scenario above; if you place ANYTHING in the hosts file - whatever it's named - it seems to stop you from getting to those sites online. I only found this out later. Kept getting "server unable to connect" errors, yet when I tried one of the "Is My Site Down" services, it reported it was still visible to others. Deleted all the data from the host file, (as XAMPP had set it originally) and I was able to connect no problem.

Don't know what will happen when I try to access the test domains offline. Back to "Square One" probably!
Chris Brown
 
Posts: 2
Joined: 20. August 2011 15:40


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 142 guests