Tell me more ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Im trying to configure PhpMyAdmin on my nginx. here is my /opt/nginx/config/nginx.conf file:

#user  nobody;
worker_processes  1;

error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    worker_connections  1024;
}


http {
    passenger_root /opt/passenger-3.0.1;
    passenger_ruby /usr/bin/ruby1.8;

    include       mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;

    server {
        #listen       80;
        #server_name  localhost;

        #access_log  logs/host.access.log  main;
     listen   80;
     server_name staging.oneclickfollow.com;
     rails_env staging;

     access_log /srv/www/staging/www/logs/access.log;
     error_log /srv/www/staging/www/logs/error.log;

     location / {
          root   /srv/www/staging/www/current/trunk/web/public;
          passenger_enabled on;
          }

    }
#       server {
 #       listen          80;
#        server_name     mysql.oneclickfollow.com;
#
#        access_log      /var/log/nginx/mysql.oneclickfollow.com.access_log;
#        error_log       /var/log/nginx/mysql.oneclickfollow.com.error_log warn;
#
#        root            /usr/share/phpmyadmin;
#        index           index.php;
#        fastcgi_index   index.php;
#
#        location ~ \.php$ {
#                fastcgi_pass    127.0.0.1:9000;
#                fastcgi_param SCRIPT_FILENAME /usr/share/phpmyadmin$fastcgi_script_name;
#       }
#}

}

when i uncomment the mysql.oneclickfollow.com server block all trafic to the oneclickfollow.com domain get a screen saying "it works". what do i need to do in order to get PMA on mysql.oneclickfollow.com and my app site at staging.oneclickfollow.com?

share|improve this question

1 Answer

you need: 1. Setup / location properly:

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

2. check that user can access to mysql.oneclickfollow.com

tail /var/log/nginx/mysql.oneclickfollow.com.access_log
  1. check that your fastcgi is running:

    netstat -anp | grep 9000

and

tail /var/log/nginx/mysql.oneclickfollow.com.error_log
  1. check that your fastcgi configured to proper root location (in config)
  2. check that your php file is accessible from nginx (try to get php file via browser and then check logs)

Good luck!

share|improve this answer

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.