Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have setup a domain name to run on amazon ec2 running ubuntu 11.04, nginx and php5-fpm.

The domain name works great, I have setup it's own sites-available configuration file and sym-linked it to sites-enabled.

I installed phpmyadmin via sudo apt-get install phpmyadmin and followed the instructions.

I then added this just above my /etc/nginx/nginx.conf file and restarted nginx.

server {
        listen    80;
        server_name     phpmyadmin.domain.com;

        location / {
                root /usr/share/phpmyadmin;
                index index.php;
        }

        #make sure all php files are processed by fast_cgi
        location ~ \.php {
                # try_files $uri =404;

                fastcgi_index index.php;
                fastcgi_pass 127.0.0.1:9000;

                include fastcgi_params;
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_param PATH_INFO $fastcgi_path_info;
                fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        }

}

I have also added the appropriate dns A records for phpmyadmin.domain.com

phpmyadmin.domain.com just shows a 404 error code. All other subdomains do not respond at all so at least something is working here.

FYI I have edited the /etc/phpmyadmin/config.inc.php file so that I can connect to a remote MySQL Database.

What else do I need to do?

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

You are missing the nginx root directive in .php location block

something like this:

    location ~ \.php$ {
        root   /path/to/public_html;
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        fastcgi_param SCRIPT_FILENAME /path/to/html$fastcgi_script_name;
        include     fastcgi_params;
    }
share|improve this answer
add comment

All that was needed was a simply symlink between /usr/share/phpmyadmin and my default web folder.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.