Support Online
Skip to main content

Installing WordPress with OpenLiteSpeed ​​on CentOS 7

Keyword: OpenLiteSpeed WordPress installation

In this guide, you will learn step by step how to install high-performance WordPress using OpenLiteSpeed web server on CentOS 7 operating system. We will cover technical details such as OpenLiteSpeed's database, PHP settings and virtual server configuration.

What Will You Learn in This Guide?

  • Creating a database for WordPress on CentOS 7
  • How to install PHP extensions
  • Configuring virtual server settings via OpenLiteSpeed administration panel
  • How to install WordPress by optimizing it with OpenLiteSpeed

1. Creating a Database for WordPress

WordPress needs a database. So we need to configure MariaDB first.

mysql -u root -p
MariaDB yönetim paneline giriş yapar.
  • Type these commands to create a database and user:


CREATE DATABASE wordpress;
GRANT ALL ON wordpress.* TO wordpressuser@localhost IDENTIFIED BY 'guclu_sifre';
FLUSH PRIVILEGES;
EXIT;
  • These commands create a database named wordpress and grant access to the user named wordpressuser.

2. Installing PHP Extensions

  1. WordPress requires some additional PHP modules to work properly. These modules must be compatible with OpenLiteSpeed's PHP processor.

sudo yum install lsphp56-gd lsphp56-process lsphp56-mbstring
  • This command installs the necessary PHP modules and makes them compatible with OpenLiteSpeed.

3. OpenLiteSpeed Virtual Server Settings

  1. Use https://server\_ip\_addressi:7080 to log in to the OpenLiteSpeed administration panel. Enter administrator information.

3.1 Allowing Index.php File

  1. Go to Virtual Hosts → Example → General tab.
  • Add index.php to the "Index Files" section.

  • This setting allows WordPress to run its main function.


  1. To activate the Rewrite feature:

RewriteRule ^/index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
  • These rules are necessary for WordPress to function properly.

4. Restarting the Server

  1. We need to restart OpenLiteSpeed for the changes in the configurations to take effect.
  • Restart the server with Actions → Graceful Restart.

5. Preparing WordPress Files

  1. Download and configure the latest version of WordPress:

cd ~
wget https://wordpress.org/latest.tar.gz
tar xzvf latest.tar.gz
cp wordpress/wp-config-sample.php wordpress/wp-config.php
  1. Edit the wp-config.php file and enter the database information:


define('DB_NAME', 'wordpress');
define('DB_USER', 'wordpressuser');
define('DB_PASSWORD', 'guclu_sifre');
  1. Move the files to the web directory:

sudo cp -r ~/wordpress/* /usr/local/lsws/DEFAULT/html/
sudo chown -R nobody:nobody /usr/local/lsws/DEFAULT/html
  • We set the permissions correctly so that the web server can access the files.

Frequently Asked Questions (FAQ)

1. Why isn't my site opening? OpenLiteSpeed ​​uses port 8088 by default. If you have not set the port to 80, you may need to access it as http://IP:8088.

2. Is OpenLiteSpeed ​​faster than Apache? Yes, it is much more efficient, especially when it comes to PHP processing and caching (LSCache).

3. I forgot my admin panel password, what should I do? You can reset your password by running the following command from the terminal: /usr/local/lsws/admin/misc/admpass.sh

Result

WordPress, which we installed on CentOS 7 with OpenLiteSpeed, provides high performance and ease of management. With this guide, you have set up a safe and fast WordPress infrastructure step by step.

You can try GenixNode infrastructure now for your high-performance WordPress projects!