Install WordPress on HP Cloud (Ubuntu, Nginx)

Advertisement

Here is step by step guide to install WordPress on HP Cloud with one Database Server and one Web server on Ubuntu and Nginx PHP5-FPM platform. There are some differences with the other kind of Public Cloud instances and HP Helion Public Cloud. We are writing about HP Helion Public Cloud, by the way; HP Cloud is not exactly the right word. You must read out previous guides – Router and Subnet Settings on HP Cloud and HP Cloud FTP/SFTP Setup, to make sure that the setup are right and publicly available.

Install WordPress on HP Cloud (Ubuntu, Nginx) : Basics

Two server configuration is considered to be difficult setup, yet this is the right setup for proper scaling. You will select Ubuntu latest LTS partner image while creating the instances (which is 14.04 at the time of writing). You can connect with the database server using the internal IP which looks like 10.0.0.x. You can disassociate the Floating IP to the database server instance when you do not need to SSH. This will ensure strict security.

Install WordPress on HP Cloud : Create Database Server

SSH to the instance with allotted and associated floating IP :

Vim

1

2

3

cd/path/to/hp-cloud/pem-file

ssh-iyour-downloaded-key.pem ubuntu@your-IP

#change your-downloaded-key.pem and your-IP

Get sudo privilege and cd to /root :

Vim

1

2

3

4

sudo su

#or

#sudo su-

cd/root

It will throw error as domain name is not set, but it will not matter. Update and upgrade :

Vim

1

2

3

4

5

6

apt-get update-y&&apt-get upgrade-y

apt-get dist-upgrade-y

##optionally reboot the instance

#reboot

##login again and run

#sudo su&&cd/root

Only install MySQL server :

Vim

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

apt-get install mysql-server

#you will be prompted forprovidingapassword

#edit the/etc/mysql/my.cnf file to configure the basic settings

#like log file,port number,etc.

#Forexample,to configure MySQL to listen forconnections from internal network,change the

Install WordPress on HP Cloud : Create Web Server

Rinse, wash, rinse and repeat! SSH to the instance with allotted and associated floating IP :

Vim

1

2

3

cd/path/to/hp-cloud/pem-file

ssh-iyour-downloaded-key.pem ubuntu@your-IP

#change your-downloaded-key.pem and your-IP

Get sudo privilege and cd to /root :

Vim

1

2

3

4

sudo su

#or

#sudo su-

cd/root

It will throw error as domain name is not set, but it will not matter. Update and upgrade :

Vim

1

2

3

4

5

6

apt-get update-y&&apt-get upgrade-y

apt-get dist-upgrade-y

##optionally reboot the instance

#reboot

##login again and run

#sudo su&&cd/root

Vim

1

netstat-natu

If port 80 is not listening, nginx can not open it. Simple. On HP Cloud, OS software based firewall is not much of importance. You can control from one level up. Build an Instance with Ubuntu 14.04 LTS AMD64 Partner Image. 4 GB is great, you can use 2 GB for lesser traffic. Practically, more the number of cores, nginx works more better plus xcache works faster with more RAM.

SSH to the instance. You are not root user, initially using sudo once, do not disturb the installation process. Yet, we are providing the commands with sudo. First, fully update the instance :

Yeah, php5-curl and php5-gd are repeats. Running commands twice will not harm. php5-fpm has installed, still we will run :

Vim

1

sudo apt-get install php5-fpm php5-gd libssh2-php mysql-client

We want a separate database server, so only mysql-client for testing connection like work. Open your IP address and default Debian Nginx webpage will show up. Run this command :

Advertisement

---

Vim

1

php-v

If you are facing lot of errors like :

Vim

1

2

3

Cannot adopt OID inUCD-SNMP-MIB:ucdShutdown::={ucdTraps2}

Cannot adopt OID inUCD-SNMP-MIB:ucdStart::={ucdTraps1}

Cannot adopt OID inLM-SENSORS-MIB:lmMiscSensorsTable::={lmSensors5}

then you need to install :

Vim

1

sudo apt-get install snmp

Run :

Vim

1

php-v

You’ll get a clean output like :

Vim

1

2

3

4

5

6

7

8

PHP5.5.9-1ubuntu4.5(cli)(built:Oct29201411:59:10)

Copyright(c)1997-2014The PHP Group

Zend Engine v2.5.0,Copyright(c)1998-2014Zend Technologies

with XCache v3.1.0,Copyright(c)2005-2013,by mOo

with Zend OPcache v7.0.3,Copyright(c)1999-2014,by Zend Technologies

with XCache Optimizer v3.1.0,Copyright(c)2005-2013,by mOo

with XCache Cacher v3.1.0,Copyright(c)2005-2013,by mOo

with XCache Coverager v3.1.0,Copyright(c)2005-2013,by mOo

snmp should get installed but basically it does not get installed in expected way; it depends on vendor, so we install it later.

The funny part is that, on HP cloud, the Ubuntu distribution has the public directory at /var/www/html not at /usr/share/nginx/html. Make sure where is your public directory by opening the nginx host file :

Vim

1

2

3

4

5

nano/etc/nginx/sites-available/default

#check where is directory

#add index.php among the index files

#you can tweak php5-fpm later by uncommenting

#or reading the doc

Basically your /etc/nginx/sites-available/default 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

server{

listen80default_server;

listen[::]:80default_server ipv6only=on;

#do not edit root location,this is example

root/usr/share/nginx/html;

index index.php index.html index.htm;

#Make site accessible from http://localhost/

#useafull domain name

server_name localhost;

location/{

#only uncomment,test by adding

#/index.php?q=$uri&$args

#later

try_files$uri$uri//index.php;

}

location/doc/{

alias/usr/share/doc/;

autoindex on;

allow127.0.0.1;

allow::1;

deny all;

}

error_page500502503504/50x.html;

location=/50x.html{

root/usr/share/nginx/html;

}

location~\.php${

try_files$uri=404;

fastcgi_pass unix:/var/run/php5-fpm.sock;

fastcgi_index index.php;

include fastcgi_params;

}

location~/\.ht{

deny all;

}

}

Open php.ini file :

Vim

1

2

3

4

5

6

7

nano/etc/php5/fpm/php.ini

#find the string

#cgi.fix_pathinfo=

#with^+W

#uncomment it

#value will be0

#save the file

Create this directory and chown it :

Vim

1

2

mkdir-p/spool/nginx/client_temp

sudo chown root:www-data/spool/nginx/client_temp-R

You will require this for our other guides on Nginx and PHP5-FPM. Run these now :

Now, at this point, you should do the DNS server work. Go to HP Helion Public Cloud DNS and add domain which you want. Add A record with the TTL value of 300 with the instance’s floating IP. There will be six name servers. Go to your domain resister’s control panel and add those six DNS. Go to webpagetest.org and test your domain name after 5 mins. It should show the WordPress installation page. On a different browser, open the domain name and continue the setup for WordPress. You will use the internal IP like 10.0.0.1 for the database server name. You will be prompted to copy a file and create it. Copy it and run these from terminal :

Vim

1

2

3

4

5

6

nano wp-config.php

#paste the stuffs

#write out

#^+O

#exit

#^+X

Continue setup on the browser. This is a secured setup. If you add this line in wp-config.php :

Next are advanced guides to tweak PHP5-FPM, tweak Nginx etc. – if you perform a search on our website, you will get all the guides. We have guide on XCache with W3 Total Cache Plugin too. We have not linked because this guide is a basic setup. With 2 x 2 GB server instances, after WordPress installation, you’ll get your site loading within 1.6 seconds on webpagetest.org without any tweak, cache plugin, CDN. If you increase the TTL of A value to 50 years, around 280 ms will get decreased. 6 name servers are unique about HP Cloud. You’ll never get more than a number of websites on one set of name servers. Rackspace has only two name servers. HP Cloud is far better than Rackspace in terms of performance and infrastructure level support. Hardware is HP Blade Servers.

If you can not install yourself, you can ask us, for a payment. When we will make the partnership with HP public, you do not have to bother about the backend.