Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 21st October 2012, 22:34
EckyBrazz EckyBrazz is offline
Member
 
Join Date: Jul 2012
Location: Goiânia, Brazil
Posts: 37
Thanks: 3
Thanked 4 Times in 1 Post
Default nginx & wordpress gives 500 pages

Hi,

My server is running fine, but this weekend I have goto some trouble with nginx. All pages with wordpress are giving me a 500 code, If I make a simple php info it works for that domain.
I do have domains with joomla, running fine.
But wordpress is driving me mad now.

/var/log/nginx
Code:
187.58.26.174 - - [21/Oct/2012:15:51:47 -0200] "GET /keepalive.php HTTP/1.1" 200 37 "https://vecks.com.br:8080/index.php" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:16.0) Gecko/20100101 Firefox/16.0"
127.0.0.1 - - [21/Oct/2012:15:52:01 -0200] "GET / HTTP/1.1" 500 186 "-" "Mozilla/5.0 (ISPConfig monitor)"
127.0.0.1 - - [21/Oct/2012:15:53:01 -0200] "GET / HTTP/1.1" 500 186 "-" "Mozilla/5.0 (ISPConfig monitor)"
127.0.0.1 - - [21/Oct/2012:15:54:02 -0200] "GET / HTTP/1.1" 500 186 "-" "Mozilla/5.0 (ISPConfig monitor)"
127.0.0.1 - - [21/Oct/2012:15:55:01 -0200] "GET / HTTP/1.1" 500 186 "-" "Mozilla/5.0 (ISPConfig monitor)"
127.0.0.1 - - [21/Oct/2012:15:55:01 -0200] "GET / HTTP/1.1" 500 186 "-" "Mozilla/5.0 (ISPConfig monitor)"
127.0.0.1 - - [21/Oct/2012:15:55:02 -0200] "GET / HTTP/1.1" 500 186 "-" "Wget/1.13.4 (linux-gnu)"
127.0.0.1 - - [21/Oct/2012:15:56:01 -0200] "GET / HTTP/1.1" 500 186 "-" "Mozilla/5.0 (ISPConfig monitor)"
127.0.0.1 - - [21/Oct/2012:15:57:01 -0200] "GET / HTTP/1.1" 500 186 "-" "Mozilla/5.0 (ISPConfig monitor)"
127.0.0.1 - - [21/Oct/2012:15:58:01 -0200] "GET / HTTP/1.1" 500 186 "-" "Mozilla/5.0 (ISPConfig monitor)"
127.0.0.1 - - [21/Oct/2012:15:59:01 -0200] "GET / HTTP/1.1" 500 186 "-" "Mozilla/5.0 (ISPConfig monitor)"
127.0.0.1 - - [21/Oct/2012:16:00:01 -0200] "GET / HTTP/1.1" 500 186 "-" "Mozilla/5.0 (ISPConfig monitor)"
127.0.0.1 - - [21/Oct/2012:16:00:03 -0200] "GET / HTTP/1.1" 500 186 "-" "Wget/1.13.4 (linux-gnu)"
127.0.0.1 - - [21/Oct/2012:16:00:11 -0200] "GET / HTTP/1.1" 500 186 "-" "Mozilla/5.0 (ISPConfig monitor)"
127.0.0.1 - - [21/Oct/2012:16:01:01 -0200] "GET / HTTP/1.1" 500 186 "-" "Mozilla/5.0 (ISPConfig monitor)"
127.0.0.1 - - [21/Oct/2012:16:02:01 -0200] "GET / HTTP/1.1" 500 186 "-" "Mozilla/5.0 (ISPConfig monitor)"
Config files :
nginx.conf
Code:
user www-data;
worker_processes 8;
pid /var/run/nginx.pid;
#worker_rlimit_nofile 10240;

events {
        worker_connections 768;
        # multi_accept on;
}

http {
        fastcgi_cache_path /var/cache/nginx2 levels=1:2 keys_zone=microcache:5m max_size=1000m;
        log_format cache '$remote_addr - $remote_user [$time_local] "$request" '
        '$status $upstream_cache_status $body_bytes_sent "$http_referer" '
        '"$http_user_agent" "$http_x_forwarded_for"';

        ##
        # Basic Settings
        ##
        send_timeout 10m;
        client_max_body_size 20M;
        sendfile on;
        tcp_nopush off;
        tcp_nodelay on;
        keepalive_timeout 65;
        #multi_accept     on;
        types_hash_max_size 2048;
        server_tokens off;

        # server_names_hash_bucket_size 64;
        # server_name_in_redirect off;
         ## Detect when HTTPS is used
        map $scheme $fastcgi_https {
          default off;
          https on;
        }
        include /etc/nginx/mime.types;
        default_type application/octet-stream;

        ##
        # Logging Settings
        ##

        access_log /var/log/nginx/access.log;
        error_log /var/log/nginx/error.log;

        ##
        # Gzip Settings
        ##

gzip on;
        gzip_disable "msie6";

        gzip_vary on;
        gzip_proxied any;
        gzip_comp_level 6;
        gzip_buffers 16 8k;
        gzip_http_version 1.1;
        gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;

        ##
        # nginx-naxsi config
        ##
        # Uncomment it if you installed nginx-naxsi
        ##

        #include /etc/nginx/naxsi_core.rules;

        ##
        # nginx-passenger config
        ##
        # Uncomment it if you installed nginx-passenger
        ##

        #passenger_root /usr;
        #passenger_ruby /usr/bin/ruby;

        ##
        # Virtual Host Configs
        ##

        include /etc/nginx/conf.d/*.conf;
        include /etc/nginx/sites-enabled/*;
#       include /etc/nginx/global/apps.conf;
}
/etc/nginx/sites-available/vecks.com.br.vhost

Code:
server {
        listen 66.7.217.134:80;


        server_name vecks.com.br www.vecks.com.br;

        root   /var/www/vecks.com.br/web;



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

#       include /etc/nginx/global/wordpress.conf;


        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/vecks.com.br/error.log;
        access_log /var/log/ispconfig/httpd/vecks.com.br/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/client6/web11/.htpasswd_stats;
        }

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

location ~ \.php$ {
                # Setup var defaults
                set $no_cache "";

                # If non GET/HEAD, don't cache & mark user as uncacheable for 1 second via cookie
                if ($request_method !~ ^(GET|HEAD)$) {
                    set $no_cache "1";
                }

                # Drop no cache cookie if need be
                # (for some reason, add_header fails if included in prior if-block)
                if ($no_cache = "1") {
                    add_header Set-Cookie "_mcnc=1; Max-Age=2; Path=/";
                    add_header X-Microcachable "0";
                }

                # Bypass cache if no-cache cookie is set
                if ($http_cookie ~* "_mcnc") {
                            set $no_cache "1";
                }

                # Bypass cache if flag is set
                fastcgi_no_cache $no_cache;
                fastcgi_cache_bypass $no_cache;

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

fastcgi_cache microcache;
                fastcgi_cache_key $server_name|$request_uri;
                fastcgi_cache_valid 404 30m;
                fastcgi_cache_valid 200 10s;
                fastcgi_max_temp_file_size 1M;
                fastcgi_cache_use_stale updating;
                fastcgi_pass unix:/var/lib/php5-fpm/web11.sock;
                fastcgi_pass_header Set-Cookie;
                fastcgi_pass_header Cookie;
                fastcgi_ignore_headers Cache-Control Expires Set-Cookie;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_param  PATH_INFO          $fastcgi_path_info;
                fastcgi_param  PATH_TRANSLATED    $document_root$fastcgi_path_info;
                #try_files $uri =404;
                fastcgi_intercept_errors on;
                include /etc/nginx/fastcgi_params;

                }


        # unless the request is for a valid file, send to bootstrap
        if (!-e $request_filename)
        {
            rewrite ^(.+)$ /index.php?q=$1 last;
  }

        # Google Analytics Proxy
#       rewrite ^/ga.js$ /ga/ last;
#       location /ga/ {
#               proxy_pass http://www.google-analytics.com/ga.js;
#               break;
#       }

}
__________________
Michael Burgos
www.vecks.com.br
Reply With Quote
Sponsored Links
  #2  
Old 22nd October 2012, 08:33
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,457
Thanks: 813
Thanked 5,226 Times in 4,096 Posts
Default

Which errors do you get in the log file /var/log/ispconfig/httpd/vecks.com.br/error.log ?
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 22nd October 2012, 12:59
EckyBrazz EckyBrazz is offline
Member
 
Join Date: Jul 2012
Location: Goiânia, Brazil
Posts: 37
Thanks: 3
Thanked 4 Times in 1 Post
Default

Hi Till.

I Used another WP domain to show the log files.;

Code:
2012/10/07 00:35:04 [error] 2940#0: *709089 open() "/var/www/adlabaredasdefogo.org/web/nginx_status" failed (2: No such file or directory), client: 66.7.217.133, server: adlabaredasdefogo.org, request: "G$
2012/10/07 00:35:04 [error] 2940#0: *709090 open() "/var/www/adlabaredasdefogo.org/web/nginx_status" failed (2: No such file or directory), client: 66.7.217.133, server: adlabaredasdefogo.org, request: "G$
2012/10/07 00:40:04 [error] 2940#0: *709102 open() "/var/www/adlabaredasdefogo.org/web/nginx_status" failed (2: No such file or directory), client: 66.7.217.133, server: adlabaredasdefogo.org, request: "G$
2012/10/07 00:40:04 [error] 2940#0: *709103 open() "/var/www/adlabaredasdefogo.org/web/nginx_status" failed (2: No such file or directory), client: 66.7.217.133, server: adlabaredasdefogo.org, request: "G$
2012/10/07 00:45:04 [error] 2940#0: *709114 open() "/var/www/adlabaredasdefogo.org/web/nginx_status" failed (2: No such file or directory), client: 66.7.217.133, server: adlabaredasdefogo.org, request: "G$
2012/10/07 00:45:05 [error] 2940#0: *709115 open() "/var/www/adlabaredasdefogo.org/web/nginx_status" failed (2: No such file or directory), client: 66.7.217.133, server: adlabaredasdefogo.org, request: "G$
2012/10/07 00:50:04 [error] 2948#0: *709145 open() "/var/www/adlabaredasdefogo.org/web/nginx_status" failed (2: No such file or directory), client: 66.7.217.133, server: adlabaredasdefogo.org, request: "G$
2012/10/07 00:50:04 [error] 2948#0: *709146 open() "/var/www/adlabaredasdefogo.org/web/nginx_status" failed (2: No such file or directory), client: 66.7.217.133, server: adlabaredasdefogo.org, request: "G$
2012/10/07 00:55:04 [error] 2948#0: *709175 open() "/var/www/adlabaredasdefogo.org/web/nginx_status" failed (2: No such file or directory), client: 66.7.217.133, server: adlabaredasdefogo.org, request: "G$
2012/10/07 00:55:04 [error] 2948#0: *709176 open() "/var/www/adlabaredasdefogo.org/web/nginx_status" failed (2: No such file or directory), client: 66.7.217.133, server: adlabaredasdefogo.org, request: "G$
2012/10/07 01:00:04 [error] 2948#0: *709196 open() "/var/www/adlabaredasdefogo.org/web/nginx_status" failed (2: No such file or directory), client: 66.7.217.133, server: adlabaredasdefogo.org, request: "G$
2012/10/07 01:00:05 [error] 2948#0: *709197 open() "/var/www/adlabaredasdefogo.org/web/nginx_status" failed (2: No such file or directory), client: 66.7.217.133, server: adlabaredasdefogo.org, request: "G$
2012/10/07 01:05:05 [error] 2948#0: *709270 open() "/var/www/adlabaredasdefogo.org/web/nginx_status" failed (2: No such file or directory), client: 66.7.217.133, server: adlabaredasdefogo.org, request: "G$
2012/10/07 01:05:05 [error] 2948#0: *709271 open() "/var/www/adlabaredasdefogo.org/web/nginx_status" failed (2: No such file or directory), client: 66.7.217.133, server: adlabaredasdefogo.org, request: "G$
2012/10/07 01:10:05 [error] 2941#0: *709305 open() "/var/www/adlabaredasdefogo.org/web/nginx_status" failed (2: No such file or directory), client: 66.7.217.133, server: adlabaredasdefogo.org, request: "G$
2012/10/07 01:10:05 [error] 2941#0: *709306 open() "/var/www/adlabaredasdefogo.org/web/nginx_status" failed (2: No such file or directory), client: 66.7.217.133, server: adlabaredasdefogo.org, request: "G$
2012/10/07 01:15:04 [error] 2941#0: *709356 open() "/var/www/adlabaredasdefogo.org/web/nginx_status" failed (2: No such file or directory), client: 66.7.217.133, server: adlabaredasdefogo.org, request:
__________________
Michael Burgos
www.vecks.com.br
Reply With Quote
  #4  
Old 22nd October 2012, 17:36
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,722 Times in 2,563 Posts
Default

Does /var/lib/php5-fpm/web11.sock exist? Did you modify the
Code:
location ~ \.php$ {}
section manually?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #5  
Old 22nd October 2012, 17:56
EckyBrazz EckyBrazz is offline
Member
 
Join Date: Jul 2012
Location: Goiânia, Brazil
Posts: 37
Thanks: 3
Thanked 4 Times in 1 Post
Default

The /var/lib/php5-fpm/web11.sock does not exist

On one site I modfied on the other it is the normal one that comes with ISPConfig
location ~ \.php$ {}
__________________
Michael Burgos
www.vecks.com.br
Reply With Quote
  #6  
Old 22nd October 2012, 18:01
EckyBrazz EckyBrazz is offline
Member
 
Join Date: Jul 2012
Location: Goiânia, Brazil
Posts: 37
Thanks: 3
Thanked 4 Times in 1 Post
Default

PM sent with link to php info.
__________________
Michael Burgos
www.vecks.com.br
Reply With Quote
  #7  
Old 23rd October 2012, 16:06
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,722 Times in 2,563 Posts
Default

Code:
location ~ \.php$ {
                # Setup var defaults
                set $no_cache "";

                # If non GET/HEAD, don't cache & mark user as uncacheable for 1 second via cookie
                if ($request_method !~ ^(GET|HEAD)$) {
                    set $no_cache "1";
                }

                # Drop no cache cookie if need be
                # (for some reason, add_header fails if included in prior if-block)
                if ($no_cache = "1") {
                    add_header Set-Cookie "_mcnc=1; Max-Age=2; Path=/";
                    add_header X-Microcachable "0";
                }

                # Bypass cache if no-cache cookie is set
                if ($http_cookie ~* "_mcnc") {
                            set $no_cache "1";
                }

                # Bypass cache if flag is set
                fastcgi_no_cache $no_cache;
                fastcgi_cache_bypass $no_cache;

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

fastcgi_cache microcache;
                fastcgi_cache_key $server_name|$request_uri;
                fastcgi_cache_valid 404 30m;
                fastcgi_cache_valid 200 10s;
                fastcgi_max_temp_file_size 1M;
                fastcgi_cache_use_stale updating;
                fastcgi_pass unix:/var/lib/php5-fpm/web11.sock;
                fastcgi_pass_header Set-Cookie;
                fastcgi_pass_header Cookie;
                fastcgi_ignore_headers Cache-Control Expires Set-Cookie;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_param  PATH_INFO          $fastcgi_path_info;
                fastcgi_param  PATH_TRANSLATED    $document_root$fastcgi_path_info;
                #try_files $uri =404;
                fastcgi_intercept_errors on;
                include /etc/nginx/fastcgi_params;

                }


        # unless the request is for a valid file, send to bootstrap
        if (!-e $request_filename)
        {
            rewrite ^(.+)$ /index.php?q=$1 last;
  }
This part is not the default ISPConfig PHP configuration. It looks like you have disabled PHP for the website and then added this section to the nginx Directives field, but with PHP disabled there's no PHP-FPM socket.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #8  
Old 23rd October 2012, 16:24
EckyBrazz EckyBrazz is offline
Member
 
Join Date: Jul 2012
Location: Goiânia, Brazil
Posts: 37
Thanks: 3
Thanked 4 Times in 1 Post
Default

PHP is enabled. How else is it possible to show the php info ???
__________________
Michael Burgos
www.vecks.com.br
Reply With Quote
  #9  
Old 24th October 2012, 00:06
EckyBrazz EckyBrazz is offline
Member
 
Join Date: Jul 2012
Location: Goiânia, Brazil
Posts: 37
Thanks: 3
Thanked 4 Times in 1 Post
 
Default

Sites are working again, dont know why.

Thanks for helping resolving.
__________________
Michael Burgos
www.vecks.com.br
Reply With Quote
Reply

Bookmarks

Tags
nginx, wordpress

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
nginx and wordpress permalink settings onastvar General 8 7th January 2013 16:50
Wordpress Error 500 on ISPConfig3.0.4.3 NGINX tested0002 Installation/Configuration 15 9th November 2012 12:17
nginx + PHP5-FPM: eventual 500 errors for single site 37minutes Server Operation 1 29th March 2012 15:21
nginx + php-fpm = various problems for SOME sites inc 500 or 404 or no input file talkingnews Installation/Configuration 3 11th December 2011 18:02
ispconfig and mambo shajazzi Installation/Configuration 70 28th March 2006 19:29


All times are GMT +2. The time now is 20:40.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.