Virtual Hosts on Mobile USB

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

Virtual Hosts on Mobile USB

Postby evolutionxbox » 10. March 2010 16:26

I installed XamppLite on my USB stick so I can take it with me wherever I go.

I also use a virtual hosts setup:
Code: Select all
<VirtualHost *:80>
   DocumentRoot "E:\xampplite\htdocs"
   ServerName jonweb
   <Directory "E:\xampplite\htdocs">
      Options Indexes Includes FollowSymLinks MultiViews
      AllowOverride AuthConfig FileInfo
      Order allow,deny
      Allow from all
   </Directory>
</VirtualHost>

#<VirtualHost *:80>
#   DocumentRoot "K:\xampplite\htdocs"
#   ServerName jonweb
#   <Directory "K:\xampplite\htdocs">
#      Options Indexes Includes FollowSymLinks MultiViews
#      AllowOverride AuthConfig FileInfo
#      Order allow,deny
#      Allow from all
#   </Directory>
#</VirtualHost>


The second is commented out because sometimes the USB is the "K:\" drive and other times it is "E:\". Apache won't run if it is wrong.
How do I make the virtual host dynamic to account for the change?
evolutionxbox
 
Posts: 10
Joined: 22. January 2009 10:40

Re: Virtual Hosts on Mobile USB

Postby addACUMEN » 10. March 2010 19:33

I'm not an expert but I think I recall that the Setup suggests that if you want a portable XAMPP you should omit the drive identifier. This then allows for dynamic use of XAMPP.

HTH
Thank you for your help

Tony D
addACUMEN
 
Posts: 15
Joined: 02. March 2007 22:26
Location: Wengen, Switzerland

Re: Virtual Hosts on Mobile USB

Postby evolutionxbox » 11. March 2010 12:08

As far as I know I did this... I have to manually write (and subsequently change) the virtual hosts file. Apache doesn't control this.
evolutionxbox
 
Posts: 10
Joined: 22. January 2009 10:40

Re: Virtual Hosts on Mobile USB

Postby evolutionxbox » 11. March 2010 12:43

I have tried this, it doesn't work:
Code: Select all
<VirtualHost *:80>
   DocumentRoot "/xampplite/htdocs/"
   ServerName jonweb
   <Directory "/xampplite/htdocs/">
      Options Indexes Includes FollowSymLinks MultiViews
      AllowOverride AuthConfig FileInfo
      Order allow,deny
      Allow from all
   </Directory>
</VirtualHost>


What I am trying to do is reference the server root (/) so that I don't have to keep it to a fixed directory (E:/).
evolutionxbox
 
Posts: 10
Joined: 22. January 2009 10:40

Re: Virtual Hosts on Mobile USB

Postby evolutionxbox » 11. March 2010 13:50

Now it works, this is what I got:
Code: Select all
#
# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.2/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

#
# Use name-based virtual hosting.
#

<VirtualHost *:80>
   DocumentRoot "\xampplite\htdocs"
   <Directory "\xampplite\htdocs">
      Options Indexes Includes FollowSymLinks MultiViews
      AllowOverride AuthConfig FileInfo
      Order allow,deny
      Allow from all
   </Directory>
</VirtualHost>


I had to remove "Listen 80", which kept using up port 80 stopping apache starting and "Localhost *:80", which I added because some website said to... hope this helps anyone with the same problem as me.

=)
evolutionxbox
 
Posts: 10
Joined: 22. January 2009 10:40


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 110 guests