1. 首先,转移到你想放置wordpress主程序的目录下, 我使用的是/opt/www:
cd /opt/www
wget http://wordpress.org/latest.zip
unzip latest.zip
4. MySQL中创建必须要的数据库和用户:
create database wordpress; grant all privileges on wordpress.* to 'wordpress'@'localhost' identified by 'yourpass' with grant option; flush privileges;
wget http://www.lighttpd.net/download/spawn-fcgi-1.6.3.tar.bz2 tar xvjf spawn-fcgi-1.6.3.tar.bz2 cd spawn-fcgi-1.6.3 ./configure && make && make install
yum install php yum install php-mysql
wget http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm rpm -ivh nginx-release-centos-6-0.el6.ngx.noarch.rpm yum install nginx
8. 启动fastcgi服务:
spawn-fcgi -a 127.0.0.1 -p 53217 -P /var/run/fastcgi-php.pid -- /usr/bin/php-cgi
9. 配置nginx代理,也就是配置一个虚拟主机:
server { listen 80; # your server's public IP address server_name tinyspill.com; # your domain name root /opt/www/wordpress; # absolute path to your WordPress installation index index.php index.html index.htm try_files $uri $uri/ /index.php; location ~ \.php$ { include fastcgi_params; fastcgi_pass localhost:53217; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } }