I want a local site with one install of DrupaI that is on my local server (WAMP), and I want to be able to create multiple sites for development and theming. I spent hours searching the internet, reading posts, and combing forums. I tried many different ways and many different ideas, and just couldn’t find a solution that worked for me… one way or another something just wasn’t working, or something else stopped working… until now…

Disclaimer!!! I am no expert, but here’s what is working for me… and maybe it will work for you. Forget editing all of the config files an Apache and changing options… this is what I did and it works for me… wanted to share and see of I was doing any additional harm to my pc, drupal, or wamp (let me know if you see a problem).

The steps below assume that you got WAMPServer up and running correctly. That you have your databases created, phpmyadmin andmysql work... How to do that stuff isn’t here, this is after you have the basics all up and running…

Here’s the details…
I have installed Drupal in c:/wamp/www/drupal5 (also because I have a drupal6 directory so I can work with both 5 and 6).

In the c:/wamp/www/srupal5/sites folder I created the folder “mysite“ and copied over an original copy of settings.php into that folder.

Then I opened the host file in c:\windows\system32\drivers\etc\ (made a backup copy) and at the bottom it says: 127.0.0.1 localhost.

Under that like I just added 127.0.0.1 mysite

That’s it….

Now I navigate to http://mysite/drupal5 and I am using the folder called mysite in the drupal5 folder. So I now have several sites with one install… maybe it’s not the best or most proper way to do it… but I am happy with it and 2 days later… it’s still working…

Maybe it will work for you…..

Comments

webthingee’s picture

When I set WAMP to online, and try to access the site from another computer I can't. That's probably what all of that Apache config stuff is... o, well... it works for several projects that I am carrying on my laptop :)

dman’s picture

You've got it.
But for remote serving your problem is the HOSTS file.
Other machines have no idea where to look to find 'http://mysite/' so you have to tell them also using the HOSTS hack trick.
BUT the number they need is not 127.0.0.1, but the actual external IP of your host machine, eg maybe 192.169.0.2 (or something) if they are on your LAN.

Find your IP (run 'ipconfig' from XP cmd-line) and tell the other machine to look there by editing its HOSTS file accordingly.

For really remote machines you have to set up port-forwarding on your router, so I won't go into that. But I would recommend you disable DHCP on your router/connection (if you have it) and settle on a static IP. I believe this can be done from either end, either your network settings or on your router DHCP config. That way you'll always know where you are.

The REAL networking solution is to start using your own local DNS server, but that's certainly out-of-scope and I can't suggest how that happens under XP Home.

Anyway. Please consider writing this up as a handbook page - just find the most appropriate place and 'add child page'. I think it's useful enough.

There are slightly more advanced ways to do it using Apache virtualhosts and wildcards to actually redirect different hostnames into different serverroot dirs (which you'll want when you get tired of working with the subdir name in your paths all the time), but what you've got using the apache 'default' server is sufficient for a simple dev environment.

.dan.
How to troubleshoot Drupal | http://www.coders.co.nz/

webthingee’s picture

That is GREAT!
Now I can actually access my laptop from my desktop while working at home... and still be able to work on the laptop when I am away from home.

Thank you dan... icing on the cake!!!

It would be a pleasure to try to combine my post and your addition try adding it to the handbook... It'll start to make me feel like part of the community.

:)

webthingee’s picture

dman,

I would be interested in learning more about that...

My current service gives me what I call a near static address... it changes every year or so....

Can you suggest any reading for the port-forwarding to access the sites I described in this thread.

Thanks!

P.S.
I did infact use this post, and added in your additions, and added a page under the multi-site config chapter... yea... thanks for the encouragement!

dman’s picture

The most comprehensive docs on port forwarding I've found have been related to P2P apps, eg
http://www.google.com/search?q=shareazaa+port+forwarding
You'll be able to find per-manufacturer docs in there, with screenshots etc often too.

The actual interface varies 300% depending on the make and version of your local router, but look under 'Port Forwarding' or 'NAT gateway' once you've located the admin page for it.
Admin page, depending on you make/model will probably be like 10.0.0.1, 10.1.1.1, 192.168.0.1 depending on your subnet, and the password is usually 'admin:admin' or 'admin:password' if you've never set it up before.

The PORT you will forward will be port 80.
You will need a static IP externally (or at least reasonably persistant - like you describe) and as above, set your server/dev machine to be static internally.

My server actually lives behind an internal wireless AND an external modem (silly, but I put the noisy machine in a cupboard), so I forward twice, but the method is the same.

Once you have external forwarding set up you can demo sites to clients and things - although our local telecos are terrible and it's not much fun serving pages at 1/10 of the normal server spped.

Still, you've got a good result.
Next week we'll look at servername wildcards - they are lots of fun for just making up sites on-the-spto, and better that working in subdirectories because of the way you need to link to resources ......

.dan.
How to troubleshoot Drupal | http://www.coders.co.nz/

webthingee’s picture

Thanks for the push in the right direction. Your posts have really helped me solve some personal productivity limitations... and this new info... just great! I'm feeling more productive already :)

Thank you again dman!

Shelichrg’s picture

your solution is the only one I've tried that works. I'm only working locally for the time being so I haven't run into the problems that others here have run into trying to access the machine from outside.

webthingee’s picture

Glad I could help you!

beautifulmind’s picture

A very heartly Thanks to all the guys posted their ideas here.

What I really forgot to do is an entry in the hosts file!!!!

Beautifulmind
Know more

Regards.
🪷 Beautifulmind

blacklump’s picture

Well there dude...this helped out a lot.
Keep in mind that it is not the fancy astronomers with MIT degree that find new stars, rather the amatuer ones that have nothing else to do.

kprmca’s picture

Excellent......! superb

awm6392’s picture

question... so i went through all these steps, and i opened my second site, which i'm using purely as an experiment to test out a module that i dont want to use on all of my current work (i've done a lot already on the site im working on). only thing is, when i open this new site (which i've aptly named "experiment") it is exactly the same as my other page with all of the same content and everything. my question is... well theres two of them really. do i need to do something to the database to get a new blank site or use a completely different method? also, if i use what i have now, and start to make changes to this new site, will it change on my old site as well?

dman’s picture

See step 2.2 in the docs
You have copied your default/ dir and the modified settings.php file it contains. This your new site isn't just a clone of your old site, it effectively is your old site.

You need to replace newsite/settings.php with default.settings.php (like you did first time) and the bootstrap of a new instance will start.