WordPress

From KevinWiki

Revision as of 10:48, 31 December 2012 by Kevin (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

WordPress

WordPress is Weblog Software written using PHP. It uses MySQL database for storing data.

Installation

This instruction is for Ubuntu Linux 8.04 (possibly other versions).

  • Also install
$ sudo apt-get install php5-mysql php-pear 

Prerequisite

It requires installing Apache, PHP and MySQL (APM). Thus these must be installed before installing WordPress. The installation instruction can be found from APM.

Database Setup

CREATE DATABASE databasename; 
 
GRANT ALL PRIVILEGES ON `databasename`.* TO `username`@`hostname` IDENTIFIED BY 'password'; 
 
FLUSH PRIVILEGES;


Nginx

site file

server {
  listen      443;
  listen      127.0.0.1:443;
  server_name blog.localhost;
  root        /var/www/blog;
  index       index.php index.html index.htm;

  ssl on;
  ssl_certificate /etc/ssl/certs/server.crt;
  ssl_certificate_key /etc/ssl/private/server.key;

  location / {
    index     index.php index.html index.htm;
  }

  location ~ \.php$ {
    try_files $uri =404;
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_index index.php;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param SERVER_NAME $host;
  }
}

server {
  listen      80;
  listen      127.0.0.1:80;
  server_name blog.localhost;
  root        /var/www/blog;
  index       index.php index.html index.htm;

  location / {
    index     index.php index.html index.htm;
  }

  location ~ \.php$ {
    try_files $uri =404;
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_index index.php;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    fastcgi_param SERVER_NAME $host;
  }
}
Personal tools