[FIX] phpmyadmin some feature/controluser

Installation:
Universal installer with OS Checker

Code: Select all
curl -O -k https://raw.githubusercontent.com/skurudo/phpmyadmin-fixer/master/pma.sh && chmod +x pma.sh && ./pma.sh

or

Code: Select all
sudo wget –no-check-certificate https://raw.githubusercontent.com/skurudo/phpmyadmin-fixer/master/pma.sh && chmod +x pma.sh && ./pma.sh

OS Installation:
Ubuntu

Code: Select all
curl -O -k https://raw.githubusercontent.com/skurudo/phpmyadmin-fixer/master/pma-ubuntu.sh && chmod +x pma-ubuntu.sh && ./pma-ubuntu.sh

or

Code: Select all
sudo wget –no-check-certificate https://raw.githubusercontent.com/skurudo/phpmyadmin-fixer/master/pma-ubuntu.sh && chmod +x pma-ubuntu.sh && ./pma-ubuntu.sh

Debian

Code: Select all
curl -O -k https://raw.githubusercontent.com/skurudo/phpmyadmin-fixer/master/pma-debian.sh && chmod +x pma-debian.sh && ./pma-debian.sh

or

Code: Select all
wget –no-check-certificate https://raw.githubusercontent.com/skurudo/phpmyadmin-fixer/master/pma-debian.sh && chmod +x pma-debian.sh && ./pma-debian.sh

CentOS

Code: Select all
curl -O -k https://raw.githubusercontent.com/skurudo/phpmyadmin-fixer/master/pma-centos.sh && chmod +x pma-centos.sh && ./pma-centos.sh

or

Code: Select all
wget –no-check-certificate https://raw.githubusercontent.com/skurudo/phpmyadmin-fixer/master/pma-centos.sh && chmod +x pma-centos.sh && ./pma-centos.sh

What the script does:
– we don’t use pwgen for generation password anymore, no extra utilities;
– check wget/curl before downloading dump for database;
– universal installer with os detector by Sergey Rodin (VestaCP – https://vestacp.com);
– options savedsearches / navigationhiding / users / usergroups are set (for 4.x phpmyadmin);
– added table pma__usergroups (for 4.x phpmyadmin);
– sql dump on github now;
– sh files on github too.

Tested on different servers: Debian 7/8, Ubuntu 12/14/15, CentOS 6/7

Support 3.x and 4.x version of phpmyadmin
Last edited by skurudo on Sun Jan 17, 2016 8:31 pm, edited 3 times in total.
-> DigitalOcean competition – please, support us
-> fix for phpmyadmin – nice and sweet now

nginx for subfolder wordpress configuration

server {
listen      ipaddressofserver:80;
server_name xxx.xom www.xxx.com;
root        /home/username/public_html;
index       index.php index.html index.htm;
access_log  /var/log/nginx/domains/domain.xxx.com.log combined;
access_log  /var/log/nginx/domains/domain.xxx.com.bytes bytes;
error_log   /var/log/nginx/domains/domain.xxx.com.error.log error;

location = /favicon.ico {
log_not_found off;
access_log off;
}

location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location /subfolder{
try_files $uri $uri/ /subfolder/index.php?$args;
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
expires     max;
}

location ~ [^/]\.php(/|$) {
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
if (!-f $document_root$fastcgi_script_name) {
return  404;
}

fastcgi_pass    127.0.0.1:9001;
fastcgi_index   index.php;
include         /etc/nginx/fastcgi_params;
}
}

error_page  403 /error/404.html;
error_page  404 /error/404.html;
error_page  500 502 503 504 /error/50x.html;

location /error/ {
alias   /home/username/domain.com/document_errors/;
}

location ~* “/\.(htaccess|htpasswd)$” {
deny    all;
return  404;
}

include     /etc/nginx/conf.d/phpmyadmin.inc*;
include     /etc/nginx/conf.d/phppgadmin.inc*;
include     /etc/nginx/conf.d/webmail.inc*;

include     /home/username/conf/web/nginx.domain.conf*;
}

Install vesta control panel with nginx php5-fpm mysql

Now execute the command below to download Vestacp installation file:
1.curl -O http://vestacp.com/pub/vst-install.sh

2. run below command

bash vst-install.sh –nginx yes –phpfpm yes –apache no –vsftpd yes –proftpd no –exim no –dovecot no –spamassassin no –clamav no –named yes –iptables yes –fail2ban yes –mysql yes –postgresql no –remi yes –quota no

 

 

Configure phpmyadmin on Nginx

sudo apt-get update
sudo apt-get install phpmyadmin

During the installation, you will be prompted for some information. It will ask you which web server you would like the software to automatically configure. Since Nginx, the web server we are using, is not one of the available options, you can just hit TAB to bypass this prompt.

The next prompt will ask if you would like dbconfig-common to configure a database for phpmyadmin to use. Select “Yes” to continue.

You will need to enter the database administrative password that you configured during the MySQL installation to allow these changes. Afterward, you will be asked to select and confirm a password for a new database that will hold phpMyAdmin’s own data.

The installation will now complete. For the Nginx web server to find and serve the phpMyAdmin files correctly, we just need to create a symbolic link from the installation files to our Nginx document root directory by typing this:

sudo ln -s /usr/share/phpmyadmin /usr/share/nginx/html

sudo php5enmod mcrypt
sudo service php5-fpm restart

sudo nano /etc/nginx/sites-available/default

sudo service nginx restart

WordPress Nginx Configuration

server {
listen 80;

root /var/www/wordpress;
index index.php index.html index.htm;

server_name domain.com;

error_page 404 /404.html;

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
location / {
# try_files $uri $uri/ =404;
try_files $uri $uri/ /index.php?q=$uri&$args;
}

location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}

location = /favicon.ico {
access_log off;
log_not_found off;
expires max;
}
location = /robots.txt {
access_log off;
log_not_found off;
}

# Cache Static Files For As Long As Possible
location ~*
\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|css|rss|atom|js|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$
{
access_log off;
log_not_found off;
expires max;
}
# Security Settings For Better Privacy Deny Hidden Files
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}
# Return 403 Forbidden For readme.(txt|html) or license.(txt|html)
if ($request_uri ~* “^.+(readme|license)\.(txt|html)$”) {
return 403;
}
# Disallow PHP In Upload Folder
location /wp-content/uploads/ {
location ~ \.php$ {
deny all;
}
}
}