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
tar zxf drupal-6.28.tar.gz
mv drupal-6.28 drupal
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]
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';
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.
The warning message below is a common issue for a first installation of Drupal. To resolve it, do the following:
cp ./sites/default/default.settings.php ./sites/default/settings.php
chown nobody ./sites/default/settings.php
Ready to use
Once complete, your newly installed Drupal (http://server_ip:8088/drupal/index.php) should be ready to use.