Update VestaCP to PHP 7 on CentOS 7

First let’s make sure your server is up to date.

sudo yum update

Now we make sure that yum-utils is installed

sudo yum install yum-utils

If it’s already installed, great move on to the next step, if not then allow it to install.
Now we can enable remi-php70
sudo yum-config-manager –enable remi-php70

Now we can tell yum to update, this will upgrade our old version of PHP to 7
sudo yum update

sudo service php-fpm restart

php -v

start apache2,mysql,nginx from shell script root crontab on ubuntu

in case Debian 3.2.68 distribution . all syntax will be working fine as per my live test.

cd /usr/local/vesta/bin

sudo nano apache-restart.sh

type following..



ps auxw | grep apache2 | grep -v grep > /dev/null

if [ $? != 0 ]
        service apache2 start > /dev/null
save it as apache-restart.sh
sudo nano mysql-restart.sh
/usr/bin/mysqladmin ping| grep 'mysql is alive' > /dev/null 2>&1
if [ $? != 0 ]
 sudo service mysql restart
save it as mysql-restart.sh

sudo nginx-restart.sh

sudo service nginx status > /dev/null

if [ $? != 0 ]
 echo "nginx stopped"
 sudo service nginx start > /dev/null
 echo "nginx start"

type crontab -e and type the following shell script to run every minute from root cron user.

* * * * * sh -x /usr/local/vesta/bin/mysql-restart.sh
* * * * * sh -x /usr/local/vesta/bin/apache-restart.sh
* * * * * sh -x /usr/local/vesta/bin/nginx-restart.sh

and save it . that's all. in case any problem you can contact me at [email protected]


[FIX] phpmyadmin some feature/controluser

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


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:

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


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


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


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


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


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_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