Drupal CMS On An ISPConfig Server Within 10 Easy Steps

Want to support HowtoForge? Become a subscriber!
 
Submitted by Hans (Contact Author) (Forums) on Wed, 2006-10-04 20:42. :: ISPConfig | Control Panels

Drupal CMS On An ISPConfig Server Within 10 Easy Steps

drupal

Version 1.0
Author: <hans> [at] bb-hosting [dot] org>
Last edited 04/10/2006

Drupal is a nice CMS, which is easy to use but it requires some special server settings. I wrote this “how to” for those who want to run this CMS on their ISPConfig server. Probably you can setup Drupal in different ways but I prefer the way descibed here.

In this how to, I will use just as an example:

- Drupal version 4.7.3. for a single drupal site configuration.
If you need multiple Drupal sites, I refer to this page: http://drupal.org/node/260
- I assume also that this is your first Drupal setup!
- Websitenumber within ISPConfig: web1
- Your webs are stored under /var/www
- MySQL database: web_db1
- MySQL username: web1_u1
- MySQL password: mysqlpassword

Here we go:

STEP 1 - Create a website:

In ISPConfig, create a website via “New site” in the main menu.
On the tab called “Basis” use www for the hostname and mydrupalwebsite.tld for the domain name. Enable MySQL and PHP scripts for this website but disable PHP Safe Mode.
In the Apache directives field you enter these lines:

<Directory /var/www/mydrupalwebsite.tld/web/>  
Options +Includes +FollowSymlinks -Indexes  
AllowOverride All  
Order allow,deny  
Allow from all  
<Files ~ "^\.ht">  
Deny from all  
</Files>  
</Directory>

STEP 2 - Create a Administator user for the website:

In ISPConfig, create an Administrator user, so you can upload/download the website later via FTP:
In the main menu select “ISP Manager”, select your new website called mydrupalwebsite.tld in the structure tree and press the tab “User and Email”.
Press “new” and define a new user and its email address. Give this user administrator rights and press “Save”.

STEP 3 - Create a MySQL database for the website:

Click on the tab called “Options” and create a new database for the website.
ISPConfig will show you:

Database name: web1_db1
Database user: web1_u1

Then you define a password for the database user and press “Save”.

STEP 4 – Download/extract the packages and remove the tar.gz files:

Logon into your webserver as root and navigate to your Drupal web:

cd /var/www/web1/web/

Download the latest Drupal version, which is version 4.7.3. at this moment.

wget http://drupal.org/files/projects/drupal-4.7.3.tar.gz
tar -zxvf drupal-4.7.3.tar.gz

Unpack the downloaded files:

tar -zxvf drupal-4.7.3.tar.gz

Remove the tar.gz files:

rm *.tar.gz

STEP 5 - Move the Drupal folder contents your web and delete the empty Drupal folder:

cd drupal-4.7.3
mv * ../
mv .htaccess ../
cd ../
rmdir drupal-4.7.3

STEP 6 – Change the .htaccess file in your web:

Replace the .htaccess file in your web, which is provided by Drupal with a .htaccess file with the following contents:

<IfModule mod_rewrite.c>  
RewriteEngine on  
RewriteCond %{REQUEST_FILENAME} !-f  
RewriteCond %{REQUEST_FILENAME} !-d  
RewriteRule ^(.*)$ /index.php?q=$1 [L,QSA]  
</IfModule>

STEP 7 – Download your Drupal site MySQL database for Drupal:

Download your Drupal website, using your favourite FTP-client.
URL: ftp://mydrupalwebsite/web
Username and password as defined at STEP 2.

STEP 8 - MySQL database for Drupal:

In the database directory within your Drupal folder - which is now on your local desktop - you will find several sql files.
The sql-version you need is depends on the MySQL server you are running.
In this example, I’ll use the sql-file database.4.1.mysql as I am running MySQL 4.1.11.
You can use this sql file to create the tables of the mySQL database.
In this example, I do this with phpMyAdmin.
You can access your database via your Internet browser via URL http://webmail.yourhostingcompany.tld:81/phpmyadmin/

If you do not have phpMyAdmin installed, you can download it at http://www.ispconfig.org/downloads.htm

Login into phpMyAdmin with the mySQL user account as mentioned/defined at STEP 3.

In phpMyAdmin:
- select your database
- select the SQL icon to start a query
- choose your sql file In the mySQL directory in the databasefolder and press “Start”
- You can exit phpMyAdmin

STEP 9 – Connecting Drupal:

In your Drupal file folder on your local desktop, you’ll find the file sites/default/settings.php.

Within this file find the line which says:
$db_url = 'mysql://username:password@localhost/databasename';

Change it into:

$db_url = 'mysql://web1_u1:mysqlpassword@localhost/web1_db1';

Save the file sites/default/settings.php after your modification and upload it to your web via FTP, using your FTP-account as defined in STEP 2.

Step 10 – Visit your Drupal website:

In your favourite browser, point to http://mydrupalwebsite.tld where you will see the Drupal setup screen. Follow the instructions as shown.

More information about the Drupal Content Management system:

http://www.drupal.org


Please do not use the comment function to ask for help! If you need help, please use our forum.
Comments will be published after administrator approval.
Submitted by Anonymous (not registered) on Mon, 2010-02-15 03:31.

http://drupal.org/node/260 is "Page Not Found"

Can you point us to a working path? I'm interested about Multi-site installation of drupal with ISPConfig.

 

Great thanks!

Submitted by yurtboy (registered user) on Fri, 2007-02-09 17:29.

Setting up drupal 5 I side steped this doc around

STEP 8 - MySQL database for Drupal:

it seems drupal 5 may take care of things after this step by going to the URL.

Just make sure to make the database and username etc 

 

Submitted by خلفÙ... (not registered) on Sun, 2010-02-14 11:57.

this is not easy it takes me a long time

i know i cant ask for help here but OK ill thank you for now 

Submitted by rsantiag (not registered) on Fri, 2009-01-09 11:57.

Hi there!!

 In order to make available the users profiles when using friendly URLs (www.mysite.com/user/theuser) we need to "disable" the default AliasMatch of ISPConfig.

 You only need to add to the Step 1 the following:

AliasMatch ^/users/(.*) /var/www/webX/web/users/$1

The complete code:

-------------------------------------------------

<Directory /var/www/mydrupalwebsite.tld/web/> 
Options +Includes +FollowSymlinks -Indexes 
AllowOverride All 
Order allow,deny 
Allow from all 
<Files ~ "^\.ht"> 
Deny from all 
</Files> 
</Directory>
 
AliasMatch ^/users/(.*) /var/www/webX/web/users/$1

-------------------------------------------------

 Hope this help you,

Ricardo.