[GUIDE] Running PhpMyAdmin from vesta service
Posted: Thu May 24, 2018 10:05 pm
This will make PHP my admin run with PHP from vesta and be available on port 8083.
This guide is for setup with Nginx + PHP-FPM tested on Centos 7
First we make new temp directory for PHPMyAdmin to avoid permission issue.
Then we add set this directory as TempDir to PhpMyAdmin configuration.
in file: /etc/phpMyAdmin/config.inc.php
Nest thing we want to add admin user to apache group so that PhpMyAdmin can access the config file.
Next we edit the nginx configuration file to look like this. This also fixes the issue with documentation .
If you want you can pick change url suffix from phpmyadmin to something else by replacing "phpmyadmin" on each location parameter
in file: /etc/nginx/conf.d/phpmyadmin.inc
next we include phpmyadmin.ini vesta nginx.conf by adding the following line at the bottom of the server section
in file: /usr/local/vesta/nginx/conf/nginx.conf
next restart the vesta service
In order to have link in admin panel working properly. open Vesta CP and under DB set phpMyAdmin URL as:
Now you have PhpMyAdmin running via vesta service but it will sill be accessible at /phpmyadmin for each domain in order to disable it there modify your templates at /usr/local/vesta/data/templates/web/nginx/php-fpm/ and comment out with # or remove the following line :
After modifying templates make sure to rebuild the users either from cli or by chaining template in Vesta CP
This guide is for setup with Nginx + PHP-FPM tested on Centos 7
First we make new temp directory for PHPMyAdmin to avoid permission issue.
Code: Select all
mkdir /tmp/phpMyAdmin
chmod 777 /tmp/phpMyAdmin
in file: /etc/phpMyAdmin/config.inc.php
Code: Select all
$cfg['TempDir'] = '/tmp/phpMyAdmin';
Code: Select all
usermod -a -G apache admin
If you want you can pick change url suffix from phpmyadmin to something else by replacing "phpmyadmin" on each location parameter
in file: /etc/nginx/conf.d/phpmyadmin.inc
Code: Select all
location ^~ /phpmyadmin {
alias /usr/share/phpMyAdmin;
index index.php;
location ^~ /[phpmyadmin/(libraries|setup) {
return 404;
}
location ~ ^/phpmyadmin/(.*\.php)$ {
alias /usr/share/phpMyAdmin/$1;
fastcgi_pass unix:/var/run/vesta-php.sock;
fastcgi_index index.php;
include /usr/local/vesta/nginx/conf/fastcgi_params;
fastcgi_param SCRIPT_FILENAME $request_filename;
}
location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
alias /usr/share/phpMyAdmin/$1;
}
}
in file: /usr/local/vesta/nginx/conf/nginx.conf
Code: Select all
include /etc/nginx/conf.d/phpmyadmin.inc;
Code: Select all
service vesta restart
Code: Select all
/phpmyadmin/
Code: Select all
include /etc/nginx/conf.d/phpmyadmin.inc;