Install:Quick Install WordPress
From OpenLiteSpeed Wiki
Revision as of 17:08, 13 November 2014 by Marmstrong (talk | contribs) (→Set up a MySQL database and user for WordPress)
After you install OpenLiteSpeed, follow the instructions below to get your WordPress site working.
Contents
- 1 Install PHP modules
- 2 Set up WordPress on a vhost
- 3 Download WordPress
- 4 Grant the web server user write permission to create wp-config.php during installation
- 5 Set up a MySQL database and user for WordPress
- 6 Add a rewrite rule in the vhost to make permalinking work
- 7 Graceful restart
- 8 Run the install script
Install PHP modules
The easiest way to install PHP for OpenLiteSpeed 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.
Use the following command to install PHP with the modules required:
yum install lsphp55 lsphp55-common lsphp55-gd lsphp55-process lsphp55-mbstring lsphp55-mysql
- Note: There are four versions of LSPHP (lsphp53, lsphp54, lsphp55, lsphp56) available.
Direct LSWS to the location of the installed PHP. (In this example, PHP 5.5 is installed by default in /usr/local/lsws/lsphp55/bin/lsphp
. Change the value of the WebAdmin console > External App > your external application > Command setting to reflect that.)
If you are not using RedHat or CentOS, or you prefer to build PHP by yourself, see our instructions for building PHP for WordPress here.
Set up WordPress on a vhost
- (Here we use the default virtual host "Example".)
- Go to the WebAdmin Console > Configuration > Virtual Hosts > Example > General > Index Files.
- Add "index.php".
Download WordPress
- Put WordPress in the virtual host document root: /usr/local/lsws/DEFAULT/html (This puts all the files in the right directory for running WordPress on the virtual host "Example".)
cd /usr/local/lsws/DEFAULT/html wget http://wordpress.org/latest.zip unzip latest.zip
Grant the web server user write permission to create wp-config.php during installation
chown nobody wordpress
Set up a MySQL database and user for WordPress
- First, install MySQL:
yum install mysql mysql-server
- Instructions for setting up the database can be found at http://codex.wordpress.org/Installing_WordPress#Using_the_MySQL_Client
Add a rewrite rule in the vhost to make permalinking work
- Go to the WebAdmin Console > Configuration > Virtual Hosts > Example > Rewrite.
- Enable Rewrite > Yes.
- Rewrite Rules >
RewriteBase /wordpress/ RewriteRule ^/index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /wordpress/index.php [L]
- "/wordpress" is the location WordPress was installed relative to the vhost docroot.
Graceful restart
- So the changes will take effect (Actions > Graceful Restart).
Run the install script
- Point your browser to http://server_ip:8088/wordpress/wp-admin/install.php