View Single Post
  #1  
Old 29th January 2013, 11:26
pititis pititis is offline
Senior Member
 
Join Date: Dec 2010
Location: München
Posts: 364
Thanks: 39
Thanked 89 Times in 68 Posts
Default [Solved] nginx apps vhost issue

Hello,

I'm sorry but I can't find what's wrong here. In my production server I can't access phpmyadmin anymore.

Tried with domain.tld:8081/phpmyadmin and other.com/phpmyadmin

I get error 500.

Ubuntu 12.04 LTS

Info:

Code:
lrwxrwxrwx 1 root root   37 Apr 27  2012 000-apps.vhost -> /etc/nginx/sites-available/apps.vhost
Code:
-rw-r--r-- 1 root root 9867 Jan 29 09:40 /etc/nginx/sites-available/apps.vhost
Code:
server {
        listen 8081;

        server_name _;

        root   /var/www/apps;

        client_max_body_size 20M;

        location / {
               index index.php index.html;
        }

        # serve static files directly
        location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt)$ {
               access_log        off;
        }

        location ~ \.php$ {
               try_files $uri =404;
               fastcgi_param   QUERY_STRING            $query_string;
               fastcgi_param   REQUEST_METHOD          $request_method;
               fastcgi_param   CONTENT_TYPE            $content_type;
               fastcgi_param   CONTENT_LENGTH          $content_length;

               fastcgi_param   SCRIPT_FILENAME         $request_filename;
               fastcgi_param   SCRIPT_NAME             $fastcgi_script_name;
               fastcgi_param   REQUEST_URI             $request_uri;
               fastcgi_param   DOCUMENT_URI            $document_uri;
               fastcgi_param   DOCUMENT_ROOT           $document_root;
               fastcgi_param   SERVER_PROTOCOL         $server_protocol;

               fastcgi_param   GATEWAY_INTERFACE       CGI/1.1;
               fastcgi_param   SERVER_SOFTWARE         nginx/$nginx_version;

               fastcgi_param   REMOTE_ADDR             $remote_addr;
               fastcgi_param   REMOTE_PORT             $remote_port;
               fastcgi_param   SERVER_ADDR             $server_addr;
               fastcgi_param   SERVER_PORT             $server_port;
               fastcgi_param   SERVER_NAME             $server_name;

               fastcgi_param   HTTPS                   $https;

               # PHP only, required if PHP was built with --enable-force-cgi-redirect
               fastcgi_param   REDIRECT_STATUS         200;
               fastcgi_pass unix:/var/lib/php5-fpm/apps.sock;
               fastcgi_index index.php;
               fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
               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;
        }

        location ~ /\. {
               deny  all;
        }

        location /phpmyadmin {
               root /usr/share/;
               index index.php index.html index.htm;
               location ~ ^/phpmyadmin/(.+\.php)$ {
                       try_files $uri =404;
                       root /usr/share/;
                       fastcgi_param   QUERY_STRING            $query_string;
                       fastcgi_param   REQUEST_METHOD          $request_method;
                       fastcgi_param   CONTENT_TYPE            $content_type;
                       fastcgi_param   CONTENT_LENGTH          $content_length;

                       fastcgi_param   SCRIPT_FILENAME         $request_filename;
                       fastcgi_param   SCRIPT_NAME             $fastcgi_script_name;
                       fastcgi_param   REQUEST_URI             $request_uri;
                       fastcgi_param   DOCUMENT_URI            $document_uri;
                       fastcgi_param   DOCUMENT_ROOT           $document_root;
                       fastcgi_param   SERVER_PROTOCOL         $server_protocol;

                       fastcgi_param   GATEWAY_INTERFACE       CGI/1.1;
                       fastcgi_param   SERVER_SOFTWARE         nginx/$nginx_version;

                       fastcgi_param   REMOTE_ADDR             $remote_addr;
                       fastcgi_param   REMOTE_PORT             $remote_port;
                       fastcgi_param   SERVER_ADDR             $server_addr;
                       fastcgi_param   SERVER_PORT             $server_port;
                       fastcgi_param   SERVER_NAME             $server_name;

                       fastcgi_param   HTTPS                   $https;

                       # PHP only, required if PHP was built with --enable-force-cgi-redirect
                       fastcgi_param   REDIRECT_STATUS         200;
                       # To access phpMyAdmin, the default user (like www-data on Debian/Ubuntu) must be used
                       fastcgi_pass 127.0.0.1:9000;
                       #fastcgi_pass unix:/var/run/php5-fpm.sock;
                       fastcgi_index index.php;
                       fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                       fastcgi_buffer_size 128k;
                       fastcgi_buffers 256 4k;
                       fastcgi_busy_buffers_size 256k;
                       fastcgi_temp_file_write_size 256k;
                       fastcgi_read_timeout 240;
                       
                       }
               location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
                       root /usr/share/;
               }
        }
        location /phpMyAdmin {
               rewrite ^/* /phpmyadmin last;
        }
		
        location /squirrelmail {
               root /usr/share/;
               index index.php index.html index.htm;
               location ~ ^/squirrelmail/(.+\.php)$ {
                       try_files $uri =404;
                       root /usr/share/;
                       fastcgi_param   QUERY_STRING            $query_string;
                       fastcgi_param   REQUEST_METHOD          $request_method;
                       fastcgi_param   CONTENT_TYPE            $content_type;
                       fastcgi_param   CONTENT_LENGTH          $content_length;

                       fastcgi_param   SCRIPT_FILENAME         $request_filename;
                       fastcgi_param   SCRIPT_NAME             $fastcgi_script_name;
                       fastcgi_param   REQUEST_URI             $request_uri;
                       fastcgi_param   DOCUMENT_URI            $document_uri;
                       fastcgi_param   DOCUMENT_ROOT           $document_root;
                       fastcgi_param   SERVER_PROTOCOL         $server_protocol;

                       fastcgi_param   GATEWAY_INTERFACE       CGI/1.1;
                       fastcgi_param   SERVER_SOFTWARE         nginx/$nginx_version;

                       fastcgi_param   REMOTE_ADDR             $remote_addr;
                       fastcgi_param   REMOTE_PORT             $remote_port;
                       fastcgi_param   SERVER_ADDR             $server_addr;
                       fastcgi_param   SERVER_PORT             $server_port;
                       fastcgi_param   SERVER_NAME             $server_name;

                       fastcgi_param   HTTPS                   $https;

                       # PHP only, required if PHP was built with --enable-force-cgi-redirect
                       fastcgi_param   REDIRECT_STATUS         200;
                       # To access SquirrelMail, the default user (like www-data on Debian/Ubuntu) must be used
                       fastcgi_pass 127.0.0.1:9000;
                       #fastcgi_pass unix:/var/run/php5-fpm.sock;
                       fastcgi_index index.php;
                       fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                       fastcgi_buffer_size 128k;
                       fastcgi_buffers 256 4k;
                       fastcgi_busy_buffers_size 256k;
                       fastcgi_temp_file_write_size 256k;
               }
               location ~* ^/squirrelmail/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
                       root /usr/share/;
               }
        }
        location /webmail {
               rewrite ^/* /squirrelmail last;
        }

        location /cgi-bin/mailman {
               root /usr/lib/;
               fastcgi_split_path_info (^/cgi-bin/mailman/[^/]*)(.*)$;
               fastcgi_param   QUERY_STRING            $query_string;
               fastcgi_param   REQUEST_METHOD          $request_method;
               fastcgi_param   CONTENT_TYPE            $content_type;
               fastcgi_param   CONTENT_LENGTH          $content_length;

               fastcgi_param   SCRIPT_FILENAME         $request_filename;
               fastcgi_param   SCRIPT_NAME             $fastcgi_script_name;
               fastcgi_param   REQUEST_URI             $request_uri;
               fastcgi_param   DOCUMENT_URI            $document_uri;
               fastcgi_param   DOCUMENT_ROOT           $document_root;
               fastcgi_param   SERVER_PROTOCOL         $server_protocol;

               fastcgi_param   GATEWAY_INTERFACE       CGI/1.1;
               fastcgi_param   SERVER_SOFTWARE         nginx/$nginx_version;

               fastcgi_param   REMOTE_ADDR             $remote_addr;
               fastcgi_param   REMOTE_PORT             $remote_port;
               fastcgi_param   SERVER_ADDR             $server_addr;
               fastcgi_param   SERVER_PORT             $server_port;
               fastcgi_param   SERVER_NAME             $server_name;

               fastcgi_param   HTTPS                   $https;

               # PHP only, required if PHP was built with --enable-force-cgi-redirect
               fastcgi_param   REDIRECT_STATUS         200;
               fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
               fastcgi_param PATH_INFO $fastcgi_path_info;
               fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
               fastcgi_intercept_errors on;
               fastcgi_pass unix:/var/run/fcgiwrap.socket;
        }

        location /images/mailman {
               alias /usr/share/images/mailman;
        }

        location /pipermail {
               alias /var/lib/mailman/archives/public;
               autoindex on;
        }
}
Code:
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       User       Inode       PID/Program name
tcp        0      0 127.0.0.1:9060          0.0.0.0:*               LISTEN      0          12227       2137/php-fpm.conf)
tcp        0      0 127.0.0.1:9000          0.0.0.0:*               LISTEN      0          12230       2137/php-fpm.conf)
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      105        9454        879/mysqld      
tcp        0      0 127.0.0.1:9071          0.0.0.0:*               LISTEN      0          12233       2137/php-fpm.conf)
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      0          17971       3640/nginx.conf 
tcp        0      0 xxxxxxxxx:8081      0.0.0.0:*               LISTEN      0          17975       3640/nginx.conf 
tcp        0      0 127.0.0.1:9075          0.0.0.0:*               LISTEN      0          12234       2137/php-fpm.conf)
tcp        0      0 127.0.0.1:9012          0.0.0.0:*               LISTEN      0          12228       2137/php-fpm.conf)
tcp        0      0 127.0.0.1:9077          0.0.0.0:*               LISTEN      0          12229       2137/php-fpm.conf)
tcp        0      0 0.0.0.0:21              0.0.0.0:*               LISTEN      0          11089       1865/pure-ftpd (SER
tcp        0      0 xxxxxxxxx:53        0.0.0.0:*               LISTEN      107        8902        980/named       
tcp        0      0 127.0.0.1:53            0.0.0.0:*               LISTEN      107        8900        980/named       
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      0          8472        746/sshd        
tcp        0      0 127.0.0.1:9049          0.0.0.0:*               LISTEN      0          12232       2137/php-fpm.conf)
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      0          10955       1842/master     
tcp        0      0 127.0.0.1:953           0.0.0.0:*               LISTEN      107        8905        980/named       
tcp        0      0 xxxxxxxxxxx:443       0.0.0.0:*               LISTEN      0          17973       3640/nginx.conf 
tcp        0      0 127.0.0.1:9055          0.0.0.0:*               LISTEN      0          12226       2137/php-fpm.conf)
tcp        0      0 xxxxxxxxxxxx:48938     xxxxxxxxxxxx:3306     TIME_WAIT   0          0           -               
tcp        0      0 xxxxxxxxxxx:37631     xxxxxxxxxxxx:8081      ESTABLISHED 0          24190       2895/sshd: root 
tcp        0      0 xxxxxxxxxxx:8081      xxxxxxxxxx:37631     ESTABLISHED 33         24191       3746/nginx: worker 
tcp        0      0 xxxxxxxxxxx:43643     xxxxxxxxxxxxxx:993      ESTABLISHED 0          13687       2895/sshd: root 
tcp        0      0 xxxxxxxxxx:59782     xxxxxxxxxxxxxx:80          TIME_WAIT   0          0           -               
tcp        0      0 127.0.0.1:80            127.0.0.1:46422         TIME_WAIT   0          0           -               
tcp        0      0 xxxxxxxxxxxx:59784     xxxxxxxxxxxxxx:80          TIME_WAIT   0          0           -               
tcp        0      0 127.0.0.1:21            127.0.0.1:60457         TIME_WAIT   0          0           -               
tcp        0      0 xxxxxxxxxxxx:58472     xxxxxxxxxxxxxxx:143      ESTABLISHED 0          13728       2895/sshd: root 
tcp        0      0 xxxxxxxxxxx:42037     xxxxxxxxxxxxxxx:80          TIME_WAIT   0          0           -               
tcp        0      0 127.0.0.1:9000          127.0.0.1:57967         TIME_WAIT   0          0           -               
tcp        0      0 xxxxxxxxxxx:22        xxxxxxxxxxxxx:52852      ESTABLISHED 0          13213       2895/sshd: root 
tcp        0   5808 xxxxxxxxxx:22        xxxxxxxxxxxx:52832      ESTABLISHED 0          7818        642/2           
tcp        0      0 xxxxxxxxxx:42035    xxxxxxxxxxxx:80          TIME_WAIT   0          0           -               
tcp        0      0 xxxxxxxxxx:58974     xxxxxxxxxx:143      ESTABLISHED 0          20878       2895/sshd: root 
tcp        0      0 xxxxxxxxxx:59786     xxxxxxxxxxxx:80          TIME_WAIT   0          0           -               
tcp6       0      0 aaaaaaaaaaaaa::2:80 :::*                    LISTEN      0          17972       3640/nginx.conf 
tcp6       0      0 :::21                   :::*                    LISTEN      0          11090       1865/pure-ftpd (SER
tcp6       0      0 :::53                   :::*                    LISTEN      107        8895        980/named       
tcp6       0      0 :::22                   :::*                    LISTEN      0          8474        746/sshd        
tcp6       0      0 ::1:25                  :::*                    LISTEN      0          10956       1842/master     
tcp6       0      0 ::1:953                 :::*                    LISTEN      107        8906        980/named       
tcp6       0      0 aaaaaaaaaaaaaaaaaaa:::443 :::*                    LISTEN      0          17974       3640/nginx.conf
ls -la /etc/phpmyadmin/
Code:
total 56
drwxr-xr-x   2 root root      4096 Jan 29 09:28 .
drwxr-xr-x 116 root root     12288 Jan 29 10:03 ..
-rw-r--r--   1 root root      1057 Feb 14  2012 apache.conf
-rw-r-----   1 root www-data   553 Jan 29 09:28 config-db.php
-rw-r--r--   1 root root       168 Feb 14  2012 config.footer.inc.php
-rw-r--r--   1 root root       168 Feb 14  2012 config.header.inc.php
-rw-r--r--   1 root root      4388 Feb 14  2012 config.inc.php
-rw-r-----   1 root www-data     8 Jan 29 09:28 htpasswd.setup
-rw-r--r--   1 root root       570 Feb 14  2012 lighttpd.conf
-rw-r--r--   1 root root       198 Feb 14  2012 phpmyadmin.desktop
-rw-r--r--   1 root root       295 Feb 14  2012 phpmyadmin.service
ls -la /var/www
Code:
drwxr-xr-x  2 ispapps ispapps 4096 Apr 11  2012 apps
access.log
Code:
xxxxxxxxxxx - - [29/Jan/2013:10:06:59 +0100] "GET /phpmyadmin/ HTTP/1.1" 500 5 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:18.0) Gecko/20100101 Firefox/18.0"
error.log
full, but nothing about the 500 error.

Any idea please?

Last edited by pititis; 30th January 2013 at 11:45.
Reply With Quote
Sponsored Links