Wordpress Error 500 on ISPConfig3.0.4.3 NGINX

Discussion in 'Installation/Configuration' started by tested0002, Feb 29, 2012.

  1. tested0002

    tested0002 New Member

    Hi to all the members,Moderators and Admins of ISPConfig.

    First of all I would like to thank you for the great software you have here. I came here because I search the forums but I couldn't find what really the great solution to my problem.

    I have successfully installed ISPConfig 3 to my Centos 6.2 VPS with 1GB of RAM.
    I use NGINX as my default web server. And the problem goes here. I upload wordpress files to my server and i have

    1. Chown all the files to current user and group.
    2. Removed the .htaccess file on the root directory.
    3. Chmod files from 644 to 755 (tried also 777 but no luck, switch back to original permissions)

    But I got ERROR 500 - Internal Server Error!... And I can't continue with the installation. By the way I put the wordpress files to root directory of my domain.

    My current vhost.conf
    Code:
    server {
            listen *:80;
    
            server_name www.xxxxxxx.info ;
            root   /var/www/www.xxxxxxx.info/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;
    
            error_log /var/log/ispconfig/httpd/www.xxxxxxx.info/error.log;
            access_log /var/log/ispconfig/httpd/www.xxxxxxx.info/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/client3/web6/.htpasswd_stats;
            }
    
            location /awstats-icon {
                alias /usr/share/awstats/icon;
            }
    
            location ~ \.php$ {
               try_files $uri =404;
                include /etc/nginx/fastcgi_params;
                fastcgi_pass unix:/var/lib/php5-fpm/web6.sock;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                fastcgi_param PATH_INFO $fastcgi_script_name;
                fastcgi_intercept_errors on;
            }
    
    }
    I use this configuration on Joomla and It works without any problem. No error 500.

    Please anyone here having this kind of problem and if you already fixed this please share it with us. Please if you need anymore info about my configuration please ask and I will post it again here.

    Thank you
     
  2. erosbk

    erosbk New Member

    Did you check de error.log of your site? which php mode are you using? mod-php, fast-cgi (remember to enable suexec), other?
     
  3. tested0002

    tested0002 New Member

    I have checked the logs and I got only this

    Code:
    2012/02/29 16:58:18 [error] 3999#0: *4 directory index of "/var/www/www.xxxxxxx.info/web/" is forbidden, client: 59.xx.xxx.xx, server: www.xxxxxxx.info, request: "GET / HTTP/1.1", host: "test.whitemovies.info"
    
    And about the PHP handler I use php-fpm. I couldn't find this suexec on my ISPConfig panel. Do I need to install this?
     
  4. tested0002

    tested0002 New Member

    My log
    Code:
    2012/02/29 16:58:18 [error] 3999#0: *4 directory index of "/var/www/www.xxxxxxx.info/web/" is forbidden, client: 59.xxx.xxx.xxx, server: www.xxxxxxx.info, request: "GET / HTTP/1.1", host: "www.xxxxxxx.info"
    
    Additional Post: (Can't view my latest post.) I use fast-cgi together with PHP-FPM.
     
    Last edited: Feb 29, 2012
  5. erosbk

    erosbk New Member

    is suexec enabled (enable it and test if not)? do you have an index in the home directory of your site or you put wordpress inside a folder?
     
  6. tested0002

    tested0002 New Member

    No I don't have suexec. I use NGINX and I don't think it will work (Please guide me how to enable or install suexec on NGINX) I can't find any option of "suexec" on the CP its just "Fast-CGI" on the list.

    Yes I have all the files of wordpress on my home directory.

    I just followed the tutorials here http://www.howtoforge.com/perfect-server-centos-6.2-x86_64-with-nginx-ispconfig-3-p1 but seems I have trouble or maybe there might be missing installation about the suexec you are referring to.
     
  7. erosbk

    erosbk New Member

    Sorry, I was thinking in apache, not in nginx! nginx doesn't need suexec... maybe someone with knowledge of nginx could help you better than me
     
  8. hanti

    hanti New Member

    u need to comment out or delete
    fastcgi_intercept_errors on;
     
  9. fco

    fco New Member

    ERROR 500 - Internal Server Error!

    I have the same problem:
    I'm using ISPCONFIG 3.0.4.4
    With default configuration wordpress give Error 500.
    I've tried various patch in site->options->nginx Directives textarea but I have not found a vali solution.
    If I deactivate the site ttw and create a custom vhost file in /etc/nginx/sites-available and activate it, wordpress works

    What is the correct code to past in site->options->nginx Directives for Wordpress ?

    Thanks
     
  10. hanti

    hanti New Member

    u can do nothing becouse there is already in vhost file
    fastcgi_intercept_errors on;
    and this need to be deleted
    u can find and delete fastcgi_intercept_errors on; in file /usr/local/ispconfig/server/conf/nginx_vhost.conf.master
    after that every new site u will create in panel will work with wordpress
     
  11. falko

    falko Super Moderator Howtoforge Staff

    Are there any errors in your logs? Can you post the vhost configuration that triggers the 500 error?
     
  12. fco

    fco New Member

    Thanks hanti.
    I try another way:
    - copy the template in conf-custom dir:
    Code:
    cp /usr/local/ispconfig/server/conf/nginx_vhost.conf.master /usr/local/ispconfig/server/conf-custom/
    - move these 3 lines (141-143):

    Code:
    <tmpl_loop name="nginx_directives">
            <tmpl_var name='nginx_directive'>
    </tmpl_loop>
    
    at line 19 (under "root <tmpl_var name='web_document_root_www'>;").

    In this way I can override nginx rules from web interface. For wordpress in site->options->nginx Directives I write:

    Code:
    location / {
       try_files $uri $uri/ /index.php?$args;
    }
    
    location ~ \.php$ {
                try_files $uri =404;
                include /etc/nginx/fastcgi_params;
                fastcgi_pass 127.0.0.1:9014;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                fastcgi_param PATH_INFO $fastcgi_script_name;
                #fastcgi_intercept_errors on;
    }
    Can it be ?
     
  13. fco

    fco New Member

    Hi falko. I have not errors in log. I think because the error is captured by 500.html ?

    my vhost configuration is the standard generated from ispconfig:

    Code:
    server {
            listen *:80;
            server_name mysite.it www.mysite.it;
            root   /var/www/mysite.it/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/mysite.it/error.log;
            access_log /var/log/ispconfig/httpd/mysite.it/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/web5/.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:9014;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                fastcgi_param PATH_INFO $fastcgi_script_name;
                fastcgi_intercept_errors on;
            }
    }
    
    to bypass the problem hanti suggest me a solution disabling
    fastcgi_intercept_errors on; (see my previuos posts)
    but I'm not sure this is the optimal solution..

    Thanks
    Franco
     
  14. falko

    falko Super Moderator Howtoforge Staff

  15. cyprus

    cyprus New Member

  16. untor

    untor New Member

    I bumped my head more than an hour on that intercept errors declaration, I am using the conf suggested by fco, even tough the conf files get a bit messy...

    It would be cool if any directive declared for any website would replace default directives if found.
     

Share This Page