+ -
当前位置:首页 → 问答吧 → nginx 不能启动服务

nginx 不能启动服务

时间:2009-09-23

来源:互联网

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

}


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


谢谢

作者: l_s   发布时间: 2009-09-23

没有安装fcgi,却在配置文件里调用了fcgi,因此出错。

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

作者: zhou3345   发布时间: 2009-09-23

引用:
作者: zhou3345
没有安装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 没有检测到。请问怎么改哟

作者: l_s   发布时间: 2009-09-24

启动 spawn-fcgi 用 /etc/init.d/spawn.** start
启动nginx 用 /etc/init.d/nginx start

这里spawn要稍微调整一下配置。

作者: zhou3345   发布时间: 2009-09-24

echo "www-servers/nginx fastcgi" >> /etc/portage/package.use

作者: bookstack   发布时间: 2009-09-24

热门下载

更多