Install Joomla on Ubuntu 16.04 LTS with OpenLiteSpeed, MariaDB and PHP 7.1 Support

Want to run Joomla on OpenLiteSpeed HTTP server? The steps below is a great place to start…
When you look at the web hosting landscape, you’ll see majority of the sites hosted on Apache2 or Nginx HTTP servers.. However, few people know about OpenLiteSpeed or Lighttpd HTTP servers and the performance benefits they provide…
This brief tutorial shows students and new users how to install Joomla on Ubuntu 16.04 LTS with OpenLiteSpeed, MariaDB and PHP 7.1 support. If you haven’t heard of OpenLiteSpeed, is an open source web server developed by LiteSpeed Technology. It’s designed to be lightweight with a user friendly web interface to create and manage your websites.
You will learn how to install OpenLiteSpeed with MariaDB and PHP 7.1… and how to configure OpenLiteSpeed to allow Joomla to work. When you’re ready, continue with the steps below:
Step 1: Update the Ubuntu
It’s always good to update Ubuntu server prior to installing new packages… to update Ubuntu, run the commands below
sudo apt update && sudo apt dist-upgrade && sudo apt autoremove
Step 2: Install OpenLiteSpeed Dependencies
After updating the server, install the packages below to install required dependencies for OpenLiteSpeed.
sudo apt install build-essential libexpat1-dev libgeoip-dev libpcre3-dev zlib1g-dev libssl-dev libxml2-dev rcs libpng-dev
Step 3: Download and Install OpenLiteSpeed
Now that all dependencies are installed, go and fetch the latest version of OpenLiteSpeed. The commands below will download version 1.4.27 to your server..
cd /tmp/ && wget http://open.litespeedtech.com/packages/openlitespeed-1.4.27.tgz
Next, run the commands below to extract the downloaded package.
tar -xvzf openlitespeed-1.4.27.tgz
Change into the directory extracted directory
cd openlitespeed-1.4.27/
Then run the commands below to install OpenLiteSpeed.
sudo ./configure sudo make sudo make install
After that OpenLiteSpeed should be installed and ready to use.
Step 4: Configure OpenLiteSpeed
Finally, configure the administrative password for the web interface. Run the commands below to do that.
sudo /usr/local/lsws/admin/misc/admpass.sh
Then create a web admin username and password.
Please specify the user name of administrator. This is the user name required to login the administration Web interface. User name [admin]: openlite Please specify the administrator's password. This is the password required to login the administration Web interface. Password: new_password Retype password: retype_password Administrator's username/password is updated successfully!
After that, run the commands below to start the webserver.
sudo /etc/init.d/lsws start
Open your browser and browse to the server IP or hostname followed by 8088 to view the default page page.

To access the admin backend portal, use the port 7078

Step 5: Install MariaDB Database Server
To install MariaDB server run the commands below.
sudo apt-get install mariadb-server mariadb-client
After installing, the commands below can be used to stop, start and enable MariaDB service to always start up when the server boots.
sudo systemctl stop mysql.service sudo systemctl start mysql.service sudo systemctl enable mysql.service
After that, run the commands below to secure MariaDB server.
sudo mysql_secure_installation
When prompted, answer the questions below by following the guide.
- Enter current password for root (enter for none): Just press the Enter
- Set root password? [Y/n]: Y
- New password: Enter password
- Re-enter new password: Repeat password
- Remove anonymous users? [Y/n]: Y
- Disallow root login remotely? [Y/n]: Y
- Remove test database and access to it? [Y/n]: Y
- Reload privilege tables now? [Y/n]: Y
Restart MariaDB server
sudo systemctl restart mysql.service
Step 6: Create Joomla Database
Joomla needs a database… to create one, continue below..
Run the commands below to logon to the database server. When prompted for a password, type the root password you created above.
sudo mysql -u root -p
Then create a blank database called joomladb you can use the same database name from the old server.
CREATE DATABASE joomladb;
Create a database user called joomlauser with new password. You can use the same username and password from the old server.
CREATE USER 'joomlauser'@'localhost' IDENTIFIED BY 'type_password_here';
Then grant the user full access to the database.
GRANT ALL ON joomladb.* TO 'joomlauser'@'localhost' IDENTIFIED BY 'type_user_password_here' WITH GRANT OPTION;
Finally, save your changes and exit.
FLUSH PRIVILEGES; EXIT;
Step 7: Install PHP and Modules
PHP is required to allow Joomla to function….. run the commands below to add OpenLiteSpeed repository to your system…
sudo bash wget -O - http://rpms.litespeedtech.com/debian/enable_lst_debain_repo.sh | bash
After adding the repository, run the commands PHP 7.1 and related modules..
sudo apt install lsphp71 lsphp71-common lsphp71-mysql lsphp71-tidy lsphp71-recode lsphp71-recode lsphp71-opcache
Next, run the commands below to create a symbolic link for PHP 7.1
sudo ln -sf /usr/local/lsws/lsphp71/bin/lsphp /usr/local/lsws/fcgi-bin/lsphp7
Step 8: Install Joomla
Now that OpenLiteSpeed is up, go and download Joomla content. To do that, run the commands below… you will download, extract and copy Joomla content to OpenLiteSpeed default document root.. The default Virtual Host Root is at /usr/local/lsws/Example
Next, visit Joomla site and download the latest package…. or run the commands below to download and extract Joomla content.
After downloading, run the commands below to extract the downloaded file and move it into a new Joomla root directory.
cd /tmp && wget https://github.com/joomla/joomla-cms/releases/download/3.8.0/Joomla_3.8.0-Stable-Full_Package.zip sudo apt-get install unzip sudo mkdir -p /usr/local/lsws/Example/joomla sudo unzip Joomla*.zip -d /usr/local/lsws/Example/joomla
Then run the commands below to set the correct permissions for Drupal to function properly.
sudo chown -R nobody:nogroup /usr/local/lsws/Example/joomla/ sudo chmod -R 755 /usr/local/lsws/Example/joomla/
After that, open your browser and browse to OpenLiteSpeed backend portal..
Go to the Dashboard and select Server Configuration ==> External App… then click Edit as shown in the image below…

Then scroll to Command, then change the command to reflect the symbolic link created above for PHP 7.1 and save.
$SERVER_ROOT/fcgi-bin/lsphp7

Next, go to Virtual Hosts ==> View to edit the current VirtualHost settings..

When the settings page opens, click the General tab and edit the Document Root location.. to where we installed our Drupal content in the drupal folder…
$VH_ROOT/joomla/

On the same General tab, edit the Index Files section and replace index.html with index.php shown below…. save the exit.

Next, go to Virtual Hosts ==> Rewrite and edit it… then turn on Rewrite Control to Yes

Next edit the Rweire Rules section and replace the code with the one below, then save and exit..
RewriteRule /.* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] RewriteCond %{REQUEST_URI} !^/index\.php RewriteCond %{REQUEST_URI} /component/|(/[^.]*|\.(php|html?|feed|pdf|vcf|raw))$ [NC] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule /.* /joomla/index.php [L]

Finally, click on the Listeners from the left menu, then edit to change the current port from 8088 to 80. Save after that.

If you can’t get Joomla default page show, go to Virtual Hosts ==> Context… then delete the /protected/ URL in the list below.. Restart the server and try again..

After restarting, open your browser and browse to the server hostname or IP address and you should see Joomla setup wizard.

Continue with the wizard until you’ve successfully configure Joomla.
Enjoy!
You may also like the post below: