This guide will explain how to get up and running with Wordpress on LiteSpeed Web Server.
The easiest way to install PHP for LiteSpeed 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.
You can install some of the most commonly-used PHP 7.1 packages and modules for LiteSpeed. Use the following command:
sudo yum install lsphp71 lsphp71-mysqlnd lsphp71-common lsphp71-gd lsphp71-pdo lsphp71-process lsphp71-mbstring lsphp71-mcrypt lsphp71-opcache lsphp71-bcmath lsphp71-xml lsphp71-soap lsphp71-json -y
Visit http://your_server_IP:7080
. Navigate to Server Configuration > External app, then click the second icon Edit on the right hand side in order to edit this application.
Modify:
lsphp71
$SERVER_ROOT/lsphp71/bin/lsphp
When you are finished, click the Save icon to save your changes, then click the Graceful Restart button.
Visit http://your_server_IP/phpinfo.php
and make sure PHP Version shows 7.1.x
.
Install MariaDB:
sudo yum install mariadb-server sudo systemctl start mariadb
Set new password:
/usr/bin/mysql_secure_installation
Enter $yourpassword
Create the Wordpress database and your Wordpress user/password:
mysql -u root -p$yourmysqlpassword create database wordpress; grant all privileges on wordpress.* to wordpress@localhost identified by 'wordpress'; exit;
Note: For security purposes, you should use a Wordpress username and password that are different than our example.
An index file needs to be set in the LiteSpeed Web Admin Console. Navigate to Virtual Hosts > Select Virtual Host from List > General > Index Files, click Edit in the top right corner, and enter index.html,index.php in the Index Files box.
To illustrate setting up Wordpress on a vhost we'll use the default virtual host, “Example”. You can download Wordpress from their official download page.
Please note that the document root of 'Example' virtual host is /usr/local/lsws/Example/http/
unzip latest.zip mv wordpress/* .
Open the browser with URL http://server_IP:8088/
Once you open the url in browser you will see this window:
As you can see, WordPress will ask all database related information on next step and will create wp-config.php
file using this information. If for some reasons (mostly permissions issues) WordPress is not able to create this file, it will provide you with data which you can copy and manually create wp-config.php
file inside your WordPress home.
We've created the database above. Just enter the database details and click 'Submit'. If the WordPress installer is successfully able to connect to the database, it will start the installation process.
If everything works out great, just click 'Run the install' and WordPress will perform the installation.
WordPress will now ask you information regarding your blog/site, like whats the blog name, username you want to use and password, example configurations:
If you are satisfied with the details click 'Install WordPress'.
WordPress is now successfully installed, you can browse the home at http://server_IP:8088/ and wordpress admin at http://server_IP:8088/wp-admin