How to setup your wordpress website in nginx server
Tech-Today

How to setup your wordpress website in nginx server


Long ago I learned of the advantages of nginx over apache, just google it. Planned to migrate our sites but didn't manage to do it until last weekend. So here's what I did to do that:

I'm assuming you already have a functional wordpress with mysql setup and html / php files in /var/www/html (the usual).

First we need to install nginx and php:

sudo apt-get install nginx php5-fpm

Next, configure nginx virtual config, like in apache. Default config file is at /etc/nginx/sites-available/default, copy it and edit like below:

//copy
cp /etc/nginx/sites-available/default /etc/nginx/sites-available/my-site

//modify my-site
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;

root /var/www/html;
index index.php index.html index.htm;

server_name your_domain.com;

location / {
# try_files $uri $uri/ =404;
try_files $uri $uri/ /index.php?q=$uri&$args;
}

error_page 404 /404.html;

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}

location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}

//remove default enabled site
rm /etc/nginx/sites-enabled/default

//enable my-site
ln -s /etc/nginx/sites-available/my-site /etc/nginx/sites-enabled/

//restart or reload
sudo service nginx restart
sudo service php5-fpm restart

Your website should now be up and running in nginx.

*Keep your eye on missing comma ;.




- How To Handle An Xmlrcp Wordpress Attack On Nginx Server
I'm not really a system administrator and these steps are just based on my personal experience in securing our own wordpress websites. Lately there has been a lot of attacks on wordpress sites (since it's a popular framework) specially on windows...

- Configure Custom Wordpress Permalink
The following guidelines will help us debug a custom wordpress permalink. Normally we want the URL to be customized, has sense for SEO purposes but wordpress by default use the jurassic id system (page_id=xxx). Fortunately wordpress already offer this...

- How To Install Eclipse Plugin Using Available Sites And Eclipse Marketplace
This tutorial will teach us how to install eclipse plugins such as svn, egit, etc using available sites and eclipse marketplace. Note that I've done this on windows using eclipse-jee-juno. Installing eclipse plugins using available sites: 1.) To install...

- How To Install Apache2 Php5 And Mysql5 In Ubuntu 12.04
These are the set of scripts I executed in ubuntu to install the ff: 1.) apache2 2.) php5 3.) mysql5 >sudo apt-get install apache2 //installs in /etc/apache2 >sudo apt-get install php5 //installs in /etc/php5 >sudo apt-get install libapache2-mod-php5...

- How To Install Subversion And Websvn On Ubuntu 12.04
This write-up contains a set of instruction on how to install and configure svn as well as setup websvn on an ubuntu 12.04 machine. 1.) Install subversion and apache2 sudo apt-get install subversion sudo apt-get install apache2 sudo apt-get install libapache2-svn...



Tech-Today








.