I have tried to look at various places and came across a handful of posts regarding this but couldn't get it working.

I need to set up a multi site MAMP installation i.e. I should have a single instance of MAMP and be able to host multiple sites.

So far I have tried two things:

1. Created new folders in the 'htdocs' folder along with the 'drupal' folder so I have 'drupal', 'sitea' and 'siteb' as the three folders, configured the apache httpd.conf for virtual hosts and the /etc/hosts files to point localhost to 'sitea' and 'siteb' as well (these being the virtual hosts).
I placed a one line (hello world!) coded 'index.php' file in each of the two folders 'sitea' and 'siteb'.

http://localhost in Safari shows me the three directories as expected, I can click on these and they lead me to a) the drupal site b) the index page for site A and c) the index page for site B respectively.

This is not what I want. site A and site B should also be drupal sites. What do I need to do next to make sitea and siteb as drupal sites?

2. Created a new folder 'sitex' in the folder 'sites' (in htdocs) so now I have 'all', 'default' and 'sitex' as the three folders in the 'sites' folder. I then created a new database 'sitex_db' in phpadmin and assigned database privileges to the drupal user, copied settings.php from the default folder and modified the db_url line so that it points to the database 'sitex_db'.

I didn't observe any change. How should a multisite installation look like? And what do I need to do to achieve it?

Any help would be much appreciated. Thanks in advance.

Comments

sk_mamp_nb’s picture

Proceeded further with step 2.

renamed the folder as 'test.mysite.com'
modified the file hosts to point 127.0.0.1 to test.mysite.com
modified the httpd.conf virtual host entry -> server name as test.mysite.com
created a new database as sitexdb (was not sure if the '_' was making any problems in connecting or not)
reset the Apache ports in MAMP (wanted to eliminate port 80 as an issue)
was still getting a blank page after this.

finally tried adding 'install.php' to the end of the url in the address bar, lo an behold, the installation began and after a few clicks I had a new site! A multi site Drupal!!!

Thanks to all the guys who have posted answers to similar issues before.
I am writing this so that just in case I have to refer to this again? or maybe someone else might find it of some use.

mark_anthony’s picture

I know it has been a few months, but can you detail a little more about these two steps:

modified the file hosts to point 127.0.0.1 to test.mysite.com
modified the httpd.conf virtual host entry -> server name as test.mysite.com

I have found the httpd.conf file, but am unsure of how to modify.
My directories look like : http://localhost:8888/drupal_6_11/gos

Thanks for any help.

nonnymouse’s picture

@ mark_anthony and others

There are several ways to do this, and the virtual host approach is just one of them (Drupal 6 ->)

Try these links for more inspiration.. it takes time, but its worth the effort. Not all the links are Mac specific, but the key points are:

1) Set your directory structure up correctly at the start on localhost (ie. /sites/sitename1 /sites/sitename2 ). This means you need to create a directory called sitename1 living in the sites folder, and copy the default and files folder over from the Drupal root. Make sure to copy the default.settings.php file over twice (into sitename1 directory also), and rename the version in sitename1 to settings.php. Also copy over install.php into the sitename1 directory.
2) When designing using drupal, use relative addresses (do not refer to www.blahblah.com/node1). This is where you need to set your base to live at the correct root for the relevant site you are working on.
3) Modify the hosts file (in /etc/apache2 ) to have the new sitenames, refer them to localhost as 127.0.0.1
4) Create a new database for your Drupal sitename1 to live in. e.g. In MAMP use phpMyAdmin and create a blank database. Or if you have commandline access to mySql, create a database that way.
4) You can now go to your browser URL and type http://sitename1:8888 and follow the instructions to install Drupal. Since sitename1 is referred to in your hosts definition, and you have a folder with this name on your filesystem, the installer detects that this is a new installation and starts the install procedure.
5) The installer asks you for your database name (hence why you needed step4), and asks you to name an initial account and password.
6) After installation, you can start copying new themes or modules into your /sites/sitename1/... folder to customise your new site.

http://drupal.org/node/107347
http://drupal.org/node/291373
http://sysblogd.wordpress.com/2008/05/26/drupal-an-easy-way-to-set-up-mu...
http://geekglue.blogspot.com/2007/09/drupal-multisite-setup.html
http://stephenondrupal.blogspot.com/2007/10/how-to-correctly-set-up-drup...

Happy to help as this topic has many posts circulating which tends to confuse things when you are learning (and confused me when I was learning also).