在Linode上部署Nginx+wordpress博客系统

1. 首先,转移到你想放置wordpress主程序的目录下, 我使用的是/opt/www:

cd /opt/www

2. 下载最新的wordpress源码包:

wget http://wordpress.org/latest.zip

3. 解压:

unzip latest.zip

解压出来一个名为wordpress的文件夹,你什么都不需要动。


4. MySQL中创建必须要的数据库和用户:

create database wordpress;
grant all privileges on wordpress.* to 'wordpress'@'localhost' identified by 'yourpass' with grant option;
flush privileges;

5. 下载并安装spawn-fcgi:

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

6. 确保你已经安装了最新的PHP和PHP MySQL驱动:

 yum install php
 yum install php-mysql


7. 安装一个Nginx:

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

此时,你会发现53217端口已经被监听了


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;
    }
}

启动Nginx服务,从你的浏览器访问nginx服务,按照提示,输入MySQL的用户名、密码、数据库名等配置,至此,一个新的wordpress博客环境就已经搭建起来了。



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值