Run phpMyAdmin on Nginx in Ubuntu Precise

Previous: MariaDB – Installation on Ubuntu Precise

1. Install phpMyAdmin.

  • apt-get install phpmyadmin

 

2. Select neither Apache nor Lighttpd for the web server selection as we want to run it in Nginx.
 

3. And say NO for the Configure database for phpmyadmin with dbconfig-common?
 

4. Append the following settings in /etc/nginx/sites-available/default. Place it inside the server{}.
/etc/nginx/sites-available/default

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 $document_root$fastcgi_script_name;
    include /etc/nginx/fastcgi_params;
  }
  location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
    root /usr/share/;
  }
}
location /phpMyAdmin {
  rewrite ^/* /phpmyadmin last;
}

 

5. Restart the Nginx/

  • /etc/init.d/nginx restart

 

6. Browse the following URL.

http://<your domain>/phpmyadmin

nginx-phpmyadmin
 

Done =)

Reference:

About these ads

4 thoughts on “Run phpMyAdmin on Nginx in Ubuntu Precise

  1. Pingback: MariaDB – Installation on Ubuntu Precise | Eureka!

  2. Pingback: Run Drupal 7 in Nginx | Eureka!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s