This post shows students and new users the steps to install WordPress CMS on Ubuntu Linux with OpenLiteSpeed web server. When webmasters think of hosting a WordPress website, most will choose between Apache or Nginx web servers.
Few people have heard of OpenLiteSpeed, not because it’s bad, but because it’s not widely used and not popular yet. There are many good things that have been written about OpenLiteSpeed, and if you want to try it yourself, continue below.
OpenLiteSpeed is an open source web server developed by LiteSpeed Technology. It is designed to be lightweight and comes with an administration panel to easily manage the server from your favorite web browsers.
If you want to run your WordPress website on OpenLiteSpeed instead of Apache or Nginx, continue below to learn how to install and run WordPress.
How to install OpenLiteSpeed on Ubuntu Linux
We have written a post about installing OpenLiteSpeed on Ubuntu Linux. Before installing WordPress, click the link below to install OpenLiteSpeed.
This post below shows you how to install OpenLiteSpeed, the latest version of PHP and MariaDB. Those three components are required to run WordPress.
How to install OpenLiteSpeed on Ubuntu Linux
After installing OpenLiteSpeed, continue below.
How to download WordPress on Ubuntu Linux for OpenLiteSpeed
Now that OpenLiteSpeed is installed, go ahead and download the package to install it. Run the following commands to download the latest version of WordPress.
cd /tmp wget https://wordpress.org/latest.tar.gz tar -zxvf latest.tar.gz
After extracting the WordPress archive, move the WordPress content to OpenLiteSpeed’s default VirtualHost directory.
sudo mv /tmp/wordpress /usr/local/lsws/Example/wordpress
Then run the following commands to change the WordPress folder permissions to run on OpenLiteSpeed.
sudo chown -R nobody:nogroup /usr/local/lsws/Example/wordpress/ sudo chmod -R 755 /usr/local/lsws/Example/wordpress/
How to create a WordPress database in Ubuntu
At this point, we are ready to create a WordPress database. As mentioned above, WordPress uses databases to store its content.
To create a database for WordPress, run the following commands:
sudo mysql -u root -p
Then create a database called wpdb
CREATE DATABASE wpdb;
Next, create a database user named wpdbuser and set password
CREATE USER 'wpdbuser'@'localhost' IDENTIFIED BY 'new_password_here';
Then grant the user full access to the database.
GRANT ALL ON wpdb.* TO 'wpdbuser'@'localhost' WITH GRANT OPTION;
Finally, save your changes and exit.
FLUSH PRIVILEGES; EXIT;
How to configure OpenLiteSpeed to be compatible with WordPress
Next, log into the OpenLiteSpeed admin panel to configure your WordPress settings.
https://localhost:7080/login.php
Login with the administrator login details above.
Then edit the Document root to point to the WordPress folder created earlier.
$VH_ROOT/wordpress/
index.php
Save your change.
RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L]
http://localhost
A WordPress setup wizard should appear. Follow the wizard to complete the setup.
- Database name
- Database username
- Database password
- Database host
- Table prefix (if you want to run more than one WordPress in a single database)
The wizard will use the information in the database to create a wp-config.php file in WordPress root folder.
If for some reason this automatic file creation doesn’t work, don’t worry… All it does is fill in the database information in a configuration file. You can also just open wp-config-sample.php in a text editor, fill in your information and save it as wp-config.php.
Conclusion:
In this tutorial we have seen how to install WordPress on Ubuntu Linux with the OpenLiteSpeed web server. If you find any errors above or have something to add, please use the comment form below.