• 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 » Installing WordPress With NGINX on Debian on Rackspace Cloud Server

By Abhishek Ghosh March 7, 2014 11:16 am Updated on March 7, 2014

Installing WordPress With NGINX on Debian on Rackspace Cloud Server

Advertisement

Installing WordPress with NGINX web server on Debian Operating System on Rackspace Cloud Server demands some guide vs Apache2.0. Here is step by step guide. The reason why installing WordPress with NGINX web server on Debian Operating System on Rackspace Cloud Server will require additional help even for the advanced users has multiple reasons – no, managed Rackspace Cloud Server now actually supports NGINX. That reason to guide has been obsolete now. Among various reasons, most common reason is – frankly we are more used with Apache Web Server than NGINX web server. There are many styles of installation and optimization.

 

Installing WordPress With NGINX on Debian : Previous Guides and More Resources

 

Those who are fully new, please install and play either with a mock setup or with VirtualBox on your Mac or PC. Even if you are using Debian OS on PC, do not directly do the trial and errors. May be, you are actually shifting WordPress from Apache to nginx Web Server. May be, you are going to install WordPress with PostgreSQL. Actually we have discussed before on how to install nginx on Rackspace Cloud Server with Centmin Mod Nginx Auto Installer easily. There was another guide on installing Nginx with PHP5, MySQL on Rackspace Cloud Server.

With time, we need to update the guides as the packages changes, Rackspace specially upgrades their available services.

Advertisement

---

 

Steps for Installing WordPress With NGINX on Debian on Rackspace Cloud Server

 

To import the MySQL dump, in case you are shifting, you can run rsync to sync between the two servers. We however is describing the steps in this guide for installing WordPress with NGINX on Debian on Rackspace Cloud Server for a fresh copy, not transfer case.

We will suggest to create an user :

Vim
1
2
3
4
5
6
# henceforth, hash is used to indicate our comment
# line with hash are not commands & lines without hash are single commands.
# you can combine two commands with &&
# we use hash like commenting out, it is easy to create bash scripts for the advanced users
useradd -m <username>
passwd <username>

Routine work is to run three commands :

Vim
1
2
3
apt-get update
apt-get dist-upgrade
reboot

You will SSH with user account and do the works. This is safer method. Actually you can toggle permission to limit access :

Vim
1
2
3
4
5
6
7
nano /etc/ssh/sshd_conf
# alternatively open with vim
vi /etc/ssh/sshd_conf
# find the line
PermitRootLogin yes
# change it to
PermitRootLogin no

In this way, you can use su - to run commands with privilege only with password. UFW (Uncomplicated Firewall) is very nice to setup Firewall with few commands :

Vim
1
2
3
4
5
6
7
# install the package
apt-get install ufw
# let us configure
ufw allow www
ufw allow ssh
ufw default deny
ufw enable

This is basic setup. It is, probably safe to harden nginx from this Gist. As everyone knows, we need to add backports/dot deb on Debian for getting updated nginx packages :

Vim
1
2
3
4
5
6
7
echo 'deb http://backports.debian.org/debian-backports squeeze-backports main' >> /etc/apt/sources.list.d/backports.list
echo 'deb http://packages.dotdeb.org stable all' >> /etc/apt/sources.list.d/DotDeb.list
echo 'deb-src http://packages.dotdeb.org stable all' >> /etc/apt/sources.list.d/DotDeb.list
wget http://www.dotdeb.org/dotdeb.gpg
cat dotdeb.gpg | sudo apt-key add -
rm dotdeb.gpg
sudo apt-get update

The echo method is better than editing /etc/apt/sources.list.d file. Kevin Carter (Rackspace) initially wrote it and an user named Nick fixed it. It is quite good idea to use echo like we do on OS X. For this kind of efficiency, honestly we suggest for managed Rackspace. Understand it – to fix your broken bone, it will take 10 minutes for me but fixing server stuff will demand 30 minutes. Despite I am using UNIX for ~20 years, even before I entered Medical School. Regular exposure makes someone better in prototype work. What so ever, install nginx :

Vim
1
apt-get install nginx-full

Now edit the configuration file :

Vim
1
nano /etc/nginx/nginx.conf

Another gist is here to check the basic configuration.

Installing WordPress With NGINX on Debian on Rackspace Cloud Server

Vim
1
2
3
4
5
6
7
# multistep commands
mkdir -p /var/www/domain/httpdocs
mkdir /var/www/domain/logs
chown -R www-data:www-data /var/www/
ln -s /etc/nginx/sites-available/sitename /etc/nginx/sites-enabled/sitename
# sitename can be sitename.tld, sitename.conf etc. Restart.
service nginx restart

That file, at minimum should have this prototype configuration.

You must edit your Domain™s DNS records and point the A records to your server™s IP address to make it working. After propagation, browser can open the sites / contents located at var/www/domain/httpdocs.

We need to install MySQL and other stuffs :

Vim
1
2
apt-get install mysql-server-5.5
apt-get install php5-fpm php5-mysql php5-apc php5-xsl php5-xmlrpc php5-sqlite php5-curl php5-gd php5-tidy

We need now to create our WordPress vhost config, in example case it is /etc/nginx/sites-available/sitename ” and edit as we described above as you can host multiple websites. Now create a database :

Vim
1
2
3
4
5
mysql -u root -p
CREATE DATABASE namedb;
GRANT ALL PRIVILEGES ON namedb.* TO "namedb_user_name"@"localhost" IDENTIFIED BY "password";
FLUSH PRIVILEGES;
EXIT

Depending on number of sites, location will vary, go to :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
cd /etc/nginx/sites-available/sitename
wget http://wordpress.org/latest.tar.gz
tar -xzvf latest.tar.gz
cd wordpress
mv * .
# above command might need double dot instead of single for linux
cd ..
rm -r wordpress
# Edit wp-config file
nano wp-config-sample.php
# give the details
# save as wp-config.php
# follow normal wordpress installation
# https://codex.wordpress.org/Installing_WordPress

For W3 Super Cache, we need to install Varnish :

Vim
1
2
3
4
5
curl http://repo.varnish-cache.org/debian/GPG-key.txt | apt-key add -
echo "deb http://repo.varnish-cache.org/debian/ <version-name> varnish-3.0" >> /etc/apt/sources.list
apt-get update
apt-get install varnish
# replace version-name with wheezy or what you are using

Polishing varnish is important! But we will not go in to details here, just the minimum :

Vim
1
2
3
4
5
6
7
8
sudo nano /etc/default/varnish
# configaration file should match
 
DAEMON_OPTS="-a :80
             -T localhost:6082
             -f /etc/varnish/default.vcl
             -S /etc/varnish/secret
             -s malloc,256m"

After saving, exit and edit this file :

Vim
1
sudo nano /etc/varnish/default.vcl

It should look like this :

Vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
backend default {
    .host = "127.0.0.1";
    .port = "8080";
}
 
sub vcl_recv {
        if (!(req.url ~ "wp-(login|admin)")) {
                unset req.http.cookie;
        }
}
 
sub vcl_fetch {
        if (!(req.url ~ "wp-(login|admin)")) {
                unset beresp.http.set-cookie;
        }
}

We will polish varnish, apc; but that is another longer story. This is the minimum setup for WordPress with NGNIX.

Tagged With compoundpv5 , expect86y , followcz8 , honorhjv , pictured8s1
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 Installing WordPress With NGINX on Debian on Rackspace Cloud Server

  • Nginx WordPress Installation Guide (All Steps)

    This is a Full Nginx WordPress Installation Guide With All the Steps, Including Some Optimization and Setup Which is Compatible With WordPress DOT ORG Example Settings For Nginx.

  • WordPress Multisite on Nginx on Ubuntu 14.04 on HP Cloud

    Here is a Step by Step Guide on Setting Up WordPress Multisite on Nginx on Ubuntu 14.04 on HP Cloud with All Commands and the Configuration.

  • How to Install WordPress : Ubuntu 16.04, Nginx, PHP7-FPM

    Here is Step by Step Guide on How to Install WordPress on Ubuntu 16.04, Nginx, PHP7-FPM, memcached & Percona MySQL 5.7 on Cloud Server or VPS.

  • Install WordPress on HP Cloud (Ubuntu, Nginx)

    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.

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

  • Hybrid Multi-Cloud Environments Are Becoming UbiquitousJuly 12, 2023
  • Data Protection on the InternetJuly 12, 2023
  • Basics of BJT TransistorJuly 11, 2023
  • What is Confidential Computing?July 11, 2023
  • How a MOSFET WorksJuly 10, 2023
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