- Getting Started
- Basic Configuration
- Creating Multiple Sites On Your Local Computer
- Error Pages
- Accessing Your Test Site(s)
- Adding Modules and Themes
- Creating Content
- Custom Blocks
- Working with the Menu
- The Contact Form
- URL Aliases
- Moving Entire Drupal Site with Databases
- Moving Stuff to Your Web Site
- Setting Up Cron
- Additional Tips and Tricks
- Categories (Taxonomy)
- Common Problems
- Links and IMG
- Keeping Your Local and Remote Sites Synchronized
- More Reading
- Glossary
Creating Multiple Sites On Your Local Computer
Need another test siteA logically grouped set of content - also web site.? Here's how to do it the "easy" way. [Hint: if you want several test sites, make a list right now. Read these instructions all the way through. Now you can do some of the steps in bulk to save some time.]
Why create extra sites? In addition to my having several sites running already, I had some ideas in the back of my head, not the least of which being a siteA logically grouped set of content - also web site. where I could document everything I do (like this book). I also had some idea for other sites that I might put up in the future. So before you totally pooh-pooh the idea, give it a few minute's thought. And you can always change your mind later; it just might be a bit messier then.
At the very least, I would create a "working" siteA logically grouped set of content - also web site. other than my "root" siteA logically grouped set of content - also web site.. This makes it easier to start all over again if you get totally out of control later on.
This may look like a long process, but it's deceiving because I spell it out in detail. It is expanded and updated from the post "Running multiple sites on a local PC (localhost) from a single codebase, using Windows."
- Open phpMyAdmin (using "other" in Web-Developer Controller)
- On the left, select the Drupal51 databaseA collection of data related to an application.. This is the one that was created by the package installation.
- Click on "Operations"
- Scroll down to "Copy DatabaseA collection of data related to an application. to:"
- Enter the new databaseA collection of data related to an application. name.
- Verify that the radio buttons are clicked for:
- Structure and data
- CREATE DATABASEA collection of data related to an application. before copying
- Switch to copied databaseA collection of data related to an application.
- Click on the Go button just below this area.
- When the copy is complete, click on "SQLStructured Query Language - a language for accessing a database.".
- In the "Run SQLStructured Query Language - a language for accessing a database. query/queries on databaseA collection of data related to an application." box, enter:
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES ON databasename.* TO 'admin'@'localhost' IDENTIFIED BY 'superpw';
FLUSH PRIVILEGES;
admin is what I call my administrative role (this is the "super-user" name);
superpw is the password for this user (I tend to use the same one for all my databases to make it easy).
Hint: I created and saved this in c:/www/drupalDrupal
An open-source content management system that is used on this site and is taking over the world./grant.txt so I could copy and paste. - Change databasename to the new databaseA collection of data related to an application.'s name.
- Close phpMyAdmin.
- Go to the www/Drupal
Drupal
An open-source content management system that is used on this site and is taking over the world./sites directory. - Copy one of the siteA logically grouped set of content - also web site. folders (e.g.
default) and name it for your new siteA logically grouped set of content - also web site.. - Open the directory, then open the settings.phpRecursive acronym for "PHP: Hypertext Preprocessor" - is a widely-used Open Source general-purpose scripting language that is especially suited for Web development and can be embedded into HTML. file in Notepad.
- Change the
$base_dband$base_urllines. The$base_dbline should have the name of the databaseA collection of data related to an application. you just created. The$base_urlwill be how you want to access the siteA logically grouped set of content - also web site.. - Close the file.
- If you are going to have siteA logically grouped set of content - also web site.-specific modules or themes, go ahead and create directories in this siteA logically grouped set of content - also web site. to hold them (named "modules" and "themes").
end bulk loop 2
- Navigate to the /www/Apache22/conf folder.
- Locate and open the "httpd.conf" file (Hint: I always make a copy of things I'm about to change, just in case I mess up.)
- Find the line that says "# Virtual hosts." Remove the "#" from the next line. This allows you to make all your other changes in a separate, and less dangerous file.
- Save it.
- Navigate to the /www/Apache22/conf/extra folder.
- Open the httpd-vhosts.conf file.
- At the bottom of the existing list, comment out ("#") the examples.
- At the bottom of the existing list, enter:
<VirtualHost *:80>
DocumentRoot /www/drupal/
ServerName databasename
</VirtualHost> - Change databasename to the new databaseA collection of data related to an application.'s name.
- Close the file.
- Navigate to the /windows/system32/drivers/etc folder.
- Open the Hosts file with Notepad. Hint: these two steps can be done by using "other" in Web-Developer Controller.
- Add a line that says:
127.0.0.1 databasename - Change databasename to the new databaseA collection of data related to an application.'s name.
- Close the file.
- Go back to Web-Developer Controller.
- Click on Apache2 (top left).
- Click the Stop Service button.
- Wait for it to change to "stopped."
- Click the Start Service button
- Wait for it to say "running."
start bulk loop 1
end bulk loop 1
start bulk loop 2
I did notice that my version of Apache sets index.html ahead of index.php, so don't have an index.html in your directory.
start bulk loop 3
end bulk loop 3
start bulk loop 4
end bulk loop 4
Go for it. You can now start the browser and enter http://databasename.
For more details on directories for multiple sites, see Setup of /sites directory for multi-site.



Just found this...