LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1376|回复: 4

nginx 不能启动服务

[复制链接]
发表于 2009-9-23 01:27:35 | 显示全部楼层 |阅读模式
localhost ~ # /etc/init.d/nginx start
* Checking nginx' configuration ...
[emerg]: unknown directive "fastcgi_pass" in /etc/nginx/nginx.conf:59
configuration file /etc/nginx/nginx.conf test failed
* failed, please correct errors above     

nginx.conf

user nginx nginx;
worker_processes 1;

error_log /var/log/nginx/error_log info;

events {
    worker_connections  20;
    use epoll;
}

http {
    include        /etc/nginx/mime.types;
    default_type    application/octet-stream;

    log_format main
        '$remote_addr - $remote_user [$time_local] '
            '"$request" $status $bytes_sent '
        '"$http_referer" "$http_user_agent" '
        '"$gzip_ratio"';
                                          
    client_header_timeout    10m;
    client_body_timeout    10m;
    send_timeout        10m;

    connection_pool_size        256;
    client_header_buffer_size    1k;
    large_client_header_buffers    4 2k;
    request_pool_size        4k;

    gzip on;
    gzip_min_length    1100;
    gzip_buffers    4 8k;
    gzip_types    text/plain;

    output_buffers    1 32k;
    postpone_output    1460;

    sendfile    on;
    tcp_nopush    on;
    tcp_nodelay    on;

    keepalive_timeout    75 20;

    ignore_invalid_headers    on;

    index index.html;

    server {
        listen        80;
        server_name    localhost;

        access_log    /var/log/nginx/localhost.access_log main;
        error_log    /var/log/nginx/localhost.error_log info;

        root /opt/www;


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

}


在网上查了,没有结果。请高手帮忙分析哈。


谢谢
发表于 2009-9-23 06:26:29 | 显示全部楼层
没有安装fcgi,却在配置文件里调用了fcgi,因此出错。

emerge spawn-fcgi ,先启动它,再启动 nginx试试?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-9-23 22:29:27 | 显示全部楼层
Post by zhou3345;2029327
没有安装fcgi,却在配置文件里调用了fcgi,因此出错。

emerge spawn-fcgi ,先启动它,再启动 nginx试试?


还是不行呢?

localhost ~ # spawn-fcgi -f /usr/bin/php-cgi -a 127.0.0.1 -p 9000
spawn-fcgi: child spawned successfully: PID: 15439
localhost ~ # php-
php-cgi     php-config  php-select  
localhost ~ # /etc/init.d/nginx start
* Checking nginx' configuration ...
[emerg]: unknown directive "fastcgi_pass" in /etc/nginx/nginx.conf:59
configuration file /etc/nginx/nginx.conf test failed
* failed, please correct errors above


我开起 spawn-fcgi -f /usr/bin/php-cgi -a 127.0.0.1 -p 9000  和不开都一样。

nginx 没有检测到。请问怎么改哟
回复 支持 反对

使用道具 举报

发表于 2009-9-24 07:17:21 | 显示全部楼层
启动 spawn-fcgi 用 /etc/init.d/spawn.** start
启动nginx 用 /etc/init.d/nginx start

这里spawn要稍微调整一下配置。
回复 支持 反对

使用道具 举报

发表于 2009-9-24 11:36:20 | 显示全部楼层
echo "www-servers/nginx fastcgi" >> /etc/portage/package.use
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表