MySQL database is installed on the host when installing Phabricator. We use this database as backend of our new Wordpress service.
$ sudo useradd -m -s /bin/bash wordpress
$ sudo su - wordpress
$ mysql -u root -p'NewFairs0910'
> CREATE DATABASE wordpress;
> CREATE USER nfadmin@localhost IDENTIFIED BY 'nfMysQL2015';
> GRANT ALL PRIVILEGES ON wordpress.* TO nfadmin@localhost;
> FLUSH PRIVILEGES;
> exit
$ wget http://wordpress.org/latest.tar.gz
$ tar zxf latest.tar.gz
$ sudo apt-get update
$ sudo apt-get install php5-gd libssh2-php
$ cd ~/wordpress
$ cp wp-config-sample.php wp-config.php
Modify wp-config.php according to above values for mysql:
define('DB_NAME', 'wordpress');
define('DB_USER', 'nfadmin');
define('DB_PASSWORD', 'nfMysQL2015');
define('DB_HOST', 'localhost');
Create file /etc/apache2/sites-available/wordpress.conf:
<VirtualHost *:80>
ServerName cms.newfairs-inc.com
DocumentRoot /home/wordpress/wordpress
</VirtualHost>
<Directory "/home/wordpress/wordpress">
Require all granted
</Directory>
Enable it:
cd /etc/apache2/sites-enabled
ln -s /etc/apache2/sites-available/wordpress.conf wordpress.conf
Then restart apache server: sudo service apache2 restart
.
Open "cms.newfairs-inc.com" in browser, start wordpress installation.
website title: Newfairs CMS
username: nfcms
pwd: nEwfAIrsAt6102
Note: A "Forbidden. You don't have permission to access /" error appears without "Require all granted".
After installation, install wordpress plugin "WordPress REST API (Version 2)" with wp-cli.phar:
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
chmod 755 wp-cli.phar
mv wp-cli.phar /usr/local/bin/wp
wp --info
sudo su - wordpress
cd wordpress
wp plugin list
wp plugin search rest
wp plugin install rest-api
Note:
We can't install plugin "WordPress REST API (Version 2)" through "Plugin -> Add New" in Wordpress web page.
It need ssh/ftp username and password. And the ssh port must be 22. While our ssh port is 222.
Ref:
https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-on-ubuntu-14-04
Reset Wordpress Admin password
su - wordpress
cd $HOME/wordpress # which is $WP_HOME
wp user list # where you can find the administrator's name is nfcms
wp user update nfcms --user_pass=nEwfAIrsAt6102
Ref: