Here is How To Install Nginx PHP5-FPM on HP Cloud. HP Cloud means HP Helion Public Cloud. It is basically very easy to work with HP Cloud. People fear HP Helion Public Cloud very much. The basic reason possibly is not understanding the basics of Security Group Rules. So, you need to read our previous guide on Router settings, rightly open the Ports (Port 80 and Port 443).
Install Nginx PHP5-FPM on HP Cloud : Needs
A sane operating system like OS X or any Linux or Unix Like OS. Microsoft Windows users can use PuTTY, but basically Windows is not very safe Operating System. It is practical to dual boot with minimum Ubuntu like easy to use Linux. We are writing while using OS X 10.10 with iTerm2+ZSH+Homebrew. PuTTY and iTerm2 has no difference on running commands on remote server. Neither there is difference in Ubuntu of Rackspace and HP Cloud.
Again, please make Security Group Rules right. If you are using Default, add new Rule to make it looking like :
---
1 | IngressIPv4TCP80 (HTTP)0.0.0.0/0 (CIDR) |
This is too wide open settings. Unless you know more, use this settings. Default is a bad name. Change the name to your-name-region
like name.
Install Nginx PHP5-FPM on HP Cloud : Steps
This guide is just a basic nginx, PHP5-FPM setup. Please run this command first :
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 :
1 2 3 4 | sudo apt-get update -y && sudo apt-get upgrade # check if there is anything suspicious, if not great # proceed. These lines with # are not commands sudo apt-get dist-upgrade -y |
We are making a web server for running PHP MySQL based web software like WordPress. Run these :
1 2 3 | sudo apt-get install python-software-properties # if it ask something, accept it apt-get install php5-common php5-mysqlnd php5-xmlrpc php5-curl php5-gd php5-cli php5-fpm php-pear php5-dev php5-imap php5-mcrypt |
Run auto-remove
to get rid off stuffs not needed :
1 | sudo apt-get autoremove |
Install Nginx :
1 2 3 4 | sudo add-apt-repository ppa:nginx/stable # accept anything if asked sudo apt-get update -y sudo apt-get install nginx |
Reboot the instance once as we have upgraded lot of stuffs :
1 | sudo reboot |
Again SSH to the instance. Install these things :
1 | apt-get install 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 |
Yeah, php5-curl
and php5-gd
are repeats. Running commands twice will not harm. php5-fpm
has installed, still we will run :
1 | sudo apt-get install php5-fpm php5-gd libssh2-php mysql-client |
I want a separate database server, so only mysql-client
for testing connection like work. If you want to install full MySQL, the steps will be like our guides on Rackspace. Perform a search on this website. Open your IP address and default Nginx webpage will show up. Run this command :
1 | php -v |
If you are facing lot of errors like :
1 2 3 | Cannot adopt OID in UCD-SNMP-MIB: ucdShutdown ::= { ucdTraps 2 } Cannot adopt OID in UCD-SNMP-MIB: ucdStart ::= { ucdTraps 1 } Cannot adopt OID in LM-SENSORS-MIB: lmMiscSensorsTable ::= { lmSensors 5 } |
then you need to install :
1 | sudo apt-get install snmp |
Run :
1 | php -v |
You’ll get a clean output like :
1 2 3 4 5 6 7 8 | PHP 5.5.9-1ubuntu4.5 (cli) (built: Oct 29 2014 11:59:10) Copyright (c) 1997-2014 The PHP Group Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend 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. I kept this for record :
1 | http://www.webpagetest.org/result/141203_ZV_1532/1/details/ |
117 ms is the response time. Its very fast. On other good hosts, you’ll get response time like this with huge tweak :
1 | http://www.webpagetest.org/result/141203_SM_156S/1/details/ |