Installation Of WordPress With OpenLiteSpeed

WordPress is a free and open-source blogging tool and a content management system (CMS) based on PHP and MySQL. It was released in 2003 under the second version of the GPL license. This tool combines simplicity for users and publishers which makes it flexible and easy to use. It is the most popular blogging system in use on the web at more than 60 million websites. WordPress is a powerful semantic publishing platform, it has a large set of features designed to help users to be a publisher on the internet as easy, pleasant and appealing as possible.

In this article, we will show you how to install WordPress instance using the OpenLiteSpeed web server.

To install OpenLiteSpeed, refer the following link.

WordPress features

We will start our article by listing some of the features that come as standard with WordPress:

  • WordPress is characterized by its simplicity, it so easy and quick to be online an start publishing.
  • You can create any type of website: a personal blog, a photoblog, a business website, a professional portfolio, a magazine or news website and many others. You can modify your website themes and extend them with plugins.
  • WordPress is easy to install and upgrade. You can manage your content, create draft, schedule publication and look at your post revisions.
  • You can make your content public or private, and secure posts and pages with a password.
  • WordPress supports an extended version of the Blogger API, MetaWeblog API and the MovableType API.

Create Database and Database user for WordPress

It is required to have a non-root user system with the “sudo” privileges before starting the installation. Also you must have an installed MySQL and OpenLiteSpeed systems.

Now we will start our installation, so we will create a database and database user for WordPress using the following command:

$ mysql -u root -p

You will be asked to enter the MariaDB administrative password, so we will be at the MariaDB prompt. Use the following command to create a database for our application by calling it “datawordp” (this is our choice you can choose other name)

CREATE DATABASE datawordp;

Now we will create a database user using the following command where we called it “datawordpuser”:

GRANT ALL ON datawordp.* TO datawordpuser@localhost IDENTIFIED BY 'Enter_your_password';

Don’t forget to choose a password and to replace “Enter_your_password” in the command above.

Use the following command to flush the made changes:

FLUSH PRIVILEGES;

Now exit the MariaDB prompt using the following command:

exit

Installation of the required extensions

After creating the database and the database user, and for the installation of the WordPress we will need to install some additional extensions. You will need just to type the following command:

$ sudo yum install lsphp56-gd lsphp56-process lsphp56-mbstring

The needed extensions are included in OpenLiteSpeed’s repository which will be after the installation available in your web server’s PHP instance.

Installation and configuration of the WordPress

We need now to modify the default virtual host that is presented in the openLiteSpeed configuration to be able to use it for the WordPress installation. So we will use the following command to log into the OpenLitespeed’s administrative interface:

https://your_server_domain_or_IP:7080

Select the “Virtual Hosts” from the “Configuration” item in the admin interface. Then click on the “View/edit” link which will enable you to edit the configuration of the virtual host.

After that, we will allow the index.php processing and we will do as fellow: click on the “General” tab for the virtual host and then clock on te “edit” button. Add the “index.php” before “index.html” in the field of valid index files to allow PHP index files. Then clock save.

Now we will start the installation and configuration of the WordPress. Click on the “rewrite” tab of the virtual host, then click on the “edit” button of the “rewrite control” table. Choose “yes” within the “enable rewrite” option. Click save and then you will be moved to the main rewrite menu. So click on the “edit” button for the rewrite rules table. Delete the existing rules and use the following to replace them:

RewriteRule ^/index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

Then click the save button.

To know that the WordPress has its own authentication system, and the OpenLiteSpeed has also some password protected areas. So it is important to remove the unused password protection. And we will do as fellow:

We start by clicking on the “security” tab, then click “delete” link next to “SampleProtectedArea” within the “Realms list” table. You will be asked to confirm the deletion so click the “yes” button. Then click on the “context” tab and delete the /protected/ context and confirm those changes by clicking on the “yes” button again.

Now under the “actions” item of the OpenLiteSpeed interface select the “Graceful Restart”:

12

Then you can check if you have any error in the “home” page. If there are some errors click on the “actions” and then “server log viewer” to get more information and know the reasons of those errors.

Before making the installation of the WordPress we have to clean up our virtual host and document root directories. So start by using the following command to delete the virtual host root directory:

$ cd /usr/local/lsws/DEFAULT

Then use the following command to remove the existing scripts in the “contexts” tab:

$ sudo rm cgi-bin/* fcgi-bin/*

And if the “fastcgi-bin/*” is already deleted in the previous section so you will get a warning. Then use the following command to remove the password and group files:

$ sudo rm conf/ht*

Type the following command to clear the contents of the document root directory:

$ sudo rm -rf html/*

Now we are ready to install the WordPress. Type the following command to start:

$ cd ~$ wget https://wordpress.org/latest.tar.gz

Extract the downloaded archive and give your directory by using the following commands:

$ tar xzvf latest.tar.gz$ cd wordpress

Then use the following command to copy the WordPress configuration file to “wp-config.php”.

$ cp wp-config-sample.php wp-config.php

Now use an editor to open the configuration file by using the following command:

$ vi wp-config.php

Find the settings for DB_name and DB_user and DB_password and change it as fellow:

// ** MySQL settings - You can get this info from your web host ** /
//** The name of the database for WordPress */
define('DB_NAME','datawordp'); 

/** MySQL database username */
define('DB_USER','datawordpuser'); 

/** MySQL database password */
define('DB_PASSWORD','Enter_your_password');

Save and close the file after making the changes.

Now we will use the following command to copy the files into our document root:

$ sudo cp -r ~/wordpress/* /usr/local/lsws/DEFAULT/html/

Use the following command to give permission of the entire directory structure to the user who runs the web server:

$ sudo chown -R nobody:nobody /usr/local/lsws/DEFAULT/html

After the installation we can get access to WordPress by going to our server’s domain or IP address using the following command:

http://your_server_domain_or_IP

and if you hadn’t switched to the port 80 during the OpenLiteSpeed installation, you can use the following command:

http://your_server_domain_or_IP:8088

You will get the first page of the WordPress installation asking you to select your language. So after choosing the language type continue. Then you will be asked to enter some information such: an administrative username, password, admin email account, a title of the site. After finishing this configuration you will be able to login using your created account and then you will be redirected to the WordPress admin dashboard, enabling you to configure your site which means that you have finished your installation.

Conclusion

In this article we showed you how to configure and install WordPress using the OpenLiteSpeed web server. This is beneficial for users who don’t have access to an SSH session that make their administration and modification easier.

LEAVE A REPLY

Please enter your comment!
Please enter your name here