2012-11-01 4 views
0

centos에 nginx를 설치했습니다.Drupal with nginx : 500 내부 서버 오류

500 Internal Server Error

오류 로그 :

2012/11/01 14:10:38 [error] 4552#0: *32 open() "/var/www/mywebsite.com/web/error/404.html" failed (2: No such file or directory), client: xx.xxx.xx.xxx, server: mywebsite.com, request: "GET /favicon.ico HTTP/1.1", host: "mywebsite.com" 
2012/11/01 14:10:38 [error] 4552#0: *32 open() "/var/www/mywebsite.com/web/error/404.html" failed (2: No such file or directory), client: xx.xxx.xx.xxx, server: mywebsite.com, request: "GET /favicon.ico HTTP/1.1", host: "mywebsite.com" 
2012/11/01 14:10:38 [error] 4552#0: *32 open() "/var/www/mywebsite.com/web/error/404.html" failed (2: No such file or directory), client: xx.xxx.xx.xxx, server: mywebsite.com, request: "GET /favicon.ico HTTP/1.1", host: "mywebsite.com" 
2012/11/01 14:10:38 [error] 4552#0: *32 open() "/var/www/mywebsite.com/web/error/404.html" failed (2: No such file or directory), client: xx.xxx.xx.xxx, server: mywebsite.com, request: "GET /favicon.ico HTTP/1.1", host: "mywebsite.com" 
2012/11/01 14:10:38 [error] 4552#0: *32 open() "/var/www/mywebsite.com/web/error/404.html" failed (2: No such file or directory), client: xx.xxx.xx.xxx, server: mywebsite.com, request: "GET /favicon.ico HTTP/1.1", host: "mywebsite.com" 
2012/11/01 14:10:38 [error] 4552#0: *32 open() "/var/www/mywebsite.com/web/error/404.html" failed (2: No such file or directory), client: xx.xxx.xx.xxx, server: mywebsite.com, request: "GET /favicon.ico HTTP/1.1", host: "mywebsite.com" 
2012/11/01 14:10:38 [error] 4552#0: *32 open() "/var/www/mywebsite.com/web/error/404.html" failed (2: No such file or directory), client: xx.xxx.xx.xxx, server: mywebsite.com, request: "GET /favicon.ico HTTP/1.1", host: "mywebsite.com" 
2012/11/01 14:10:38 [error] 4552#0: *32 open() "/var/www/mywebsite.com/web/error/404.html" failed (2: No such file or directory), client: xx.xxx.xx.xxx, server: mywebsite.com, request: "GET /favicon.ico HTTP/1.1", host: "mywebsite.com" 
2012/11/01 14:10:38 [error] 4552#0: *32 open() "/var/www/mywebsite.com/web/error/404.html" failed (2: No such file or directory), client: xx.xxx.xx.xxx, server: mywebsite.com, request: "GET /favicon.ico HTTP/1.1", host: "mywebsite.com" 
2012/11/01 14:10:38 [error] 4552#0: *32 open() "/var/www/mywebsite.com/web/error/404.html" failed (2: No such file or directory), client: xx.xxx.xx.xxx, server: mywebsite.com, request: "GET /favicon.ico HTTP/1.1", host: "mywebsite.com" 
2012/11/01 14:10:38 [error] 4552#0: *32 rewrite or internal redirection cycle while internally redirecting to "/error/404.html", client: xx.xxx.xx.xxx, server: mywebsite.com, request: "GET /favicon.ico HTTP/1.1", host: "mywebsite.com" 

nginx.conf (/etc/nginx/nginx.conf)

####################################################################### 
# 
# This is the main Nginx configuration file. 
# 
# More information about the configuration options is available on 
# * the English wiki - http://wiki.nginx.org/Main 
# * the Russian documentation - http://sysoev.ru/nginx/ 
# 
####################################################################### 

#---------------------------------------------------------------------- 
# Main Module - directives that cover basic functionality 
# 
# http://wiki.nginx.org/NginxHttpMainModule 
# 
#---------------------------------------------------------------------- 

user    nginx; 
worker_processes 1; 

error_log /var/log/nginx/error.log; 
#error_log /var/log/nginx/error.log notice; 
#error_log /var/log/nginx/error.log info; 

pid  /var/run/nginx.pid; 


#---------------------------------------------------------------------- 
# Events Module 
# 
# http://wiki.nginx.org/NginxHttpEventsModule 
# 
#---------------------------------------------------------------------- 

events { 
    worker_connections 1024; 
} 


#---------------------------------------------------------------------- 
# HTTP Core Module 
# 
# http://wiki.nginx.org/NginxHttpCoreModule 
# 
#---------------------------------------------------------------------- 

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

    log_format main '$remote_addr - $remote_user [$time_local] "$request" ' 
         '$status $body_bytes_sent "$http_referer" ' 
         '"$http_user_agent" "$http_x_forwarded_for"'; 

    access_log /var/log/nginx/access.log main; 

    sendfile  on; 
    #tcp_nopush  on; 

    #keepalive_timeout 0; 
    keepalive_timeout 65; 

    #gzip on; 

    # Load config files from the /etc/nginx/conf.d directory 
    # The default server is in conf.d/default.conf 
    include /etc/nginx/conf.d/*.conf; 

    ## Detect when HTTPS is used 
    map $scheme $fastcgi_https { 
     default off; 
     https on; 
    } 

} 
나는 웹 사이트를 열려고하면이 오류를 얻을 수

/etc/nginx/sites-enabled/100-mysite.vhost

server { 
     listen *:80; 


     server_name mywebsite.com www.mywebsite.com www.mywebsite2.com mywebsite2.com; 

     root /var/www/mywebsite.com/web; 



     index index.html index.htm index.php index.cgi index.pl index.xhtml; 



     error_page 400 /error/400.html; 
     error_page 401 /error/401.html; 
     error_page 403 /error/403.html; 
     error_page 404 /error/404.html; 
     error_page 405 /error/405.html; 
     error_page 500 /error/500.html; 
     error_page 502 /error/502.html; 
     error_page 503 /error/503.html; 
     recursive_error_pages on; 
     location = /error/400.html { 
      internal; 
     } 
     location = /error/401.html { 
      internal; 
     } 
     location = /error/403.html { 
      internal; 
     } 
     location = /error/404.html { 
      internal; 
     } 
     location = /error/405.html { 
      internal; 
     } 
     location = /error/500.html { 
      internal; 
     } 
     location = /error/502.html { 
      internal; 
     } 
     location = /error/503.html { 
      internal; 
     } 

     error_log /var/log/ispconfig/httpd/mywebsite.com/error.log; 
     access_log /var/log/ispconfig/httpd/mywebsite.com/access.log combined; 

     ## Disable .htaccess and other hidden files 
     location ~ /\. { 
      deny all; 
      access_log off; 
      log_not_found off; 
     } 

     location = /favicon.ico { 
      log_not_found off; 
      access_log off; 
     } 

     location = /robots.txt { 
      allow all; 
      log_not_found off; 
      access_log off; 
     } 

     location /stats { 
      index index.html index.php; 
      auth_basic "Members Only"; 
      auth_basic_user_file /var/www/clients/client2/web3/.htpasswd_stats; 
     } 

     location ^~ /awstats-icon { 
      alias /usr/share/awstats/icon; 
     } 

     location ~ \.php$ { 
      ##try_files $uri =404; 
      include /etc/nginx/fastcgi_params; 
      fastcgi_pass 127.0.0.1:9012; 
      fastcgi_index index.php; 
      fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 
      fastcgi_param PATH_INFO $fastcgi_script_name; 
      fastcgi_intercept_errors on; 
     } 





} 

index.php의 내용을 <?php phpinfo();으로 대체하여 PHP를 테스트했지만 문제가되지 않습니다.

의견이 있으십니까?

+0

오류 로그에 아무것도 표시되지 않습니까? – Kaivosukeltaja

+0

@Kaivosukeltaja 게시물 상단을 참조하십시오. – user16948

답변

3

존재하지 않는 404 오류 페이지를 지정했습니다. /var/www/mywebsite.com/web/error/404.html에 파일을 생성하고 작동하는지 확인하십시오.

+1

'recursive_error_pages'가 켜져 있기 때문에 루프가 발생합니다. –