Running Multiple Websites On Local PC Development Server

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

BarraGT

Thread Starter
Joined
Jun 20, 2005
Messages
298
I am currently using WAMP5 1.3.2 as a local server on my PC to run one of my websites that uses PHP.

I don't use my computer as a live server, I only use it to test my websites on a development environment.

Now, I have six websites that could all benefit by being put onto the local development server, but when I try to have them all in there, the directories get confused in the code. For example, if, in the root folder of WAMP5 1.3.2, I have the following websites (in these folders):

  • Website #0001/
  • Website #0002/
  • Website #0003/
Now, if in Website #0001 I have a .PHP file that has a reference to an image...

HTML:
<img src="../Images/Image.gif">
...It will go looking for "Website #0001/Images/Image.gif". So, when I upload my files to the actual live server, there will obviously be no "Website #0001" folder.

Is there a way that I can have all my websites within the WAMP5 1.3.2 environment (or any other program that might do it), and not upset the code in anyway?

Sorry if this doesn't make sense...it's surprisingly difficult to explain.
 
Joined
Jul 29, 2001
Messages
21,334
If you can apply more than one IP address to your NIC on the testing server you can probably define them per IP address and you define the root folder as website #xxx and as long as the file structure is the same under the root between sites it should make no difference on the live web server.
 

BarraGT

Thread Starter
Joined
Jun 20, 2005
Messages
298
Sorry, but can you explain how I can apply more than one I.P. address, and what exactly is an NIC?
 

BarraGT

Thread Starter
Joined
Jun 20, 2005
Messages
298
The live server is Linux, and the PC I want to test it all on is running Windows XP.
 
Joined
Nov 2, 2000
Messages
637
You need to setup Apache virtual hosts. Google apache virtual host setup and that should get you out to using a different URL for each website. Just don't forget to add a line in your hosts file for
127.0.0.1 website001

...etc
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top