WordPress

From KevinWiki

(Difference between revisions)
Jump to: navigation, search
m
 
(One intermediate revision not shown)
Line 5: Line 5:
== Installation ==
== Installation ==
This instruction is for Ubuntu Linux 8.04 (possibly other versions).
This instruction is for Ubuntu Linux 8.04 (possibly other versions).
 +
 +
* Also install
 +
$ sudo apt-get install php5-mysql php-pear
=== Prerequisite ===
=== Prerequisite ===
Line 13: Line 16:
CREATE DATABASE databasename;  
CREATE DATABASE databasename;  
   
   
-
GRANT ALL PRIVILEGES ON databasename.* TO 'username'@'hostname' IDENTIFIED BY 'password';  
+
GRANT ALL PRIVILEGES ON `databasename`.* TO `username`@`hostname` IDENTIFIED BY 'password';  
    
    
FLUSH PRIVILEGES;  
FLUSH PRIVILEGES;  
</source>
</source>
 +
 +
 +
== Nginx ==
 +
site file
 +
<pre>
 +
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;
 +
  }
 +
}
 +
</pre>

Latest revision as of 10:48, 31 December 2012

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