Question:
localhost webpage?
Gareth H
2008-03-13 16:06:14 UTC
I have read through the forums and can't find a specific answer to my installation question...

If I have a local install of a website but instead of installing it on c: I put it on my flash drive e: how do I get my localhost to connent to it.

previously I have installed wamp server on my c drive, unziped my webfiles to it (joomla 1.5.1) and when I bring up http://localhost/ in IE it strats the installation fine.

Now.... I tried to do it on my e drive, installed both WAMP and unzipped joomla 1.5.1 into the www folder and I just get a 'cannot find server' error in IE.

I guess my question is, what is my hostname now? How do I find it?

Thanks for your help. I know it's a noobie question but we we're all noobies once
Four answers:
computerguy103
2008-03-13 16:28:16 UTC
The simple answer is, trust me, you don't want to.



The more complicated answer is...



I am unfortunately not familiar with Wamp or Joomla. However, I run an Apache server, and I actually did create an Apache folder that will run from a removable device.



Before I get started, I should hit some obvious (or not so obvious) points. The server running on C must be stopped if you want to run a server on E. The server on E will be http://localhost/, just like the one on C, and you can only run one of these servers at a time. (The exception is if you configure one of them to use a port other than port 80, but I will not go into that...) Your hostname does not change; the server is still running on your physical machine.



First, you MUST realise that E:\ is great, but not really. Take your flash drive somewhere else, plug it into another computer, and it might be F or G or even H, I, J, K, or something else... not good! Windows will give it the first available drive letter. If the computer has a couple of hard disk partitions, a few CD drives, perhaps a zip drive, a USB 9-in-1 multi-flash card reader, and a few network drives, your drive might end up being N or O. Applications generally will not run if they think they are on C and they really are on E. Same goes for if the application thinks it has E and it got F.



If you installed to your hard drive then copied the application folder to your flash disk, the app still thinks it is running from the C drive. This poses major problems. First of all, the app is actually still installed on your C drive. This means it might borrow any or all of the settings and data from your C drive without you even realising it. You might think you finally got it to work only to discover that your www files are coming from the www folder on your C drive. If you want to try to make this work from your flash drive, the first thing I would recommend is renaming the program folder on the C drive. If it is "C:\Program Files\Wamp\", rename it to "Wamp2" or "Wamp Backup" or "teapot7" or "3.14159" or anything you want. Now, at least your E installation will not be able to "borrow" files from the C installation... it will probably crash instead. This is good, though; at least you know there is a problem. Rename the folder back when you get the E installation working on its own... or more likely when you give up.



Hopefully, Wamp does not use the registry to store your settings. If it does, kiss it goodbye and switch to Apache.



If the settings are stored in a config file somewhere, you have hope. Go through the entire config file (or files, if there are more than one config file) and change all of the paths from absolute (perhaps "C:\Program Files\Wamp\www\") to relative (maybe "..\www\"). You will probably have to base the relative paths off the folder the binary is stored in... in other words, if the binary is called "C:\Program Files\Wamp\bin\wamp.exe", your "C:\Program Files\Wamp\www\" folder would probably be "..\www\".



Hypothetically speaking, with every path changed to a relative path, it SHOULD run from your flash drive (even if you put it in another computer and it gets a different drive letter). Good luck with that.



As soon as you think you have it working perfectly, you need to put it to the real test. Take the flash disk to a different computer, plug it in, give it a different drive letter (use the computer management to change the drive letter if it gave it E ), and see if it runs. You might very well discover that some DLLs are missing; they are probably in the Windows, system, or system32 folder. If you ARE missing DLLs, find them and copy them into the same folder on the flash disk as the server executable... it SHOULD be able to find them now.



As I said, I did this with Apache. If you want, I would be willing to zip and send you a stand-alone, portable Apache server that ought to unzip and run as-is, Apache + PHP5. I am not sure how similar it would be to your current server. If you want it, let me know.
Oscar R
2008-03-13 16:43:08 UTC
If you are ussing internet information services, is easy, all you need i:



To create a virtual directory(control panel-management tools-internet information services), right click on default web site(which refers to vvvwroot), and you can use the assistant to create your new virtual directory(right click on default web site-new-virtual directory)



Enter a nickname to it(the once which is gonna be referred in the website url http://localhost/nickname ).



Set the directory path, thats where your e: drive directory containing the site files should be refered, then you need to set the access permissions to your files while browsing the site, usually read and execute aspx, or cgi command sequences(so just the first three checks should be marked), and then that will it.



After the virtual directory is created you should need to define the browsing configuration to the localhost url that is asigned for the site, and also which framework is gonna drive your aspx application.



To do this go right click on the new virtual directory created

go to properties, and go to the asp.net tab, then choose the apropiate framework for your site, apply.. And after that go to the virtual directory tab, mark the option redirection to an URL which would be of the form, http://localhost/yourvirtualdirectorynickname/startingpageofyourwbesite.aspx(or whatever extension you set for it)



Then finally mark the two options bellow that said, the same url typed above, and the option a directory bellow the main one, apply and accept.



So once you set this the access of the resource will be granted once you browse into

http://localhost/yourvirtualdirectorynickname



And you will be redirected to the mainpage set above.



I dont know if you are ussing IIS but i think this can solve your problem in case you are trying to test your site ussing it.



If you have any doubt please dont hesitate to ask.



Btw, you can know your hostname going into run, typing cmd and typing the word hostname pressing enter afterwards.



It is the name of your machine the name that the IIS uses is localhost tho, but it works well when you refer your local site ussing this name instead of hostname or 127.0.0.1.



Be sure also to have the IIS activated and running on the windows services manager.



I hope this helps you.
rockinronnie
2008-03-13 16:13:32 UTC
localhost refers to the local server running on your machine. You would need to go into apache, if thats what your running, and set the new path to your website folder on your flash drive.
fixedinseattle
2008-03-13 16:15:45 UTC
yeah it sounds like the web server doesn't know where the site's files are.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Continue reading on narkive:
Loading...