We use svn to control our trunk

  1. commite the trunk.
  2. clone the trunk from svn in service
    svn co your path /var/www/yourlocalhost

We use mysql

mysql> CREATE DATABSE
mysql> grant all privileges on 
mysql> flush privileges;

NOTE mysql is case-sensitive in different os.

config in trunk

config the connection config in php
e.g database user password and so on

nginx.config

vi /etc/nginx/nginx.conf
server {
    listen 80; // 
    server_name domain name ;
    root /var/www/yourpath;
    #access_log /var/log/nginx/kerenshou.com.access_log main;
    #error_log /var/log/nginx/kerenshou.com.error_log info;
    if ($http_user_agent ~* "qihoobot|Googlebot-Mobile|Googlebot-Image|Mediapartners-Google|Adsbot-Google|Feedfetcher-Google|Yahoo! Slurp|Yahoo! Slurp China|YoudaoBot|Sosospider|Sogou spider|Sogou web spider|MSNBot|ia_archiver|Tomato Bot")
    {
      return 403;
    }

    location ~ \.php$ {
        fastcgi_pass   127.0.0.1:9000;
    }

    location ~ .*\.(wma|wmv|asf|mp3|mmf|zip|rar|jpg|jpeg|gif|ico|png|js|css|swf|flv)$ {
        expires 24h;
        valid_referers none blocked *.(yourparch) (domain name);
        if ($invalid_referer) {
            return 403;
        }
    }
}
/etc/init.d/nginx reload

It works~