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;
}
}
在网上查了,没有结果。请高手帮忙分析哈。
谢谢
* 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试试?
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要稍微调整一下配置。
启动nginx 用 /etc/init.d/nginx start
这里spawn要稍微调整一下配置。
作者: zhou3345 发布时间: 2009-09-24
echo "www-servers/nginx fastcgi" >> /etc/portage/package.use
作者: bookstack 发布时间: 2009-09-24
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28