Thursday, January 6, 2011

HTML5 code

1. Doctype
The actual doctype for any HTML5 document is simply
<!DOCTYPE html>
2.Declare charse
<meta charset="utf-8">

http://www.w3schools.com/html5/html5_reference.asp

W3C

Browser support HTML5

semantic:HTML5 do not work with IE 7 or older
video and audio, canvas: depend on codec and must be IE9
geolocation:mobile device ok, IE9 still not yet support

Use Chrome frame like browser plug-in for most browsers (including IE6 and up) so that it is feasible to haveoffline storage, geolocation services, background JavaScript execution, and other HTML5-like features
meta http-equiv="X-UA-Compatible" content="chrome=1"

http://diveintohtml5.org/
http://introducinghtml5.com/

Tuesday, January 4, 2011

Set up mod_jk and apache2

1. Install mod_jk

apt-get install libapache2-mod-jk

2. Under /etc/apache2/mods-enabled, create jk.conf and add the contents below.

# Sample mod_jk configuration
# for Apache 2
#
# for all commands/options available see the manual
# provided in libapache-mod-jk-doc package.

# The location where mod_jk will find the workers definitions
JkWorkersFile /etc/libapache2-mod-jk/workers.properties

# The location where mod_jk is going to place its log file
JkLogFile /var/log/apache2/mod_jk.log

# The log level:
# - info log will contain standard mod_jk activity (default).
# - warn log will contain non fatal error reports.
# - error log will contain also error reports.
# - debug log will contain all information on mod_jk activity
# - trace log will contain all tracing information on mod_jk activity
JkLogLevel info


# Assign specific URLs to Tomcat. In general the structure of a
# JkMount directive is: JkMount [URL prefix] [Worker name]


# send all requests ending in .jsp to ajp13_worker
# send all requests ending /servlet to ajp13_worker
#JkMount /*/servlet/ ajp13_worker

# JkUnmount directive acts as an opposite to JkMount and blocks access
# to a particular URL. The purpose is to be able to filter out the
# particular content types from mounted context.

# do not send requests ending with .gif to ajp13_worker
#JkUnMount /servlet/*.gif ajp13_worker


# JkMount / JkUnMount directives can also be used inside
# sections of your httpd.conf file.

3. Configure workers.
Under /etc/libapache2-mod-jk, create workers.properties and add the contents below. Normally this file already existed there, what you should do is checking the tomcat-home and jvm path correctly or not.


# workers.properties -
#
# This file is a simplified version of the workers.properties supplied
# with the upstream sources. The jni inprocess worker (not build in the
# debian package) section and the ajp12 (deprecated) section are removed.
#
# As a general note, the characters $( and ) are used internally to define
# macros. Do not use them in your own configuration!!!
#
# Whenever you see a set of lines such as:
# x=value
# y=$(x)\something
#
# the final value for y will be value\something
#
# Normaly all you will need to do is un-comment and modify the first three
# properties, i.e. workers.tomcat_home, workers.java_home and ps.
# Most of the configuration is derived from these.
#
# When you are done updating workers.tomcat_home, workers.java_home and ps
# you should have 3 workers configured:
#
# - An ajp13 worker that connects to localhost:8009
# - A load balancer worker
#
#

# OPTIONS ( very important for jni mode )

#
# workers.tomcat_home should point to the location where you
# installed tomcat. This is where you have your conf, webapps and lib
# directories.
#
workers.tomcat_home=/usr/local/tomcat

#
# workers.java_home should point to your Java installation. Normally
# you should have a bin and lib directories beneath it.
#
workers.java_home=/usr/lib/jvm/java-6-sun

#
# You should configure your environment slash... ps=\ on NT and / on UNIX
# and maybe something different elsewhere.
#
ps=/

#
#------ ADVANCED MODE ------------------------------------------------
#---------------------------------------------------------------------
#

#
#------ worker list ------------------------------------------
#---------------------------------------------------------------------
#
#
# The workers that your plugins should create and work with
#
worker.list=ajp13_worker

#
#------ ajp13_worker WORKER DEFINITION ------------------------------
#---------------------------------------------------------------------
#

#
# Defining a worker named ajp13_worker and of type ajp13
# Note that the name and the type do not have to match.
#
worker.ajp13_worker.port=8009
worker.ajp13_worker.host=localhost
worker.ajp13_worker.type=ajp13
#
# Specifies the load balance factor when used with
# a load balancing worker.
# Note:
# ----> lbfactor must be > 0
# ----> Low lbfactor means less work done by the worker.
worker.ajp13_worker.lbfactor=1

#
# Specify the size of the open connection cache.
#worker.ajp13_worker.cachesize

#
#------ DEFAULT LOAD BALANCER WORKER DEFINITION ----------------------
#---------------------------------------------------------------------
#

#
# The loadbalancer (type lb) workers perform wighted round-robin
# load balancing with sticky sessions.
# Note:
# ----> If a worker dies, the load balancer will check its state
# once in a while. Until then all work is redirected to peer
# workers.
worker.loadbalancer.type=lb
worker.loadbalancer.balance_workers=ajp13_worker


4.Configure the URI to worker mapping.
for example

ServerAdmin dang@company.net
ServerName example.company.net
DocumentRoot /home/lamp/webroot/nanocycle
JkMount /*.jsp ajp13_worker
JkMount /routecalc* ajp13_worker
JkMount /Logger* ajp13_worker
JkMount /Params* ajp13_worker

Options FollowSymLinks
AllowOverride None


Options FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all


deny from all

DirectoryIndex index.php index.html index.jsp
LogLevel error
CustomLog /var/log/apache2/access.log combined
ServerSignature Off


5.Enable worker in tomcat
Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />

config a host for worker, if use localhost, noneed
otherwise need create a new one:

forexample, a virtualhost for nanocylebooking
cause jk port call locally, add a record in host file, to define a local ip for nanocycle, then in worker.properties, connect to nanocycle like locally

nanocycle.cbdweb.net


6. Restart apache,tomcat
# /etc/init.d/apache2 restart

For Alexander cua me

Mai den hom nay me moi co thoi gian ngoi viet vai dong cho Alex cua me. Ky nghi dai da qua va hai me con minh moi sang phai thuc day som di lam, vat va cho con ha nhung Alex ngoan lam ne, moi sang nghe tieng alarm bao thuc cua ba la me thay con cung thuc day trong bung me roi khong giong nhu me phai cho ba keu ha.

Alex cua me da buoc vao tuan thu 21 roi day nhe, hom di sieu am kiem tra suc khoe cua con, moi thu deu ok dong thoi biet duoc con la mot cau be dang yeu, ba con vui mung du lam, me cung vui lay ay nhe. Alex cua me thuc la hieu dong, moving around all the time, con biet tu play o trong bung me nhe, dua mot tay len nam roi nam hai tay lai voi nhau nhe, roi kick me ne, cuon tron lai ne, den noi the doctor cung lac dau quay quay khi sieu am cho con, chac tinh tinh con giong ba nhu duc roi. Me nhin thay khuon mat va doi mat to cua con, me doan se giong daddy day, nhat dinh Alex se dep trai va rat lau ca day. Moi ngay me deu mong cho nhung cai dap va ngung nguay cua Alex trong bung me, me yeu Alex vo cung, ba con cung yeu con lam. Tu ngay me mang bau Alex, ba khong cho me lam gi ca, tu viec di cho, nau an va rua chen, giat do, don dep nha cua mac du tu truoc den gio ba rat it lam may chuyen do. The con moi biet la ba con yeu con den nhuong nao. Ngu ngoan chong lon nhe Alex cua ba me. Cau mong con khoe manh, binh yen suot 1/2 chang duong con lai de den voi ba me.
Yeu con nhieu nhieu nhieu.


Origin and Meaning of the Name Alexander
Gender:Boy
Origin:Greek
Meaning:Defending men
Pronunciation:(ah lek ZAND ur) [Guide]
Form of:Alexandros
Miscellaneous Info for Alexander
Categories:
Biblical Names, Scandinavian Names, Albanian Names, Australian Names, Canadian Names, Austrian Names, Christian Names, American Names, Dutch Names, English Names, German Names, Greek Names, Middle Names
Used in: Dutch, English, German, Hungarian and Slovak speaking countries
Additional info:

Anglicised version of the Greek name Alexandros.

Alexander appears in the Bible as the one who helps Jesus bear the cross on the journey to Calvary.

Alexander the Great was an ancient Macedon king. Greece was unified by his father, Philip II, but Alexander went on to extend the Macedon empire eastwards to the periphery of modern India.

There have also been two kings of Scotland named Alexander, and three emperors of Russia. Eight popes have been named Alexander. It is also the name of the first king of Yugoslavia and the current pretender to the throne.

Alexander Graham Bell was the inventor of the telephone, and Alexander Fleming discovered penicillin. The name was also borne by poet Alexander Pope, Russian author Alexander Pushkin, Russian composer Alexander Scriabin and former US Secretary of State under President Reagan, Alexander Haig.