• 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 with Nginx on Rackspace Cloud Server

By Abhishek Ghosh August 12, 2014 8:08 am Updated on August 14, 2014

Install WordPress with Nginx on Rackspace Cloud Server

Advertisement

This guide shows how to install WordPress with Nginx on Ubuntu 14.04 with step by step commands and explanation of the steps of what we are doing. We usually publish a video guide separately which are available on YouTube and iTunes as Podcast. The reader should know minimum about nginx HTTP Server. This guide is intended for new nginx users, therefore we have not underwent complex steps or further tweak for optimization. One can use either an one GB server or even a 512 MB server to run WordPress with nginx – it is impossible with Apache to run a bigger site with lower RAM, but ngnix can handle efficiently.

 

Install WordPress with Nginx : Forewords

 

Nginx can be used for reverse proxying too. In this guide we are assuming that the reader has a WordPress website running on Apache server. So, we need to install WordPress with Nginx on Rackspace cloud server freshly. If one need to migrate, he/she have to upload the uploads and other contents on nginx server, import the posts, category and pages with WordPress default XML export-import feature. This will fully avoid any problem with permalink structure. We have kept the settings of nginx to default. There is no reason to make it complex by changing the default settings.

Install WordPress with Nginx on Rackspace Cloud Server

 

Install WordPress with Nginx on Rackspace Cloud Server

 

First, spin a server instance of your desired size. Save the password in some text editor. Copy the public IP address of the server. After the server is up and running; SSH to the server as root :

Advertisement

---

Vim
1
ssh root@your_IP_address

Vim
1
2
3
The authenticity of host '169.55.55.2 (169.55.55.2)' can't be established.
ECDSA key fingerprint is 89:95:46:1b:ab:37:11:8e:86:54:36:38:bb:3c:fa:c0.
Are you sure you want to continue connecting (yes/no)?

Save the key by hitting y as prompted. Update and upgrade the instance :

Vim
1
apt-get update && apt-get upgrade

For 512 MB instance, you might face a text based interface for boot configuration prompting you to select which one to keep. Simply hit the Return / Enter key – we will keep the things as suggested, to default.

Now, compare the installation method we do for installing WordPress with Apache, on Ubuntu 14.04 on Rackspace Cloud Server. Here we will install latest version of nginx first :

Vim
1
2
3
4
apt-get install python-software-properties
add-apt-repository ppa:nginx/stable
apt-get update
apt-get install nginx

and then all the needed components of PHP to run WordPress :

Vim
1
sudo apt-get install php5-fpm

Now we need to configure nginx. Basically we need not to touch the config file :

Vim
1
2
/etc/nginx/nginx.conf
# read http://wiki.nginx.org/NginxFullExample

We only need to edit the /etc/nginx/sites-available/default file, which is somewhat equivalent to Apache+Ubuntu’s /etc/apache2/sites-available/000-default.conf file. Open it :

Vim
1
2
3
nano /etc/nginx/sites-available/default
# write out with ^ + O
# exit with ^ + X

There will be lot of commented out lines, you must have active file looking 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
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
 
root /usr/share/nginx/html;
index index.php index.html index.htm;
 
# Make site accessible from http://localhost/
# use a full domain name
server_name localhost;
 
location / {
 
try_files $uri $uri/ /index.php /index.php?q=$uri&$args;
 
}
 
location /doc/ {
alias /usr/share/doc/;
autoindex on;
allow 127.0.0.1;
allow ::1;
deny all;
}
 
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
 
location ~ \.php$ {
 
# With php5-fpm:
                try_files $uri =404;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
 
# deny access to .htaccess files, if Apache's document root had
#
location ~ /\.ht {
deny all;
}
}

Carefully compare what I have changed. Give a bit time, it is worthy.

do a reload of nginx :

Vim
1
service nginx reload

Install everything we will need for running WordPress plus xCache for caching :

Vim
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

Make sure that we have lib ssh :

Vim
1
apt-get install php5-gd libssh2-php

restrat both ngnix and php-fpm :

Vim
1
2
service php5-fpm restart
service nginx restart

Now, compared to Apache, our document root is at /usr/share/nginx/html ; this is for a philosophical matter of Deb based distro. However, we think, we should not use www as the path anymore, because that was out of a mistake and copy of mistake. The permission at /usr/share/nginx/html is almost perfect and secure.

Now install MySQL server and Client (client is optional) :

Vim
1
apt-get install mysql-server mysql-client

type a password for MySQL root user and remember it. Read the MySQL

Vim
1
2
3
4
5
6
7
8
9
mysql -u root -p
# change wordpress, it is an example
CREATE DATABASE wordpress;
# wordpressuser should be changed, it is example, so is password
CREATE USER wordpressuser@localhost IDENTIFIED BY 'password';
# we will use localhost
GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpressuser'@'localhost';
FLUSH PRIVILEGES;
exit

Now delete the html file at root :

Vim
1
rm /usr/share/nginx/html/index.html

You can test PHP by creating an index.php file at root :

Vim
1
nano /usr/share/nginx/html/index.php

Fill up with :

If you point to your IP address, you’ll get the PHP info page. Delete it before installing WordPress :

Vim
1
rm /usr/share/nginx/html/index.php

Now, go to html directory :

Vim
1
cd /usr/share/nginx/html/

Download WordPress and untar :

Vim
1
2
3
4
5
6
wget http://wordpress.org/latest.tar.gz
tar -xzvf latest.tar.gz
cd wordpress
mv * .. && cd ..
rm -r wordpress latest.tar.gz && ls
# see the files

Edit wp-config :

Vim
1
cp wp-config-sample.php wp-config.php && nano wp-config.php

You will need to edit these :

Vim
1
2
3
4
5
6
7
8
9
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'wordpress');
 
/** MySQL database username */
define('DB_USER', 'wordpressuser');
 
/** MySQL database password */
define('DB_PASSWORD', 'password');

Run the WordPress installation script by visiting the IP or domain name. We need one more component to install, otherwise, you will lot of error if you run php5-fpm -v command.

Vim
1
2
3
sudo apt-get install snmp
# check
php5-fpm -v

Obviously, tweaking is required, but that is a separate chapter!

This Article Has Been Shared 321 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 with Nginx on Rackspace Cloud Server

  • Cloud Apps Compared : Google Apps and Microsoft Office 365

    Cloud Apps like e-mail or office apa are enormously used now.Cloud based services like Google Apps, Microsoft Office 365 offers a cost effective way for these.

  • Embedding Streaming Video From Rackspace Cloud Files in WordPress

    Embedding Streaming Video From Rackspace Cloud Files in WordPress needs few copy paste and click works to properly show on your webpage without any plugin.

  • Private Cloud Solutions : Risk Benefit Ratio

    Private Cloud Solutions are the real cloud solution as they implement the basic idea of ??cloud computing strictly but average cost is higher than public Cloud.

  • Guide for Using AppFog from Windows PC using Command Line Tools

    Guide for Using AppFog from Windows PC using Command Line Tools is intended for the users who are still using Windows PC and can not use shell commands easily.

  • Create Your Own Virtual Private Cloud with vCider : Introduction

    Create Your Own Virtual Private Cloud with vCider and pay just for the cost of Cloud Server in case you want a quick own Virtual Private Cloud setup easily.

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 (22.1K 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

  • Ways To Make Sure Your Online Course Outshine Others July 3, 2022
  • Will Smart Factories Become the New Assembly Line? July 2, 2022
  • The Cost of Doing Business as a Handyman July 1, 2022
  • Samsung Galaxy S22 Ultra: Long Term Review June 30, 2022
  • How to Make the Most of Your S Pen (S22 Ultra) June 29, 2022

About This Article

Cite this article as: Abhishek Ghosh, "Install WordPress with Nginx on Rackspace Cloud Server," in The Customize Windows, August 12, 2014, July 4, 2022, https://thecustomizewindows.com/2014/08/install-wordpress-nginx-rackspace-cloud-server/.

Source:The Customize Windows, JiMA.in

This website uses cookies. If you do not want to allow us to use cookies and/or non-personalized Ads, kindly clear browser cookies after closing this webpage.

Read Privacy Policy.

PC users can consult Corrine Chorney for Security.

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

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

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