Ubuntu12.04 安装nginx和mongo过程

1.安装php和php-cgi

apt-get install php5 php5-cgi

2.安装 nginx

apt-get install nginx

3.安装 MongoDB

apt-get install mongodb

4.安装 pecl

apt-get install pecl

5.配置cgi

vim /etc/php5/cgi/php.ini

#加上 

extension=mongo.so

6.下载rockmongo

http://rockmongo.com/downloads

7.配置nginx

vim /etc/nginx/conf.d/rockmongo.conf

server {

    # 这就是你之前下载解压后的路径

    root $rockmongo;

    location ~ \.php$ {

        # php-cgi的端口号,我这里设置的是9000

        fastcgi_pass 127.0.0.1:9000;

        fastcgi_index index.php;

        fastcgi_param SCRIPT_FILENAME $rockmongo/$fastcgi_script_name;

        include fastcgi_params;

    }

}

8.启动服务器

mongod;

php-cgi -b 9000;

nginx;

 

你可能感兴趣的:(ubuntu)