• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here: Home » Install WordPress on Nginx With HHVM on Ubuntu Cloud Server

By Abhishek Ghosh December 31, 2014 9:59 am Updated on December 31, 2014

Install WordPress on Nginx With HHVM on Ubuntu Cloud Server

Advertisement

Here is Step by Step Guide to Install WordPress on Nginx With HHVM on Ubuntu Cloud Server. This simple and most easy standalone HHVM only guide. We talked about HipHop Virtual Machine or HHVM in order article. Normally, with Nginx, we use PHP5-FPM. This guide is how to install WordPress on Nginx with HHVM on Ubuntu Cloud Server without PHP5-FPM. You can use Dedicated or non-Cloud instances too, but we prefer using a separate application server to run MySQL.

 

Install WordPress on Nginx With HHVM : Basic Warnings

 

Do not try the method on Production Server first. Use test instances. You can open an account on DigitalOcean using this link, if you have a Credit Card and no Account on DigitalOcean. You’ll get $10 account credit plus you can add any coupon (if applicable) to increase your account’s credit. Enough to test our guides free of cost. Once you have used DigitalOcean for one month – we offer a SSL Certificate from Geotrust for one year. This complete package is for our own industry’s usage. Not for mass promotion. Quite practical – why you’ll waste money to test and learn how to install WordPress on Nginx with HHVM on Ubuntu Cloud Server? We will not get any money. People do not use these resources out of fear of getting scammed or may be they dislike that others will make money. The referral code is not ours, it is of a free software project. That is to assure you.

Back to topic – this is pure HHVM only instance. WordPress on Nginx With HHVM can have conflicts with some plugins. In next guide, we will show you to add PHP5-FPM as fallback. That is for preventing the conflict. That is why I asked to get a free account. We will change the database in next another guide. It is not practical to waste money only to test.

Advertisement

---

 

Install WordPress on Nginx With HHVM : Initial Steps

 

We are taking that you are using either DigitalOcean or Rackspace Cloud or HP Cloud to test. For HP Cloud, you need to set Ingress-Egress policy. HP Cloud is a bit hard and great to learn networking and OpenStack.

Spin a 4GB instance with Ubuntu 14.04 LTS image. First SSH to the instance :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
ssh root@IP-Address
##The authenticity of host '127.0.0.1' can't be established.
##ECDSA key fingerprint is
################
##Are you sure you want to continue connecting (yes/no)?
# type yes and hit the return key
# you will have the password, use it and change it
# upgrade and update
apt-get update -y && apt-get upgrade
# do a dist-upgrade
apt-get diet-upgrade -y
# reboot and login again
ssh root@IP-Address

First install Nginx and the other needed components :

Vim
1
2
3
4
apt-get install php5-gd libssh2-php
add-apt-repository -y ppa:nginx/stable
apt-get update -y
apt-get install nginx

As we will use a separate MySQL server (read how to run separate application server to run MySQL), we will optionally install :

Vim
1
apt-get install mysql-client

this is optional, needed only to access the applicational server from SSH. We have not installed :

Vim
1
apt-get install snmp php5-mysql php5-curl php5-gd php5-intl php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl php5-xcache

You can install them later on need – php5-fpm will get installed and you are a new user need not to care as I will make PHP-FPM not to handle PHP anymore. Our target is to install WordPress on Nginx with HHVM.

These are needed :

Vim
1
apt-get install -y unzip vim git-core curl wget build-essential

 

Install WordPress on Nginx With HHVM : Steps to Install HHVM and Configure Nginx

 

These are the commands for Ubuntu 14.04 :

Vim
1
2
3
4
wget -O - http://dl.hhvm.com/conf/hhvm.gpg.key | sudo apt-key add -
echo deb http://dl.hhvm.com/ubuntu trusty main | sudo tee /etc/apt/sources.list.d/hhvm.list
sudo apt-get update
sudo apt-get install hhvm

Install WordPress on Nginx With HHVM on Ubuntu Cloud Server

Go to /usr/share/nginx/html (public folder) and do these :

Vim
1
2
3
4
5
cd /usr/share/nginx/html && nano hhvm.php
# copy the things or type
<?php
echo  defined('HHVM_VERSION')?'Using HHVM':'Not using HHVM';
?>

We will configure HHVM first :

Vim
1
nano /etc/hhvm/config.hdf

Actually the file should look exactly like this :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Log {
  Level = Warning
  AlwaysLogUnhandledExceptions = true
  RuntimeErrorReportingLevel = 8191
}
MySQL {
  TypedResults = false
}
Eval {
  JitASize = 67108864
  JitAStubsSize = 67108864
  JitGlobalDataSize = 22554432
}

After that, we will edit the server.hdf file :

Vim
1
nano /etc/hhvm/server.hdf

The edited file should look like this :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
PidFile = /var/run/hhvm/pid
 
Server {
  Port = 80
  SourceRoot = /usr/share/nginx/html
  DefaultDocument = index.php
}
 
Log {
  Level = Warning
  AlwaysLogUnhandledExceptions = true
  RuntimeErrorReportingLevel = 8191
  UseLogFile = true
  UseSyslog = false
  File = /var/log/hhvm/error.log
  Access {
    * {
      File = /var/log/hhvm/access.log
      Format = %h %l %u % t "%r" %>s %b
    }
  }
}
 
Repo {
  Central {
    Path = /var/log/hhvm/.hhvm.hhbc
  }
}
 
#include "/usr/share/hhvm/hdf/static.mime-types.hdf"
StaticFile {
  FilesMatch {
    * {
      pattern = .*.(dll|exe)
      headers {
        * = Content-Disposition: attachment
      }
    }
  }
  Extensions : StaticMimeTypes
}
 
MySQL {
  TypedResults = false
}

Notice the root is /usr/share/nginx/html. Last work is to edit the HHVM server.conf file :

Vim
1
nano /etc/hhvm/server.conf

After Editing, it should look like this :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
PidFile = /var/run/hhvm/pid
Server {
  IP = 127.0.0.1
  Port = 9000
}
Log {
  Level = Warning
  AlwaysLogUnhandledExceptions = true
  RuntimeErrorReportingLevel = 8191
  UseLogFile = true
  UseSyslog = false
  File = /var/log/hhvm/error.log
  Access {
    * {
      File = /var/log/hhvm/access.log
      Format = %h %l %u % t "%r" %>s %b
    }
  }
}
Repo {
  Central {
    Path = /var/log/hhvm/.hhvm.hhbc
  }
}
StaticFile {
  FilesMatch {
    * {
      pattern = .*.(dll|exe)
      headers {
        * = Content-Disposition: attachment
      }
    }
  }
  Extensions {
    css = text/css
    gif = image/gif
    html = text/html
    jpe = image/jpeg
    jpeg = image/jpeg
    jpg = image/jpeg
    png = image/png
    tif = image/tiff
    tiff = image/tiff
    txt = text/plain
  }
}
MySQL {
  TypedResults = false
}
Eval {
        Jit = true
}
VirtualHost {
    * {
        Pattern = .*
        RewriteRules {
            * {
                 pattern = ^(.*)$
                 to = index.php$1
                 qsa = true
            }
        }
    }
}

Restart HHVM :

Vim
1
/etc/init.d/hhvm restart

You should see HHVM running at port 9000 :

Vim
1
netstat -plunt | grep hhvm

I am taking that, you have installed all the stuffs, so Nginx is running with PHP5-FPM, we will modify the configuration file to disable the use of PHP5-FPM. By default, the config file is normally located at /etc/nginx/sites-available/default, so open it and fully remove (comment out with #) these lines :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
#
#location ~ \.php$ {
#       fastcgi_split_path_info ^(.+\.php)(/.+)$;
#       # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
#
#       # With php5-cgi alone:
#       fastcgi_pass 127.0.0.1:9000;
#       # With php5-fpm:
#       fastcgi_pass unix:/var/run/php5-fpm.sock;
#       fastcgi_index index.php;
#       include fastcgi_params;
#}

You should have this instead :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
location / {
root /usr/share/nginx/html;
index index.php index.html index.htm;
# WordPress rewrite rules for permalinks
try_files $uri $uri/ /index.php?$args;
}
 
# php parsing by HHVM @ port 9000
location ~ .php$ {
root /usr/share/nginx/html;
try_files $uri =404;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_buffer_size 128k;
fastcgi_buffers 256 4k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
}

You must have this on that file :

Vim
1
2
...
        include hhvm.conf;

Now run this script for the sake of FPM :

Vim
1
/usr/share/hhvm/install_fastcgi.sh

There is another file, its the php.ini :

Vim
1
nano /etc/hhvm/php.ini

At least do these :

Vim
1
2
3
4
5
6
; php options
upload_max_filesize = 512M
post_max_size = 1024M
memory_limit = 2048M
register_globals = off
track_errors = yes

There are more two files, open /etc/hhvm/server.ini and make sure, whether these are present :

Vim
1
nano /etc/hhvm/server.ini

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
pid = /var/run/hhvm/pid
 
; hhvm specific
 
hhvm.server.file_socket=/var/run/hhvm/hhvm.sock
hhvm.server.type = fastcgi
hhvm.server.default_document = index.php
hhvm.log.level = Warning
hhvm.log.always_log_unhandled_exceptions = true
hhvm.log.runtime_error_reporting_level = 8191
hhvm.log.use_log_file = true
hhvm.log.file = /var/log/hhvm/error.log
hhvm.repo.central.path = /var/run/hhvm/hhvm.hhbc
hhvm.mysql.typed_results = false

Last file related to HHVM is :

Vim
1
/etc/hhvm/automagic.sh

make sure, whether these are present :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#! /bin/bash
# Use this script on a cron every minute to restart hhvm if it crashes
if [ "$1" == "" ]; then
        echo "Usage: `basename $0` svcname"
        exit 1
fi
 
SVCNAME=$1
PID="`cat /var/run/hhvm/hhvm.${SVCNAME}.pid`"
 
if [ "$PID" == "" ]; then
        echo No PID, starting up
        /etc/init.d/hhvm.${SVCNAME} start
else
        if [ "`ps ax -o pid | grep $PID`" == "" ]; then
                echo HHVM PID $PID not running, starting up
                # Stop, just in case, if crashed. Else you would get:
                #  * WARNING: hhvm.83 has already been started
                /etc/init.d/hhvm.${SVCNAME} stop
                /etc/init.d/hhvm.${SVCNAME} start
        fi
fi

You should make sure the run level is to default :

Vim
1
2
sudo update-rc.d nginx defaults
sudo update-rc.d hhvm defaults

Reload nginx :

Vim
1
service nginx restart

Test by visiting to that hhvm.php on browser (the file you created before) or do a cURL.
Installing WordPress is easy (compare to the steps for HHVM) :

Vim
1
2
3
4
5
cd /usr/share/nginx/html && rm -r *
wget http://wordpress.org/latest.zip && unzip l*
rm -r l* && cd wordpress
mv * .. && cd ..
rm -r wordpress

Point to your IP on browser, fill the things like a Kid, it will say, /usr/share/nginx/html is not writable, it will offer you a wp-config.php, you will do these after copying that :

Vim
1
2
3
4
5
6
7
8
cd /usr/share/nginx/html && nano wp-config.php
# paste the content
<pre>
 
Add this line in `wp-config.php` :
 
<pre>
define('FS_METHOD','direct');

Reason is written here. You have to optimize xCache and lot of stuffs.

Tagged With If this command is not found then do this: sudo apt-get install python-software-properties sudo add-apt-repository ppa:mapnik/boost sudo apt-key adv --recv-keys --keyserver hkp://keyserver ubuntu com:80 0x5a16e7281be7a449 echo deb http://dl hhvm com/ubunt

This Article Has Been Shared 697 Times!

Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to Install WordPress on Nginx With HHVM on Ubuntu Cloud Server

  • Get SSH Type Functions When Root Access is Restricted

    Get SSH Type Functions When Root Access is Restricted by Mounting your FTP location locally using SSHFS. This only can be done on some Cloud Computing Platform.

  • Cloud Computing Risk Analysis

    Cloud Computing Risk Analysis is an important administrative and marketing task. ENISA itself has a pdf guide. However, we will cover a generalized idea.

  • Private Cloud : 6 Errors in Cloud Integration

    Private Cloud integration strategy if not carried rightly can be fatal for a Company.Cost, technology, management of Private Cloud differs from brand to brand.

  • Node in Cloud Computing : What this Node Means ?

    Node in Cloud Computing is a connection point, either a redistribution point or an end point for data transmissions in general. Node in Cloud Computing is not a neologism.

  • Optimizing Page Speed for Rackspace Cloud Sites Plus Google Page Speed

    Optimizing Page Speed for Rackspace Cloud Sites Plus Google Page Speed gives some tips with live examples how you can actually improve your page loading speed.

Additionally, performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • What is Configuration Management February 5, 2023
  • What is ChatGPT? February 3, 2023
  • Zebronics Pixaplay 16 : Entry Level Movie Projector Review February 2, 2023
  • What is Voice User Interface (VUI) January 31, 2023
  • Proxy Server: Design Pattern in Programming January 30, 2023

About This Article

Cite this article as: Abhishek Ghosh, "Install WordPress on Nginx With HHVM on Ubuntu Cloud Server," in The Customize Windows, December 31, 2014, February 5, 2023, https://thecustomizewindows.com/2014/12/install-wordpress-nginx-hhvm-ubuntu-cloud-server/.

Source:The Customize Windows, JiMA.in

PC users can consult Corrine Chorney for Security.

Want to know more about us? Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy

We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
Do not sell my personal information.
Cookie SettingsAccept
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT