Categories: Uncategorized

[wodpress][nginx]How to migrate

Reference

Following URL shows how to migrate wordpress to new server.
http://phono.co.jp/note/wp-wordpress%E3%82%92%E4%B8%B8%E3%81%94%E3%81%A8%E7%A7%BB%E7%AE%A1%E3%81%95%E3%81%9B%E3%82%8B%E6%89%8B%E9%A0%86_1256 I’d like to show more information for migration to nginx server.

Install php5-fpm

$sudo apt-get install php5-cli php5-common php5-mysql php5-suhosin php5-gd
$sudo apt-get install php5-fpm php5-cgi php-pear php5-memcache php-apc
$sudo /etc/init.d/php5-fpm start
※http://gerardmcgarry.com/blog/how-install-php-fpm-nginx-ubuntu-1004-server

ngixn setting

$sudo vim /etc/nginx/sites-enabled/wordpress
upstream phpfpm {
        server unix:/var/run/php-fpm.sock;
}

server{
        root /home/wordpress/www/example.com/html;
        index index.html index.htm index.php;

        server_name example.com;

        access_log /home/wordpress/www/example.com/log/access.log;
        error_log /home/wordpress/www/example.com/log/error.log;

        location / {
                try_files $uri $uri/ /index.html;
        }

        error_page 404 /404.html;
        error_page 500 502 503 504 /50x.html;

        location ~ ^.*\.php$ {
                root /home/wordpress/www/example.com/html;
                fastcgi_pass 127.0.0.1:9000;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;
        }

}

Update mysql database using dump file

$ mysql -u username -p -h localhost  < dump.sql
zuqqhi2