the perfect server debian 8,6 error 500 nginx wordpress

Discussion in 'Installation/Configuration' started by mart28, May 8, 2017.

  1. mart28

    mart28 Member

    Hello
    I followed this tutorial

    https://www.howtoforge.com/tutorial/perfect-server-debian-jessie-nginx-bind-dovecot-ispconfig-3.1

    When I open an html page. Or info.php. It works well
    But when I try to install wordpres,
    ERROR 500 - Internal Server Error!

    These are the directives that I have in ispconfig


    location / {
    index index.php index.html index.htm;
    try_files $uri $uri/ /index.php?$args;
    }
    location /phpmyadmin {
    root /usr/share/;
    index index.php index.html index.htm;
    location ~ ^/phpmyadmin/(.+\.php)$ {
    try_files $uri =404;
    root /usr/share/;
    fastcgi_pass unix:/var/run/php5-fpm.sock;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $request_filename;
    include /etc/nginx/fastcgi_params;
    fastcgi_param PATH_INFO $fastcgi_script_name;
    fastcgi_buffer_size 128k;
    fastcgi_buffers 256 4k;
    fastcgi_busy_buffers_size 256k;
    fastcgi_temp_file_write_size 256k;
    fastcgi_intercept_errors on;
    }
    location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
    root /usr/share/;
    }
    }
    location /phpMyAdmin {
    rewrite ^/* /phpmyadmin last;
    }

    I use php-fpm
    I have tried to use hhvm and also error 500.
    How can I solve that?
    Thank you
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Which error message do you get in the error.log of the website?
     
  3. mart28

    mart28 Member

    Hello
    I do not have any errors
    user/log
    error.log It is empty
     
  4. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    Try changing this:
    Code:
    location / {
    index index.php index.html index.htm;
    try_files $uri $uri/ /index.php?$args;
    }
    
    Code:
      index index.php index.html index.htm;
      location / {
      try_files $uri $uri/ /index.php?q=$uri&$args;
      }
    
     
  5. mart28

    mart28 Member

    Hello
    I wrote it like that
    and it does not work


    index index.php index.html index.htm;
    location / {
    try_files $uri $uri/ /index.php?q=$uri&$args;
    }
    }

    location /phpmyadmin {
    root /usr/share/;
    index index.php index.html index.htm;
    location ~ ^/phpmyadmin/(.+\.php)$ {
    try_files $uri =404;
    root /usr/share/;
    fastcgi_pass unix:/var/run/php5-fpm.sock;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $request_filename;
    include /etc/nginx/fastcgi_params;
    fastcgi_param PATH_INFO $fastcgi_script_name;
    fastcgi_buffer_size 128k;
    fastcgi_buffers 256 4k;
    fastcgi_busy_buffers_size 256k;
    fastcgi_temp_file_write_size 256k;
    fastcgi_intercept_errors on;
    }
    location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
    root /usr/share/;
    }
    }
    location /phpMyAdmin {
    rewrite ^/* /phpmyadmin last;
    }
     
  6. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    You got extra bracket there.
     
  7. mart28

    mart28 Member

    Sorry, I deleted it, but it does not work
    regards
     
  8. mart28

    mart28 Member

    In the directory



    /var/log/nginx/error.log

    I have this error and some more

    2017/05/07 22:49:50 [error] 647#0: *3132 FastCGI sent in stderr: "PHP message: phpmyadmin: Failed to load /var/lib/phpmyadmin/blowfish_secret.inc.php Check group www-data has read access and open_basedir restrictions.









    2017/05/07 22:49:07 [error] 645#0: *3080 open() "/var/www/apps/Joomla/administrator" failed (2: No such file or directory), client: 178.32.142.141, server: _, request: "GET /Joomla/administrator HTTP/1.1", host: "51.254.209.198:8081"
    2017/05/07 22:49:14 [error] 645#0: *3085 open() "/var/www/apps/msd" failed (2: No such file or directory), client: 178.32.142.141, server: _, request: "GET /msd HTTP/1.1", host: "51.254.209.198:8081"
    2017/05/07 22:49:14 [error] 645#0: *3086 open() "/var/www/apps/mySqlDumper" failed (2: No such file or directory), client: 178.32.142.141, server: _, request: "GET /mySqlDumper HTTP/1.1", host: "51.254.209.198:8081"
    2017/05/07 22:49:25 [error] 645#0: *3090 open() "/var/www/apps/cgi-bin/php" failed (2: No such file or directory), client: 178.32.142.141, server: _, request: "GET /cgi-bin/php HTTP/1.1", host: "51.254.209.198:8081"
    2017/05/07 22:49:28 [error] 645#0: *3093 open() "/usr/local/ispconfig/interface/web/administrator" failed (2: No such file or directory), client: 178.32.142.141, server: _, request: "GET //administrator HTTP/1.1", host: "51.254.209.198:8080"
    2017/05/07 22:49:32 [error] 647#0: *3098 open() "/var/www/apps/cgi-bin/php5" failed (2: No such file or directory), client: 178.32.142.141, server: _, request: "GET /cgi-bin/php5 HTTP/1.1", host: "51.254.209.198:8081"
    2017/05/07 22:49:32 [error] 647#0: *3100 FastCGI sent in stderr: "PHP message: phpmyadmin: Failed to load /var/lib/phpmyadmin/blowfish_secret.inc.php Check group www-data has read access and open_basedir restrictions.
    PHP message: phpmyadmin: Failed to load /var/lib/phpmyadmin/config.inc.php Check group www-data has read access and open_basedir restrictions.
    PHP message: phpmyadmin: Failed to load /etc/phpmyadmin/config-db.php Check group www-data has read access and open_basedir restrictions" while reading response header from upstream, client: 178.32.142.141, server: _, request: "GET /phpmyadmin/ HTTP/1.1", upstream: "fastcgi://unix:/var/lib/php5-fpm/apps.sock:", host: "51.254.209.198:8081"
    2017/05/07 22:49:39 [error] 647#0: *3109 FastCGI sent in stderr: "PHP message: phpmyadmin: Failed to load /var/lib/phpmyadmin/blowfish_secret.inc.php Check group www-data has read access and open_basedir restrictions.
    PHP message: phpmyadmin: Failed to load /var/lib/phpmyadmin/config.inc.php Check group www-data has read access and open_basedir restrictions.
    PHP message: phpmyadmin: Failed to load /etc/phpmyadmin/config-db.php Check group www-data has read access and open_basedir restrictions" while reading response header from upstream, client: 178.32.142.141, server: _, request: "GET /phpmyadmin/ HTTP/1.1", upstream: "fastcgi://unix:/var/lib/php5-fpm/apps.sock:", host: "51.254.209.198:8081"
    2017/05/07 22:49:45 [error] 647#0: *3117 open() "/usr/local/ispconfig/interface/web/cms/administrator" failed (2: No such file or directory), client: 178.32.142.141, server: _, request: "GET /cms/administrator HTTP/1.1", host: "51.254.209.198:8080"
    2017/05/07 22:49:46 [error] 647#0: *3118 open() "/var/www/apps/mysql" failed (2: No such file or directory), client: 178.32.142.141, server: _, request: "GET /mysql HTTP/1.1", host: "51.254.209.198:8081"
    2017/05/07 22:49:49 [error] 647#0: *3127 open() "/var/www/apps/sql" failed (2: No such file or directory), client: 178.32.142.141, server: _, request: "GET /sql HTTP/1.1", host: "51.254.209.198:8081"
    2017/05/07 22:49:49 [error] 647#0: *3128 open() "/var/www/apps/myadmin" failed (2: No such file or directory), client: 178.32.142.141, server: _, request: "GET /myadmin HTTP/1.1", host: "51.254.209.198:8081"
    2017/05/07 22:49:50 [error] 647#0: *3130 open() "/usr/local/ispconfig/interface/web/Joomla/administrator" failed (2: No such file or directory), client: 178.32.142.141, server: _, request: "GET /Joomla/administrator HTTP/1.1", host: "51.254.209.198:8080"
    2017/05/07 22:49:50 [error] 647#0: *3132 FastCGI sent in stderr: "PHP message: phpmyadmin: Failed to load /var/lib/phpmyadmin/blowfish_secret.inc.php Check group www-data has read access and open_basedir restrictions.
    PHP message: phpmyadmin: Failed to load /var/lib/phpmyadmin/config.inc.php Check group www-data has read access and open_basedir restrictions.
    PHP message: phpmyadmin: Failed to load /etc/phpmyadmin/config-db.php Check group www-data has read access and open_basedir restrictions" while reading response header from upstream, client: 178.32.142.141, server: _, request: "GET /phpmyadmin/ HTTP/1.1", upstream: "fastcgi://unix:/var/lib/php5-fpm/apps.sock:", host: "51.254.209.198:8081"
    2017/05/07 22:49:53 [error] 647#0: *3135 open() "/usr/local/ispconfig/interface/web/msd" failed (2: No such file or directory), client: 178.32.142.141, server: _, request: "GET /msd HTTP/1.1", host: "51.254.209.198:8080"
    2017/05/07 22:49:56 [error] 647#0: *3137 open() "/usr/local/ispconfig/interface/web/mySqlDumper" failed (2: No such file or directory), client: 178.32.142.141, server: _, request: "GET /mySqlDumper HTTP/1.1", host: "51.254.209.198:8080"
    2017/05/07 22:49:56 [error] 647#0: *3139 open() "/usr/local/ispconfig/interface/web/msd1.24stable" failed (2: No such file or directory), client: 178.32.142.141, server: _, request: "GET /msd1.24stable HTTP/1.1", host: "51.254.209.198:8080"
    2017/05/07 22:49:56 [error] 647#0: *3141 open() "/usr/local/ispconfig/interface/web/msd1.24.4" failed (2: No such file or directory), client: 178.32.142.141, server: _, request: "GET /msd1.24.4 HTTP/1.1", host: "51.254.209.198:8080"
    2017/05/07 22:49:56 [error] 647#0: *3143 open() "/usr/local/ispconfig/interface/web/mysqldumper" failed (2: No such file or directory), client: 178.32.142.141, server: _, request: "GET /mysqldumper HTTP/1.1", host: "51.254.209.198:8080"
    2017/05/07 22:50:03 [error] 645#0: *3148 open() "/usr/local/ispconfig/interface/web/MySQLDumper" failed (2: No such file or directory), client: 178.32.142.141, server: _, request: "GET /MySQLDumper HTTP/1.1", host: "51.254.209.198:8080"
    2017/05/07 22:50:03 [error] 645#0: *3150 directory index of "/var/www/apps/" is forbidden, client: 178.32.142.141, server: _, request: "GET / HTTP/1.1", host: "51.254.209.198:8081"
    2017/05/07 22:50:04 [error] 645#0: *3154 open() "/usr/local/ispconfig/interface/web/mysql" failed (2: No such file or directory), client: 178.32.142.141, server: _, request: "GET /mysql HTTP/1.1", host: "51.254.209.198:8080"
    2017/05/07 22:50:06 [error] 645#0: *3156 open() "/usr/local/ispconfig/interface/web/sql" failed (2: No such file or directory), client: 178.32.142.141, server: _, request: "GET /sql HTTP/1.1", host: "51.254.209.198:8080"
    2017/05/07 22:50:21 [error] 645#0: *3163 open() "/usr/local/ispconfig/interface/web/phpmyadmin" failed (2: No such file or directory), client: 178.32.142.141, server: _, request: "GET /phpmyadmin HTTP/1.1", host: "51.254.209.198:8080"
    2017/05/07 22:50:26 [error] 645#0: *3175 open() "/var/www/apps/webdav" failed (2: No such file or directory), client: 178.32.142.141, server: _, request: "GET /webdav HTTP/1.1", host: "51.254.209.198:8081"
    2017/05/07 22:50:29 [error] 645#0: *3181 directory index of "/var/www/apps/" is forbidden, client: 178.32.142.141, server: _, request: "GET / HTTP/1.1", host: "51.254.209.198:8081"
    2017/05/07 22:50:51 [error] 645#0: *3224 open() "/usr/local/ispconfig/interface/web/webdav" failed (2: No such file or directory), client: 178.32.142.141, server: _, request: "GET /webdav HTTP/1.1", host: "51.254.209.198:8080"
    2017/05/08 13:31:03 [emerg] 29780#0: "location" directive is not allowed here in /etc/nginx/sites-enabled/100-certva.es.vhost:110
     
  9. mart28

    mart28 Member

    root@vps343527:~# cd /etc/phpmyadmin
    root@vps343527:/etc/phpmyadmin# ls -l
    total 44
    -rw-r--r-- 1 root root 1397 Jul 23 2016 apache.conf
    drwxr-xr-x 2 root root 4096 Jul 24 2016 conf.d
    -rw-r----- 1 root www-data 543 Apr 29 10:39 config-db.php
    -rw-r--r-- 1 root root 168 Jul 23 2016 config.footer.inc.php
    -rw-r--r-- 1 root root 168 Jul 23 2016 config.header.inc.php
    -rw-r--r-- 1 root root 5868 Jul 23 2016 config.inc.php
    -rw-r----- 1 root www-data 8 Apr 29 10:39 htpasswd.setup
    -rw-r--r-- 1 root root 570 Jul 23 2016 lighttpd.conf
    -rw-r--r-- 1 root root 198 Jul 23 2016 phpmyadmin.desktop
    -rw-r--r-- 1 root root 295 Jul 23 2016 phpmyadmin.service
     
  10. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    This is my working vhost for wp (basically based on default nginx vhost for ISPC) as a guide.
    Code:
    server {
      listen *:80;
      server_name mywpdomain ;
      return 301 https://$host;
    }
    
    server {
    
      listen *:443 ssl http2;
    
      ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
      ssl_certificate /var/www/clients/client2/web3/ssl/mywpdomain-le.crt;
      ssl_certificate_key /var/www/clients/client2/web3/ssl/mywpdomain-le.key;
    
      add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
    
      location ~* ^.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt)$ {
      access_log  off;
      expires 365d;
      }
    
      location ~*  \.(pdf)$ {
      expires 30d;
      }
    
    
    
      server_name mywpdomain ;
    
      root  /var/www/mywpdomain/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/mywpdomain/error.log;
      access_log /var/log/ispconfig/httpd/mywpdomain/access.log combined;
    
      location ~ /\.(?!well-known/acme-challenge/) {
      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/web/stats/.htpasswd_stats;
      }
    
      location ^~ /awstats-icon {
      alias /usr/share/awstats/icon;
      }
    
      location ~ \.php$ {
      try_files /2c7bd6dee38780c0437c363e46a038a2.htm @php;
      }
    
      location @php {
      try_files $uri =404;
      include /etc/nginx/fastcgi_params;
      fastcgi_pass unix:/var/lib/php7.1-fpm/web3.sock;
      fastcgi_index index.php;
      fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
      fastcgi_intercept_errors on;
      }
    
    
    
    
      location / {
      try_files $uri $uri/ /index.php?q=$uri&$args;
      }
    
    
      location ~ /\.well-known/acme-challenge/ {
      root /usr/local/ispconfig/interface/acme/;
      index index.html index.htm;
      try_files $uri =404;
      }
    }
    
    Though you should probably fix the above mentioned error first. ;)
     
  11. mart28

    mart28 Member

    I do not know how to solve the permissions problem
    I have another problem
    If I enter via ispconfig in phpmyadmin
    Use this ip, the port that is not the same as the tutorial
    The ISPConfig apps vhost on port 8081 for nginx comes with a phpMyAdmin configuration, so you can use http://server1.example.com:8081/phpmyadmin or http://server1.example.com:8081/phpMyAdmin to access phpMyAdmin


    Https: // ip: 8080 / phpmyadmin

    404 Not Found

    If I modify it to

    Http: // ip: 8081 / phpmyadmin /

    I can enter phpmyadmin
     
  12. ahrasis

    ahrasis Well-Known Member HowtoForge Supporter

    That is because it is enabled in apps.vhost that used port 8081. If you want to use in port 8080, you must enabled it in ispconfig.vhost. This is similarly so if you want to use it with other domain, i.e. you must enabled it in the respective domain vhost file. This is because you use nginx. Apache use a different approach for this.
     
  13. mart28

    mart28 Member

    hello
    I solve it
    Uninstalling and reinstalling phpmyadmin

    Thanks to all for the help
     

Share This Page