How to Install WordPress on Nginx + HHVM VPS
| |Just a short tutorial with pictures about how to install a WordPress on Ubuntu VPS running Nginx, HHVM and MySQL. Using HHVM replacing PHP is somehow believed can server website faster and it is very lightweight for server’s resources. While not many PHP scripts are made compatible, WordPress is claimed compatible with HHVM (since version 3.9). So if you want to build fast-loading a WordPress blog using bleeding edge technology, try running it with HHVM.
Building HHVM + Nginx Server
Step 1 – Follow all steps in my previous tutorial and make sure you have installed it correctly.
Read:
How to Install Nginx, HHVM and MySQL on Ubuntu 15.04
Step 2 – Create new web directory for you WordPress blog. In this example I use my a sub-domain (coz I have no spare idle domain), feel free to replace it with your own.
mkdir -p /var/www/example.org chmod -R 755 /var/www/example.org chown -R www-data:www-data /var/www/example.org
Replace example.org with your own domain / subdomain name, in my case it looks like this:
Step 3 – Now let’s create new virtual hosts file for your upcoming WordPress site:
nano /etc/nginx/sites-available/example.org.conf
then copy paste this configuration:
server { listen 80; server_name example.org; include hhvm.conf; access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; root /var/www/example.org; index index.php; location / { try_files $uri $uri/ /index.php?$args; } }
In my case it looks like this:
Now save changes and exit the editor (in Nano it is Control+O to save then Control+X to exit).
Step 4 – Now we need to create symbolic link to the new virtual hosts file so it can be enabled:
ln -s /etc/nginx/sites-available/example.org.conf /etc/nginx/sites-enabled/example.org.conf
Next, restart Nginx:
service nginx restart service hhvm restart
pic:
Install WordPress
Step 1 – Obviously we have to firstly download WordPress to our vps:
wget http://wordpress.org/latest.tar.gz
Step 2 – Now copy latest.tar.gz file to your web directory and extract the main WordPress files inside that package while also removing the wordpress directory using this command:
cp latest.tar.gz /var/www/example.org cd /var/www/example.org tar -xzvf latest.tar.gz --strip-components=1
Step 3 – Login to MySQL as root then create new user, password and database name:
mysql -u root -p
then issue these command lines replacing “wordpress”, “dbuser” and “pass123456” with your own:
CREATE DATABASE wordpress; CREATE USER dbuser@localhost; GRANT ALL PRIVILEGES ON wordpress.* to dbuser@localhost IDENTIFIED BY 'pass123456'; FLUSH PRIVILEGES; quit
screenshot:
Step 4 – Rename wp-config-sample.php file to wp-config.php then edit it using your favorite editor like Nano:
mv wp-config-sample.php wp-config.php nano wp-config.php
then provide new MySQL credentials you’ve just created, here’s the example of mine:
Step 5 – Open up your favorite web browser and navigate to your domain which in my case is test.servermom.org and proceed with the installation procedure:
Hit the continue button then fill in all required fields:
That’s it. You can now login to WordPress Dashboard.
Enjoy your newly built WordPress site. Do not forget to follow me on Twitter or subscribe to my newsletter (via FeedBurner) so you’ll get noticed about new articles faster.
Recently I have ordered the VPS from Phi9 Web Host. After the installation of WordPress Nginx and HHVM. Nginx has made my site so fast.
Thank you for great article I really appreciate it 🙂
I always see “Welcome to nginx!” page, it doesn’t shows up the WordPress installation page.
Please help, I’m using Ubuntu 14.04.4 x64, as 15.04 image isn’t available on DO, I did try 15.10 x64, even this didn’t help.
Eagerly waiting for your reply.
You should double check your nginx .conf file and make sure the configuration is correct