Link to home
Start Free TrialLog in
Avatar of Xerc
Xerc

asked on

How to rename domain to something other than localhost with apache on USB install?

I am trying to develop a distributable USB stick with XAMPP on it in which users can view web based material, without actually connecting to the web.  Is it possible, and if so how, to change 'localhost' in Apache to something unique, like the project name or such.  For instance I'd like it to show up as <myproject.com>, even though they are viewing the domain from a USB stick.
Avatar of Pétur Ingi Egilsson
Pétur Ingi Egilsson
Flag of Iceland image

add "myproject.com 127.0.0.1" (or was it via versa?) to /etc/hosts

Avatar of Xerc
Xerc

ASKER

Errrrr........I'm assuming that is for a Linux environment?  I couldn't find such a directory on the XAMPP installation on a USB stick.  This will operate on a Windows system, but I need it to configure or work from the USB without user intervention.
Avatar of Xerc

ASKER

Wait....nvm.  I track you.  At C:\Windows\System32\drivers\etc\ I see the hosts file.  I'm unable to save or make edits, but at least I see it.  Sooooooo......basically there is no way to have a portable Apache installation show up with the domain name I want without aggressively altering the target computers hosts file?  Poop.
I'm a bit confused.

You have a USB stick, you plug it into computer. Boot that computer from the usb stick,  Then allow other computers on the same network to access the web server running on that stick using www.projectname.xyz ?
If that is the case, then you need to modify either the hosts file on each computer, or if you have a DNS server add the appropriate record to it.
Avatar of Xerc

ASKER

Not quite right.  I'll run XAMPP (therefore Apache) on the USB stick, but the computer will not boot from th e stick.  The OS and such is still 'whatever' computer the stick happens to be inserted into at the time.  So, I'm looking for a way to get that 'myproject.usb' domain name without having to modify the hosts file.  Maybe its not possible.
ASKER CERTIFIED SOLUTION
Avatar of Pétur Ingi Egilsson
Pétur Ingi Egilsson
Flag of Iceland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Xerc

ASKER

Well.  Figured as much, but what happens if someone already has a server occupying 127.0.0.1 on the local machine.  Is there a way to dynamically make the IP of my stick recognizable?  I'm going to guess not.  Not a biggie as it is a rare instance, but you never know.
Two application cannot run on the same port.
I'm not familiar enough with XAMPP to answer your question.

Feel free to request your points back as i've been unable to solve the original question.
Avatar of Xerc

ASKER

Confirming what isn't possible is still a valid answer even if it doesn't solve my problem / wish.  Points awarded.  Thanks for the time and help!