Help:Install:Drupal

From OpenLiteSpeed
Jump to: navigation, search

In the following article we will guide you through the steps to set up Drupal, a popular open source content management system (CMS) written in PHP, on OpenLiteSpeed. Drupal is especially easy to install. You need make no substantial changes to your OpenLiteSpeed settings. In this guide we will walk you through the PHP and MySQL settings you will need for Drupal. We will be installing the latest version of Drupal 6, Drupal 6.28, on OpenLiteSpeed's default virtual host, "Example". (These steps should also work for Drupal 7.)

Note: Any setting not specifically noted in this walkthrough can be left as the default.


Install PHP modules

The easiest way to install PHP for OpenLiteSpeed is through our CentOS repository. If the LiteSpeed Repository was not installed and enabled during the web server installation, follow this guide to install and enable the LiteSpeed Repository.

Use the following command to install PHP with the modules required:

yum install lsphp55 lsphp55-common lsphp55-gd lsphp55-process lsphp55-mbstring lsphp55-mysql
Note: There are four versions of LSPHP (lsphp53, lsphp54, lsphp55, lsphp56) available.

Direct LSWS to the location of the installed PHP. (In this example, PHP 5.5 is installed by default in /usr/local/lsws/lsphp55/bin/lsphp. Change the value of the WebAdmin console > External App > your external application > Command setting to reflect that.)

If you are not using RedHat or CentOS, or you prefer to build PHP by yourself, see our instructions for building PHP for Drupal here.

Download the Drupal 6 core

Download Drupal 6 core into your virtual host document root. For the default virtual host, "Example", the docroot is /usr/local/lsws/DEFAULT/html

cd /usr/local/lsws/DEFAULT/html
wget http://ftp.drupal.org/files/projects/drupal-6.28.tar.gz
tar zxf drupal-6.28.tar.gz
mv drupal-6.28 drupal
rm drupal-6.28.tar.gz

Add rewrite rule

Drupal requires a simple rewrite rule to make sure URLs are sent to the right PHP files. Go into your virtual host settings (WebAdmin console > Configuration > Virtual Hosts > Example > Rewrite) and turn Enable Rewrite to "Yes". Then add the following rewrite rule:

RewriteRule ^(.*)/$ $1/index.php [L]
Drupal-rewriterule.png

Set up a MySQL database and user for Drupal

yum install mysql mysql-server
service mysqld start
mysql -u adminusername -p
mysql> create database drupal;
mysql> grant all privileges on drupal.* to db_user@'localhost' identified by 'password';
mysql> exit

Graceful restart to apply changes

WebAdmin console > Actions > Graceful Restart

Install Drupal from web installer

Point your browser to http://localhost:8088/drupal/install.php to run the Drupal installer.

start install

The warning message below is a common issue for a first installation of Drupal. To resolve it, do the following:

cd /usr/local/lsws/DEFAULT/html/drupal
cp ./sites/default/default.settings.php ./sites/default/settings.php
chown nobody ./sites/default/settings.php
verify


DB setup


installing


site configuration part 1 of 3


site configuration part 2 of 3


site configuration part 3 of 3


install complete

Ready to use

Once complete, your newly installed Drupal (http://server_ip:8088/drupal/index.php) should be ready to use.

ready to use