Install: Quick Install Mediawiki on Openlitespeed
After you install OpenLiteSpeed, follow the instructions below to get your Mediawiki site working.
- Install PHP modules
- MariaDB Installation
- Create MediawikiDB Account
- Set Index File and rewrite rules
- Download and Extract Mediawiki
- Run the Mediawiki install script
Install PHP Modules
The easiest way to install PHP for OpenLiteSpeed (without ols1clk) 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.
Step 1. Install PHP
Use the following command to install PHP with the modules required:
yum install lsphp72 lsphp72-common lsphp72-gd lsphp72-process lsphp72-mbstring lsphp72-mysqlnd lsphp72-xml lsphp72-json
Note: There are multi versions of LSPHP (lsphp53, lsphp54, lsphp55, lsphp56, lsphp70, lsphp71, lsphp72) available.
Step 2. Set up PHP
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:
Name: lsphp → lsphp72
Address: uds://tmp/lshttpd/lsphp.sock → uds://tmp/lshttpd/lsphp72.sock
Command: $SERVER_ROOT/fcgi-bin/lsphp5 → $SERVER_ROOT/lsphp72/bin/lsphp
If you are not using RPM/APT, or you prefer to build PHP by yourself, see our instructions for building PHP here.
Step 3. Restart LSWS
When you are finished, click the Save icon to save your changes, then click the Graceful Restart button.
Step 4. PHP Verification (Optional)
Visit http://your_server_IP:8088/phpinfo.php
and make sure PHP Version shows 7.2.x
.
MariaDB Installation
Install MariDB:
yum install mariadb-server
systemctl start mariadb
Set new password:
/usr/bin/mysql_secure_installation
Enter $yourpassword
Create Mediawiki DB Account
mysql -u root -p$yourmysqlpassword
create database mediawiki;
grant all privileges on mediawiki.* to mediawiki@localhost identified by 'mediawiki';
exit;
Set Index File
An index file needs to be set in 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.
Download and Extract Mediawiki
To illustrate setting up Mediawiki on a vhost we’ll use the default virtual host, “Example”. You can download Mediawiki from command or their official download page. Please note that the document root of ‘Example’ virtual host is /usr/local/lsws/Example/html/.
cd /usr/local/lsws/Example/html
wget https://releases.wikimedia.org/mediawiki/1.30/mediawiki-1.30.0.tar.gz
tar -zxvf mediawiki*.tar.gz
mv mediawiki-* mediawiki
Grant the Web Server User Write Permission to Create wp-config.php During Installation
chown -R nobody:nobody mediawiki
Graceful Restart
When you are finished, click the Save icon to save your changes, then click the Graceful Restart button.
Run the Mediawiki Install Script
Step 1. Run Installation Script
Point your browser with default port to http://server_ip:8088/mediawiki
Step 2. Input General Configuration
If PHP packages pass the checking, you will start installation process.
Click Continue to next step.
Step 3. Database Configuration
We’ve already created the database above. Just enter details and click Continue.
Step 4. General Configuration
On this page the installer asks some general questions about the site. You can fill them in as required. An example configuration is given below:
- Site Name:
Litespeedtech
- Description:
Installation Demo
- Email:
example@example.com
- Username:
Litespeedtech
- Password:
test1234
Once done, click Continue.
Step 5. Create Installation File
You cannot use the Mediawiki installation until the installation file is generated.
vim LocalSettings.php
and paste the Mediawiki’s settings on it.
Set Up Mediawiki Caching (Optional)
Please refer to this article