How To Install Drupal 5.6 On Debian Etch With ISPConfig - Page 3
Part B) Multisite Installation
We will use the program core installed on /www/web1/web/.
7. Assumptions And Preparations For Multisite Install:
7.1 System And Software:
Perfect Debian Etch setup with ISPConfig (see Falko's How-To). Thank you Falco.
Drupal core installation according to this How-To, page 1 and page 2.
Note: this set-up should work on all other Linux distros as long as your web directories are stored under /www/web2/web/ or as long as you change relevant commands according to the settings on your server.
7.2 In This How-To I Will Use The Following Names:
Your Drupal multi-website: www.multiexample.tld
Website administrator: admin
MySQL superuser: root
(Note: MySQL root user account was created when you installed MySQL on your server)
MySQL superuser's password: rootpassword
Multisite MySQL database: web2_db1
Multisite MySQL user: web2_u1
Multisite MySQL password: web2password
We will install Drupal 5.6.
8. Create New Multi-Website
First we need to create in ISPConfig a new website www.multiexample.tld, set up its administrator user admin and create its multisite MySQL database.
Go to ISPConfig and create new website: Click ISP Manager=>New site. Fill in all relevant information, for hostname use www and for the domain name multiexample.tld. Enable PHP scripts and MySQL. PHP Safe Mode must not be selected. Do not click save yet as we need to create new user and grant him administrators rights. To do so click: User and Email=>New and set up new user with the name admin. Add an email address and grant to this user administrator rights. Click on Save. We are back on the Basic tab in the window ISP Site. To create a database click on Options=>Database New.
ISPConfig will show you:
Database name: web2_db1
Database user: web2_u1
Create password and click on Save. Once again we are back on the Basic tab in the window ISP Site. Now it is time to save the new website's configuration so click on Save at the bottom.
9. Configure MySQL
Now we need to grant specific privileges to the multisite MySQL user web2_u1.
For administering your Multisite MySQL database use MySQL superuser root and the password rootpassword. Do not use the newly created multisite MySQL user web2_u1! You will need to have enough rights to grant privileges to user web2_u1.
9.1 How To Grant User Privileges Using The Command Line:
mysql -u root -p
You will be prompted for a password. Enter rootpassword.
Now you should see following:
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES ON web2_db1.* TO 'web2_u1'@'localhost' IDENTIFIED BY 'web2password';
If successful, MySQL will reply with:
Query OK, 0 rows affected
To activate the new permissions, enter the following command:
Privileges granted. To exit mysql mode press ctrl+z.
10. Install Drupal Multisite
Now you can log out of your ISPConfig. We will get busy on the command line:
10.1 Set Drupal Files
First go to your multi-website root directory:
Create symlinks to your Drupal core installation:
ln -s /www/web1/web/includes
ln -s /www/web1/web/misc
ln -s /www/web1/web/modules
ln -s /www/web1/web/profiles
ln -s /www/web1/web/scripts
ln -s /www/web1/web/sites
ln -s /www/web1/web/themes
Next copy files from the Drupal core installation:
cp /www/web1/web/CHANGELOG.txt /www/web2/web/
cp /www/web1/web/cron.php /www/web2/web/
cp /www/web1/web/index.php /www/web2/web/
cp /www/web1/web/INSTALL.mysql.txt /www/web2/web/
cp /www/web1/web/INSTALL.pgsql.txt /www/web2/web/
cp /www/web1/web/install.php /www/web2/web/
cp /www/web1/web/INSTALL.txt /www/web2/web/
cp /www/web1/web/LICENSE.txt /www/web2/web/
cp /www/web1/web/MAINTAINERS.txt /www/web2/web/
cp /www/web1/web/robots.txt /www/web2/web/
cp /www/web1/web/update.php /www/web2/web/
cp /www/web1/web/UPGRADE.txt /www/web2/web/
cp /www/web1/web/xmlrpc.php /www/web2/web/
Next in the Drupal core installation (web1) in the folder /www/web1/web/sites/ create a new folder with name of your domain (without www.):
For multi-website (multiexample.tld) we will need its own settings.php file. Without it we will not be able to change the appearance of (multiexamle.tld) independently of the Drupal core website (example.tld). To set settings.php we have to copy our back-up settings.php.multi (remember page 1?) to a new directory. After copying settings.php.multi we will change permissions for it.
cp /www/web1/web/sites/default/settings.php.multi /www/web1/web/sites/multiexample.tld/settings.php
chmod 777 /www/web1/web/sites/multiexample.tld/settings.php
In the multi-website root directory /www/web2/web/ there is ISPConfig's default web page index.html. As Drupal uses index.php we need to rename index.html (alternatively you can delete index.html, but I like to have it ready just 'in case' :-) ):
mv index.html index.html.old
10.2 Set Drupal's MySQL Database
Now we will abandon the shell for a while but do not worry, we will be back. Open your browser and go to your new Drupal website on www.multiexample.tld. If all went right you should see a MySQL Database set-up page. Please insert your details (in our example it is: Multisite MySQL Database Name = web2_db1, Multisite MySQL User Name = web2_u1, Multisite MySQL Password = web2password).
Click Save configuration and if you did it right you will be awarded with a security warning reminding us that we have to change the writing permissions for settings.php back to 644:
10.3 Clean Up
So go back to the shell. You should be in the /www/web2/web/ directory, but if you are not, first you have to go there:
And rewrite permissions for settings.php in the multiexample.tld directory:
chmod 644 sites/multiexample.tld/settings.php
Now we will need to create a writeable folder named files for... well, files of the website.
chmod 777 files
Now you can log out of the shell and go back to your browser.
11. Configure New Website
In the browser click on the link your new site (or alternatively write to address bar www.multiexample.tld). You will be awarded with a new page where you will have to create the root user for your new website. After submitting your data you will get a generated password but you will be able to change it for some more memorable. Drupal will automatically send an email with the generated password to your new root user, however Drupal will not send a changed password. So if you change the password make sure that you will remember it. When you finish, on the next page click on the link administration section.
You will see a red banner announcing that some problem with your Drupal installation was detected. Click on the status report link.
If all went right, on the next page you will see just one fault Cron did not run yet. Just click on run cron manually to get rid of the message. But remember, you will have to configure Cron later. (Consult Drupal documentation about this small task.)
12. More Information
And that is it. You have now a fully working Drupal multi-website installation on Debian Etch with ISPConfig. Next you can start to add new content and to customize the look of your new websites. For more info visit Drupal.org and review their documentation.