Anche per gli utenti Windows, il tool rsync è un’alternativa interessante e conveniente rispetto ai costosi software di backup.
Per poter utilizzare questo protocollo, dovete però installare Cygwin.
Con l’aiuto di questa distribuzione simile a Linux si possono utilizzare anche sui sistemi operativi Windows diversi programmi Linux.
Procedete così per l’installazione:
Scaricate Cygwin al seguente link: cygwin.com/index.html.
Aprite il pacchetto, scegliete i moduli “rsync” e “openssh” e installateli.
Create un collegamento nello start menu o sul desktop.
Aprite il terminale di Cygwin tramite il collegamento creato e iniziate la configurazione SSH tramite il comando:
ssh-host-config
(possibile solo se si esegue il programma come amministratore, cliccando con il tasto destro del mouse)
Rispondete alle prime domande con “yes” e alla domanda “Do you want to use a different name?” (Volete scegliere un altro nome?) con “no”.
Infine, create un nuovo account, inserendo sempre “yes”, e scegliete la vostra password personale.
Avviate il servizio SSH con l’immissione del comando:
net start sshd
In questo modo, la configurazione della sincronizzazione crittografata con rsync è impostata su Windows e il servizio può essere utilizzato tramite il terminale di Cygwin, grazie ai comandi conosciuti di Linux. Qui bisogna però prestare attenzione ai tipici percorsi di Windows, oltre che agli utenti e ai gruppi.
Fonte: https://www.ionos.it/digitalguide/server/tools-o-strumenti/fare-il-backup-del-server-con-rsync
giovedì, novembre 07, 2019
domenica, giugno 16, 2019
VESTA CONTROL PANEL Tutorial installazione versioni diverse di PHP
Vesta Control Panel - Forum
Community Forum
https://forum.vestacp.com/
Community Forum
https://forum.vestacp.com/
https://forum.vestacp.com/
TUTORIAL: PHP selector for PHP 5.6, 7.0, 7.1, 7.2, 7.3 for Debian and Ubuntu (and optionally directly nginx-PHP-FPM)
Page 1 of 8
Page 1 of 8
TUTORIAL: PHP selector for PHP 5.6, 7.0, 7.1, 7.2, 7.3 for Debian and Ubuntu (and optionally directly nginx-PHP-FPM)
Posted: Fri Jun 15, 2018 11:28 am
by dpeca
This tutorial will enable PHP 5.6, 7.0, 7.1, 7.2 and 7.3 to specific/desired domains.
Tutorial is for Debian and Ubuntu (but probably can give you a good direction for CentOS).
PHP will run through PHP-FPM, which is much more faster solution than other existent PHP-switcher that uses only old phpfcgid solution (because with PHP-FPM you can use opcache).
Communication to PHP-FPM will goes through Unix-sockets, which is also the fastest communication between daemons.
Second tutorial goes a step forward - it will allow you to make direct communication from nginx to PHP-FPM, avoiding Apache for desired domains (Apache is installed by default in default Vesta installation).
So, yes, you can easily make nginx <-> PHP-FPM stack even if you have Apache installed.
And yet better news - you can use it only on desired domains - so all other domains will stay untouched.
First pre-required step for Debian 9:
apt-get update
apt install apt-transport-https ca-certificates
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
sh -c 'echo "deb https://packages.sury.org/php/ stretch main" > /etc/apt/sources.list.d/php.list'
First pre-required step for Debian 8:
apt-get update
apt install apt-transport-https ca-certificates
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
sh -c 'echo "deb https://packages.sury.org/php/ jessie main" > /etc/apt/sources.list.d/php.list'
First pre-required step for Ubuntu:
apt-get update
apt install apt-transport-https ca-certificates
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
Then in your browser go to https://launchpad.net/~ondrej/+archive/ubuntu/php/
Under Adding this PPA to your system click Technical details about this PPA, select your Ubuntu version, and two lines that you get from field box below add to /etc/apt/sources.list.d/php.list
Second pre-required step for both Debian and Ubuntu:
apt-get update
a2enmod proxy_fcgi setenvif
For PHP 5.6
apt-get install php5.6-apcu php5.6-mbstring php5.6-bcmath php5.6-cli php5.6-curl php5.6-fpm php5.6-gd php5.6-intl php5.6-mcrypt php5.6-mysql php5.6-soap php5.6-xml php5.6-zip php5.6-memcache php5.6-memcached php5.6-zip
update-rc.d php5.6-fpm defaults
a2enconf php5.6-fpm
systemctl restart apache2
cp -r /etc/php/5.6/ /root/vst_install_backups/php5.6/
rm -f /etc/php/5.6/fpm/pool.d/*
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-56.stpl -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-56.stpl
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-56.tpl -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-56.tpl
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-56.sh -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-56.sh
chmod a+x /usr/local/vesta/data/templates/web/apache2/PHP-FPM-56.sh
For PHP 7.0
apt-get install php7.0-apcu php7.0-mbstring php7.0-bcmath php7.0-cli php7.0-curl php7.0-fpm php7.0-gd php7.0-intl php7.0-mcrypt php7.0-mysql php7.0-soap php7.0-xml php7.0-zip php7.0-memcache php7.0-memcached php7.0-zip
update-rc.d php7.0-fpm defaults
a2enconf php7.0-fpm
systemctl restart apache2
cp -r /etc/php/7.0/ /root/vst_install_backups/php7.0/
rm -f /etc/php/7.0/fpm/pool.d/*
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-70.stpl -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-70.stpl
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-70.tpl -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-70.tpl
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-70.sh -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-70.sh
chmod a+x /usr/local/vesta/data/templates/web/apache2/PHP-FPM-70.sh
For PHP 7.1
apt-get install php7.1-apcu php7.1-mbstring php7.1-bcmath php7.1-cli php7.1-curl php7.1-fpm php7.1-gd php7.1-intl php7.1-mcrypt php7.1-mysql php7.1-soap php7.1-xml php7.1-zip php7.1-memcache php7.1-memcached php7.1-zip
update-rc.d php7.1-fpm defaults
a2enconf php7.1-fpm
systemctl restart apache2
cp -r /etc/php/7.1/ /root/vst_install_backups/php7.1/
rm -f /etc/php/7.1/fpm/pool.d/*
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-71.stpl -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-71.stpl
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-71.tpl -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-71.tpl
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-71.sh -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-71.sh
chmod a+x /usr/local/vesta/data/templates/web/apache2/PHP-FPM-71.sh
For PHP 7.2
apt-get install php7.2-apcu php7.2-mbstring php7.2-bcmath php7.2-cli php7.2-curl php7.2-fpm php7.2-gd php7.2-intl php7.2-mysql php7.2-soap php7.2-xml php7.2-zip php7.2-memcache php7.2-memcached php7.2-zip
update-rc.d php7.2-fpm defaults
a2enconf php7.2-fpm
systemctl restart apache2
cp -r /etc/php/7.2/ /root/vst_install_backups/php7.2/
rm -f /etc/php/7.2/fpm/pool.d/*
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-72.stpl -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-72.stpl
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-72.tpl -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-72.tpl
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-72.sh -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-72.sh
chmod a+x /usr/local/vesta/data/templates/web/apache2/PHP-FPM-72.sh
For PHP 7.3
apt-get install php7.3-apcu php7.3-mbstring php7.3-bcmath php7.3-cli php7.3-curl php7.3-fpm php7.3-gd php7.3-intl php7.3-mysql php7.3-soap php7.3-xml php7.3-zip php7.3-memcache php7.3-memcached php7.3-zip
update-rc.d php7.3-fpm defaults
a2enconf php7.3-fpm
systemctl restart apache2
cp -r /etc/php/7.3/ /root/vst_install_backups/php7.3/
rm -f /etc/php/7.3/fpm/pool.d/*
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-73.stpl -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-73.stpl
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-73.tpl -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-73.tpl
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-73.sh -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-73.sh
chmod a+x /usr/local/vesta/data/templates/web/apache2/PHP-FPM-73.sh
For PHP 7.4
apt-get install php7.4-apcu php7.4-mbstring php7.4-bcmath php7.4-cli php7.4-curl php7.4-fpm php7.4-gd php7.4-intl php7.4-mysql php7.4-soap php7.4-xml php7.4-zip php7.4-memcache php7.4-memcached php7.4-zip
update-rc.d php7.4-fpm defaults
a2enconf php7.4-fpm
systemctl restart apache2
cp -r /etc/php/7.4/ /root/vst_install_backups/php7.4/
rm -f /etc/php/7.4/fpm/pool.d/*
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-74.stpl -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-74.stpl
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-74.tpl -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-74.tpl
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-74.sh -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-74.sh
chmod a+x /usr/local/vesta/data/templates/web/apache2/PHP-FPM-74.sh
Posted: Fri Jun 15, 2018 11:28 am
by dpeca
This tutorial will enable PHP 5.6, 7.0, 7.1, 7.2 and 7.3 to specific/desired domains.
Tutorial is for Debian and Ubuntu (but probably can give you a good direction for CentOS).
PHP will run through PHP-FPM, which is much more faster solution than other existent PHP-switcher that uses only old phpfcgid solution (because with PHP-FPM you can use opcache).
Communication to PHP-FPM will goes through Unix-sockets, which is also the fastest communication between daemons.
Second tutorial goes a step forward - it will allow you to make direct communication from nginx to PHP-FPM, avoiding Apache for desired domains (Apache is installed by default in default Vesta installation).
So, yes, you can easily make nginx <-> PHP-FPM stack even if you have Apache installed.
And yet better news - you can use it only on desired domains - so all other domains will stay untouched.
First pre-required step for Debian 9:
apt-get updateapt install apt-transport-https ca-certificates
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
sh -c 'echo "deb https://packages.sury.org/php/ stretch main" > /etc/apt/sources.list.d/php.list'
First pre-required step for Debian 8:
apt-get updateapt install apt-transport-https ca-certificates
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
sh -c 'echo "deb https://packages.sury.org/php/ jessie main" > /etc/apt/sources.list.d/php.list'
First pre-required step for Ubuntu:
apt-get updateapt install apt-transport-https ca-certificates
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
Then in your browser go to https://launchpad.net/~ondrej/+archive/ubuntu/php/
Under Adding this PPA to your system click Technical details about this PPA, select your Ubuntu version, and two lines that you get from field box below add to /etc/apt/sources.list.d/php.list
Second pre-required step for both Debian and Ubuntu:
apt-get update
a2enmod proxy_fcgi setenvif
For PHP 5.6
apt-get install php5.6-apcu php5.6-mbstring php5.6-bcmath php5.6-cli php5.6-curl php5.6-fpm php5.6-gd php5.6-intl php5.6-mcrypt php5.6-mysql php5.6-soap php5.6-xml php5.6-zip php5.6-memcache php5.6-memcached php5.6-zip
update-rc.d php5.6-fpm defaults
a2enconf php5.6-fpm
systemctl restart apache2
cp -r /etc/php/5.6/ /root/vst_install_backups/php5.6/
rm -f /etc/php/5.6/fpm/pool.d/*
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-56.stpl -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-56.stpl
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-56.tpl -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-56.tpl
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-56.sh -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-56.sh
chmod a+x /usr/local/vesta/data/templates/web/apache2/PHP-FPM-56.sh
For PHP 7.0
apt-get install php7.0-apcu php7.0-mbstring php7.0-bcmath php7.0-cli php7.0-curl php7.0-fpm php7.0-gd php7.0-intl php7.0-mcrypt php7.0-mysql php7.0-soap php7.0-xml php7.0-zip php7.0-memcache php7.0-memcached php7.0-zip
update-rc.d php7.0-fpm defaults
a2enconf php7.0-fpm
systemctl restart apache2
cp -r /etc/php/7.0/ /root/vst_install_backups/php7.0/
rm -f /etc/php/7.0/fpm/pool.d/*
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-70.stpl -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-70.stpl
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-70.tpl -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-70.tpl
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-70.sh -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-70.sh
chmod a+x /usr/local/vesta/data/templates/web/apache2/PHP-FPM-70.sh
For PHP 7.1
apt-get install php7.1-apcu php7.1-mbstring php7.1-bcmath php7.1-cli php7.1-curl php7.1-fpm php7.1-gd php7.1-intl php7.1-mcrypt php7.1-mysql php7.1-soap php7.1-xml php7.1-zip php7.1-memcache php7.1-memcached php7.1-zip
update-rc.d php7.1-fpm defaults
a2enconf php7.1-fpm
systemctl restart apache2
cp -r /etc/php/7.1/ /root/vst_install_backups/php7.1/
rm -f /etc/php/7.1/fpm/pool.d/*
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-71.stpl -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-71.stpl
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-71.tpl -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-71.tpl
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-71.sh -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-71.sh
chmod a+x /usr/local/vesta/data/templates/web/apache2/PHP-FPM-71.sh
For PHP 7.2
apt-get install php7.2-apcu php7.2-mbstring php7.2-bcmath php7.2-cli php7.2-curl php7.2-fpm php7.2-gd php7.2-intl php7.2-mysql php7.2-soap php7.2-xml php7.2-zip php7.2-memcache php7.2-memcached php7.2-zip
update-rc.d php7.2-fpm defaults
a2enconf php7.2-fpm
systemctl restart apache2
cp -r /etc/php/7.2/ /root/vst_install_backups/php7.2/
rm -f /etc/php/7.2/fpm/pool.d/*
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-72.stpl -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-72.stpl
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-72.tpl -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-72.tpl
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-72.sh -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-72.sh
chmod a+x /usr/local/vesta/data/templates/web/apache2/PHP-FPM-72.sh
For PHP 7.3
apt-get install php7.3-apcu php7.3-mbstring php7.3-bcmath php7.3-cli php7.3-curl php7.3-fpm php7.3-gd php7.3-intl php7.3-mysql php7.3-soap php7.3-xml php7.3-zip php7.3-memcache php7.3-memcached php7.3-zip
update-rc.d php7.3-fpm defaults
a2enconf php7.3-fpm
systemctl restart apache2
cp -r /etc/php/7.3/ /root/vst_install_backups/php7.3/
rm -f /etc/php/7.3/fpm/pool.d/*
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-73.stpl -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-73.stpl
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-73.tpl -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-73.tpl
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-73.sh -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-73.sh
chmod a+x /usr/local/vesta/data/templates/web/apache2/PHP-FPM-73.sh
For PHP 7.4
apt-get install php7.4-apcu php7.4-mbstring php7.4-bcmath php7.4-cli php7.4-curl php7.4-fpm php7.4-gd php7.4-intl php7.4-mysql php7.4-soap php7.4-xml php7.4-zip php7.4-memcache php7.4-memcached php7.4-zip
update-rc.d php7.4-fpm defaults
a2enconf php7.4-fpm
systemctl restart apache2
cp -r /etc/php/7.4/ /root/vst_install_backups/php7.4/
rm -f /etc/php/7.4/fpm/pool.d/*
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-74.stpl -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-74.stpl
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-74.tpl -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-74.tpl
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-74.sh -O /usr/local/vesta/data/templates/web/apache2/PHP-FPM-74.sh
chmod a+x /usr/local/vesta/data/templates/web/apache2/PHP-FPM-74.sh
Step forward: Enable direct communication between nginx and php-fpm (if you want to avoid Apache for specific domain)
Posted: Fri Jun 15, 2018 11:31 am
by dpeca
Step forward: Enable direct communication between nginx and php-fpm (if you want to avoid Apache for specific domain)
As I said in first post, second tutorial goes a step forward - it will allow you to make direct communication from nginx to PHP-FPM, avoiding Apache for desired domains (Apache is installed by default in default Vesta installation).
So, yes, you can easily make nginx <-> PHP-FPM stack even if you have Apache installed.
And yet better news - you can use it only on desired domains - so all other domains will stay untouched.
For custom PHP CMS:
wget https://raw.githubusercontent.com/serghey-rodin/vesta/master/install/debian/9/templates/web/nginx/php-fpm/default.tpl -O /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72.tpl
wget https://raw.githubusercontent.com/serghey-rodin/vesta/master/install/debian/9/templates/web/nginx/php-fpm/default.stpl -O /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72.stpl
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-72.sh -O /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72.sh
chmod a+x /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72.sh
sed -i "s#%web_port%#%proxy_port%#g" /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72.tpl
sed -i "s#%web_ssl_port%#%proxy_ssl_port%#g" /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72.stpl
sed -i "s#%backend_lsnr%#unix:/run/php/php7.2-fpm-%domain%.sock#g" /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72.tpl
sed -i "s#%backend_lsnr%#unix:/run/php/php7.2-fpm-%domain%.sock#g" /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72.stpl
sed -i "s#/var/log/nginx/#/var/log/%web_system%/#g" /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72.tpl
sed -i "s#/var/log/nginx/#/var/log/%web_system%/#g" /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72.stpl
For WordPress:
wget https://raw.githubusercontent.com/serghey-rodin/vesta/master/install/debian/9/templates/web/nginx/php-fpm/wordpress2.tpl -O /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72-Wordpress.tpl
wget https://raw.githubusercontent.com/serghey-rodin/vesta/master/install/debian/9/templates/web/nginx/php-fpm/wordpress2.stpl -O /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72-Wordpress.stpl
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-72.sh -O /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72-Wordpress.sh
chmod a+x /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72-Wordpress.sh
sed -i "s#%web_port%#%proxy_port%#g" /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72-Wordpress.tpl
sed -i "s#%web_ssl_port%#%proxy_ssl_port%#g" /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72-Wordpress.stpl
sed -i "s#%backend_lsnr%#unix:/run/php/php7.2-fpm-%domain%.sock#g" /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72-Wordpress.tpl
sed -i "s#%backend_lsnr%#unix:/run/php/php7.2-fpm-%domain%.sock#g" /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72-Wordpress.stpl
sed -i "s#/var/log/nginx/#/var/log/%web_system%/#g" /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72-Wordpress.tpl
sed -i "s#/var/log/nginx/#/var/log/%web_system%/#g" /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72-Wordpress.stpl
This way you can adapt any other existent Vesta PHP-FPM template for other CMS.
(list of CMS templates is here - https://github.com/serghey-rodin/vesta/ ... nx/php-fpm )
This is example for PHP 7.2.
You can install templates for other PHP version the same way, just substitute 7.2 and 72 with desired version.
Now simply go to Vesta, edit WEB for desired domain and choose:
Posted: Fri Jun 15, 2018 11:31 am
by dpeca
Step forward: Enable direct communication between nginx and php-fpm (if you want to avoid Apache for specific domain)
As I said in first post, second tutorial goes a step forward - it will allow you to make direct communication from nginx to PHP-FPM, avoiding Apache for desired domains (Apache is installed by default in default Vesta installation).
So, yes, you can easily make nginx <-> PHP-FPM stack even if you have Apache installed.
And yet better news - you can use it only on desired domains - so all other domains will stay untouched.
For custom PHP CMS:
For WordPress:
This way you can adapt any other existent Vesta PHP-FPM template for other CMS.
(list of CMS templates is here - https://github.com/serghey-rodin/vesta/ ... nx/php-fpm )
This is example for PHP 7.2.
You can install templates for other PHP version the same way, just substitute 7.2 and 72 with desired version.
Now simply go to Vesta, edit WEB for desired domain and choose:
As I said in first post, second tutorial goes a step forward - it will allow you to make direct communication from nginx to PHP-FPM, avoiding Apache for desired domains (Apache is installed by default in default Vesta installation).
So, yes, you can easily make nginx <-> PHP-FPM stack even if you have Apache installed.
And yet better news - you can use it only on desired domains - so all other domains will stay untouched.
For custom PHP CMS:
wget https://raw.githubusercontent.com/serghey-rodin/vesta/master/install/debian/9/templates/web/nginx/php-fpm/default.tpl -O /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72.tpl
wget https://raw.githubusercontent.com/serghey-rodin/vesta/master/install/debian/9/templates/web/nginx/php-fpm/default.stpl -O /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72.stpl
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-72.sh -O /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72.sh
chmod a+x /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72.sh
sed -i "s#%web_port%#%proxy_port%#g" /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72.tpl
sed -i "s#%web_ssl_port%#%proxy_ssl_port%#g" /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72.stpl
sed -i "s#%backend_lsnr%#unix:/run/php/php7.2-fpm-%domain%.sock#g" /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72.tpl
sed -i "s#%backend_lsnr%#unix:/run/php/php7.2-fpm-%domain%.sock#g" /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72.stpl
sed -i "s#/var/log/nginx/#/var/log/%web_system%/#g" /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72.tpl
sed -i "s#/var/log/nginx/#/var/log/%web_system%/#g" /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72.stpl
For WordPress:
wget https://raw.githubusercontent.com/serghey-rodin/vesta/master/install/debian/9/templates/web/nginx/php-fpm/wordpress2.tpl -O /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72-Wordpress.tpl
wget https://raw.githubusercontent.com/serghey-rodin/vesta/master/install/debian/9/templates/web/nginx/php-fpm/wordpress2.stpl -O /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72-Wordpress.stpl
wget http://dl.mycity.tech/vesta/php-fpm-tpl/PHP-FPM-72.sh -O /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72-Wordpress.sh
chmod a+x /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72-Wordpress.sh
sed -i "s#%web_port%#%proxy_port%#g" /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72-Wordpress.tpl
sed -i "s#%web_ssl_port%#%proxy_ssl_port%#g" /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72-Wordpress.stpl
sed -i "s#%backend_lsnr%#unix:/run/php/php7.2-fpm-%domain%.sock#g" /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72-Wordpress.tpl
sed -i "s#%backend_lsnr%#unix:/run/php/php7.2-fpm-%domain%.sock#g" /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72-Wordpress.stpl
sed -i "s#/var/log/nginx/#/var/log/%web_system%/#g" /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72-Wordpress.tpl
sed -i "s#/var/log/nginx/#/var/log/%web_system%/#g" /usr/local/vesta/data/templates/web/nginx/PHP-FPM-72-Wordpress.stpl
(list of CMS templates is here - https://github.com/serghey-rodin/vesta/ ... nx/php-fpm )
This is example for PHP 7.2.
You can install templates for other PHP version the same way, just substitute 7.2 and 72 with desired version.
Now simply go to Vesta, edit WEB for desired domain and choose:
mercoledì, marzo 14, 2018
Abilitare l'interpretazione del file .HTACCESS per APACHE su Linux
Sul proprio server abilitare il MOD_REWRITE
# a2enmod rewriteEditare il file di configurazione di Apache, nel nostro caso nella directory /etc/apache2/sites-available/ aggiungendo dentro la direttiva <Directory...> le righe
AllowOverride allRiavviare il servizio apache
Options all
domenica, febbraio 18, 2018
VPN configurazione su UBUNTU e connessione con WINDOWS
Installa il server VPN PPDPT su linux
Su ubuntu
Modifica il file di configurazione /etc/pptpd.conf aggiungendo le seguenti voci
dove localip è l'ip del server vpn mentre il remoteip sono gli ip assegnati ai client
Modifica il file /etc/ppp/pptpd-options aggiungendo le voci
dove ms-dns è il dns comune che si vorrà utilizzare
Modifica il file /etc/ppp/chap-secrets aggiungendo gli utenti e le password per l'autenticazione all'accesso. le voci dovranno essere separate da un TAB
Ravviare il daemon con /etc/init.d/pptpd restart
Connessione su windows:
Su ubuntu
apt install pptpd
Modifica il file di configurazione /etc/pptpd.conf aggiungendo le seguenti voci
localip 192.168.1.156
remoteip 192.168.1.157-200
dove localip è l'ip del server vpn mentre il remoteip sono gli ip assegnati ai client
Modifica il file /etc/ppp/pptpd-options aggiungendo le voci
ms-dns 192.168.1.1
nobsdcomp
noipx
mtu 1490
mru 1490
dove ms-dns è il dns comune che si vorrà utilizzare
Modifica il file /etc/ppp/chap-secrets aggiungendo gli utenti e le password per l'autenticazione all'accesso. le voci dovranno essere separate da un TAB
# client server secret IP addresses
pippo * passworddipippo *
Ravviare il daemon con /etc/init.d/pptpd restart
Cosa importante, aprire le seguenti porte TCP sul router: 1723 TCP, 47 TCP
Connessione su windows:
- Configura nuova connessione di rete
- Connessione a rete aziendale
- Usa connessione internet esistente VPN
- Inserisci ip pubblico del server linux VPN
giovedì, febbraio 15, 2018
Conversione e migrazione file di posta Outlook PST in thunderbird
La comoda utility "readpst" su linux permette di convertire i files .PST nel formato .EML importabile in thunderbird con il plugin "ImportExportTools"
Per usare il comando readpst in windows basterà installare e usare il programma "CYGWIN Terminal"
cd /home/user/Downloads
mkdir outlook
mkdir archive
readpst -o ./outlook -M -u -w -e -b outlook.pst
readpst -o ./archive -M -u -w -e -b archive.pst
sabato, dicembre 16, 2017
Linux CHMOD solo su cartelle oppure solo su files
Ecco una risoluzione che può tornare utile.
Mi trovo con la necessità di resettare le permission di un Wordpress che come noto ha le directories in 755 ed i files a 644.In FTP la cosa diventa lunga e con accesso da terminale possiamo usare:
find /path/to/base/dir -type d -exec chmod 755 {} +
find /path/to/base/dir -type f -exec chmod 644 {} +
domenica, maggio 21, 2017
Ubuntu Remote Desktop VNC XRDP
Velocissima soluzione per connetterti al tuo server linux in modalità grafica con VNC.
Il desktop grafico scelto per il server è "XFCE" molto leggero e veloce, non mi serve altro!
Aprire il terminale e installare i seguenti pacchetti:
Es. sessione 1 porta tcp 5901, sessione 2 porta tcp 5902, ecc...
Il desktop grafico scelto per il server è "XFCE" molto leggero e veloce, non mi serve altro!
Aprire il terminale e installare i seguenti pacchetti:
sudo apt-get install -y xfce4 tightvncserver xrdpCreare il file di configurazione
cat > ~/.vnc/xstartup <<EOFAvviare il server VNC
#!/bin/sh
startxfce4 &
EOF
chmod +x ~/.vnc/xstartup
vncserverPer fermarlo
vncserver -kill :<numero sessione>Le porte da aprire per accesso con ip pubblico variano dal numero di sessione aperta.
Es. sessione 1 porta tcp 5901, sessione 2 porta tcp 5902, ecc...
mercoledì, marzo 29, 2017
Vedere elenco cartelle condivise e a disposizione su un server SMB
Uso il comando smbclient
# smbclient -L <server> -Uusername
lunedì, marzo 27, 2017
sshpass, per inserire password dentro script di comandi
Poco sicuro ma efficace, mi è tornato utile per effettuare una serie di rsync temporanei senza attendere l'esecuzione degli stessi per inserire la password di accesso successiva.
Installazione e uso
Installazione e uso
# apt install sshpass
# sshpass -p <password> rsync -av --delete user@ip:/directory /mnt/drive
sabato, novembre 05, 2016
Streaming webcam con MOTION (ubuntu 14)
Streaming USB webcam su browser con MOTION su Ubuntu 14.04
Procedura per installare MOTION su Ubuntu visto la necessità di avere una webcam di videosorveglianza
Modifica il file di configurazione situato in /etc/default/motion con la seguente impostazione
Ora modifica il file che trovi in /etc/motion/motion.conf con le seguenti impostazioni
Avvia MOTION con il seguente comando
Per visualizzare la cam su browser
Per visualizzare impostazioni
Per interrompere il salvataggio di immagini e video catturate con il Detect Motion e usare solo per Live streaming
Esempio pagina html per esecuzione live camera avvio-sorveglianza-live.html
Procedura per installare MOTION su Ubuntu visto la necessità di avere una webcam di videosorveglianza
sudo apt-get install motion
Modifica il file di configurazione situato in /etc/default/motion con la seguente impostazione
start_motion_daemon=yes
Ora modifica il file che trovi in /etc/motion/motion.conf con le seguenti impostazioni
webcam_quality 85
webcam_localhost off
webcam_port 8080
webcam_motion on
webcam_maxrate 5
control_port8081
control_localhost off
Avvia MOTION con il seguente comando
sudo service motion start
Per visualizzare la cam su browser
http://127.0.0.1:8080
Per visualizzare impostazioni
http://127.0.0.1:8081
Per interrompere il salvataggio di immagini e video catturate con il Detect Motion e usare solo per Live streaming
http://127.0.0.1:8081/0/detection/pause
Esempio pagina html per esecuzione live camera avvio-sorveglianza-live.html
<html>
<head></head>
<body>
<img src="http://114.114.114.155:8080/0/detection/pause" style="display:none"/>
<img src="http://114.114.114.155:8081"/>
</body>
</html>
lunedì, gennaio 25, 2016
Linux eseguire procedure con comando SCREEN
Il comando screen in linux permette di eseguire procedure lunghe come trasferimenti da terminali remoti senza dover necessariamente tenere aperta la shell.
Installare screen con:
# apt-get install screen
Aprire il terminale (putty) ed eseguire un qualsiasi comando, come ad esempio un rsync, con il comando screen
# screen rsync -av /sorgente /destinazione
Ora chiudendo il terminale putty dalla "X" l'esecuzione del comando rsync non verrà interrotta ma proseguirà fino alla conclusione naturale.
In caso di verifica basterà riaprire il terminale putty e dopo il login eseguire
# screen -r
mercoledì, luglio 08, 2015
Linux Debian/Ubuntu, default GATEWAY e DNS
Login as the root and type:
# ip route add default via 192.168.1.254
OR
$ sudo ip route add default via 192.168.1.254
route command to set a default router to 192.168.1.254
Login as the root and type:
# route add default gw 192.168.1.254
OR
$ sudo route add default gw 192.168.1.254
Save routing information to a configuration file /etc/network/interfaces
Open /etc/network/interfaces file
# vi /etc/network/interfaces
OR
$ sudo vi /etc/network/interfaces
Find eth0 or desired network interface and add following option
gateway 192.168.1.254
Save and close the file. Restart networking:
# /etc/init.d/networking restart
OR
$ sudo /etc/init.d/networking restart
Per i DNS, editare il file /etc/resolv.conf ed aggiungere:
nameserver 8.8.8.8
nameserver 8.8.4.4
domenica, aprile 12, 2015
Script in PHP per cancellazione di files
Ho trovato questo script in php molto utile per la cancellazione di intere directory e contenuti, cosa che molto spesso capita di fare e che molto spesso non ci si riesce a causa di crash continui o blocchi del client ftp di turno.
Indicare a fine listato la directory da rimuovere: remove('it/');Script:
<?php
function remove($dirname = '.')
{
if (is_dir($dirname))
{
echo "$dirname is a directory.<br />";
if ($handle = @opendir($dirname))
{
while (($file = readdir($handle)) !== false)
{
if ($file != "." && $file != "..")
{
echo "$file<br />";
$fullpath = $dirname . '/' . $file;
if (is_dir($fullpath))
{
remove($fullpath);
@rmdir($fullpath);
}
else
{
@unlink($fullpath);
}
}
}
closedir($handle);
}
}
}
remove('it/'); // Questa e' la directory che verrà svuotata.
?>
lunedì, giugno 23, 2014
Accedere in SSH senza effettuare sempre il LOGIN
Per accedere ad una macchina tramite SSH senza dover tutte le volte digitare la password bisogna generare una chiave da posizionare nella directory utente\.ssh
Ci verrà chiesta la password di utente2 e il file id_rsa.pub, contenente la chiave pubblica, verrà copiata nella home di utente2 su linuxbox2. A questo punto facciamo il login su linuxbox2 (ovviamente come utente2), e copiamo il contenuto del file appena copiato nel file /home/utente2/.ssh/authorized_keys:
A questo punto basterà provare a collegarsi dall’host linuxbox1 su linuxbox2 per connettersi a patto di inserire la passphrase scelta (per quanto sconsigliabile questa può anche non essere inserita, a patto di creare una coppia di chiavi con passphrase vuota):
- generare la chiaveA questo punto dovremmo copiare la chiave pubblica sul server SSH. Questa essendo pubblica può essere letta da chiunque, senza problemi di sicurezza. Per copiarla possiamo usare anche scp, programma per la copia di SSH. Ipotizzando che il server si chiami linuxbox2 e che l’utente si chiami utente2, il comando sarà:
[utente@linuxbox1 ~]$ ssh-keygen -b 2048 -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/utente/.ssh/id_rsa):
Created directory '/home/utente/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/utente/.ssh/id_rsa.
Your public key has been saved in /home/utente/.ssh/id_rsa.pub.
The key fingerprint is:
90:98:4f:f5:69:39:57:5d:46:83:a4:a2:d6:63:3c:25
[utente@linuxbox1 ~]$ scp /home/utente/.ssh/id_rsa.pub utente2@linuxbox2:.
Ci verrà chiesta la password di utente2 e il file id_rsa.pub, contenente la chiave pubblica, verrà copiata nella home di utente2 su linuxbox2. A questo punto facciamo il login su linuxbox2 (ovviamente come utente2), e copiamo il contenuto del file appena copiato nel file /home/utente2/.ssh/authorized_keys:
cat /home/utente2/id_rsa.pub >> /home/utente2/.ssh/authorized_keys
A questo punto basterà provare a collegarsi dall’host linuxbox1 su linuxbox2 per connettersi a patto di inserire la passphrase scelta (per quanto sconsigliabile questa può anche non essere inserita, a patto di creare una coppia di chiavi con passphrase vuota):
ssh utente2@linuxbox2
Trasferire file da Linux a Linux
Mi trovo con la necessità di trasferire i dati da un vecchio server Linux ad uno nuovo, ho usato il comando SCP (ssh)
da ALTRO PC ad QUESTO PC
# scp -r user@ip:/dir/da/copiare .
# scp -r user@ip:/dir/da copiare /destinazione
nota: usare il punto per directory corrente e -r per directory comprese
da QUESTO PC ad ALTRO PC
# scp <miofile> user@ip:/dir/destinazione
mercoledì, giugno 04, 2014
[GNU/Linux] Montare disco di rete da shell
Per montare un disco di rete da shell, la sintassi del comando è la seguente:
Dove al posto di protocollo è necessario specificare il protocollo/file system da usare per la condivisione dei file (cifs, nfs), come avviene similmente nel caso si debba montare un disco locale (ntfs, ext2, ext3, ext4, …).
esempio da un sistema Windows:
mount -t protocollo //percorso_da_montare/directory /directory_destinazione -o username=user,password=pwd,sec=ntlm
Dove al posto di protocollo è necessario specificare il protocollo/file system da usare per la condivisione dei file (cifs, nfs), come avviene similmente nel caso si debba montare un disco locale (ntfs, ext2, ext3, ext4, …).
esempio da un sistema Windows:
mount -t cifs //reteazienda.it/documenti /mnt/dati_condivisi -o username=matteo,password=12345678,sec=ntlm
domenica, agosto 11, 2013
Rsync - failed: Operation not supported (95)
martedì, giugno 11, 2013
Script di backup con RSYNC
Nota:
Per verificare se un'unità è montata verifico semplicemente l'esistenza e la scrittura di un file presente sull'unità di destinazione. Nella root principale del disco esterno creo un file chiamato ".controllo" e verifico se il file esiste, se può essere letto e se può essere scritto.
#!/bin/sh
FILE="/mnt/nas/.controllo";
if [ -r $FILE -a -w $FILE ]; then
echo "Verifica destinazione: OK"
else
echo "errore, destinazione non raggiungibile, provo a fare un mount del disco"
mount /mnt/nas
fi
if [ -r $FILE -a -w $FILE ]; then
echo "Inizio il backup in data: $(date)"
/usr/bin/sudo rsync -av --delete --no-group --no-owner /home /mnt/nas/backup
else
echo "Attenzione non è possibile effettuare il backup. Destinazione non disponibile"
fi
mercoledì, maggio 22, 2013
Verificare se un volume è montato MOUNT
Faccio una verifica nel file /proc/mounts se esiste la riga in riferimento al volume desiderato:
Per info, nel file /proc/mounts vengono elencati tutti i mount effettuati sulla macchina
#!/bin/sh
if grep -qs '/mnt/miacartella' /proc/mounts; then
echo "il volume è montato!";
else
echo "il volume non è montato!";
fi
Per info, nel file /proc/mounts vengono elencati tutti i mount effettuati sulla macchina
SMBFS mount
Articolo preso da: http://www.linuxnix.com/2009/09/8-ways-to-mount-smbfs-samba-file-system-in-linux.html
How to Mount smbfs (SAMBA file system) permanently in Linux.In this post I am going to give some examples how to do SMB (Server Message Block) mounts.
Type1 : Listing SMB shared folder through command prompt
#smbclient –L ipadd –U username
Here –L will specify listing of SMB share for the server with ipadd
Or
#smbclient //192.168.0.1/share1 –U username
Example :
#smbclient –L 192.168.0.1 –U root
Type2 : Mounting SMB share on local folder by using smbmount command
#smbmount //ipadd/sharename /mountpoint –o username=userid,workgroup=workgroupname
Example :
#smbmount //192.168.0.1/share1 /mnt –o username=steev,workgroup=test
Type3 : Mounting SMB share by using mount command
#mount –t smbfs ipadd:/sharename /mountpoint –o username=userid,workgroup=workgroupname
Or
#mount –t smbfs //ipadd/sharename /mountpoint –o username=userid,workgroup=workgroupname
Example :
#mount –t smbfs 192.168.0.1:/share1 /mnt –o username=surendra,workgroup=test
Type4 : Mounting CIFS (Common Internet File System) is nothing but a advanced SMB file system implementation which support RAP (Remote Access Protocol)
#mount –t cifs ipadd:/sharename /mountpoint –o username=userid,workgroup=workgroupname
Example :
#mount –t cifs 192.168.0.1:/share1 /test –o username=Surendra,workgroup=test
Type5 : All the above commands will ask password to display/mount the share name, however we can specify the password in command itself as below
#mount -t smbfs -o username=userid,workgroup=workgroupname,password=XXXXX //ipadd/sharepoint /mountpoint/
Example :
#mount –t smbfs –o username=Surendra,workgroup=test,password=xylBJRS8 //192.168.0.1/share1 /test
Type6 : Mounting permanently by editing /etc/fstab file, below is the fstab file entry example
#vi /etc/fstab//192.168.0.1/share1 /test smbfs rw,user,username=surendra,password=xylBJRS8 0 0
Save and exit the file and conform that you edited fstab file properly. By below commands
#mount –a
This command should not through any error,
#df –H
This command should n style="font-size: small;"> show mount from 192.168.0.1 server
Type7 : Mounting a share where user belongs to a domain permanently by editing /etc/fstab file
The above command will not work properly for domain users so we have to specify domain as well when specifying username
So now username will be changed to domainusername
#vi /etc/fstab
//192.168.0.1/share1 /mnt smbfs rw,user,username=testsurendra,password=xylBJRS8 0 0
Save the file and exit then execute mount –a and df –H for just conformation if the mount is done successfully.
Type8:As you people know /etc/fstab file is visible to all the users who logged in, so specifying user password in /etc/fstab file is not that much good procedure.. So there is a work around to resolve this issue, just create a credential file in users home directory and point that file in /etc/fstab file entry as mention below.
#cd ~
#echo username=surendra > .smbfile
#echo password=xylBJRS8 >> .smbfile
#chmod 600 .smbfile
Then edit the /etc/fstab file and specify the entries as below
#vi /etc/fstab
//192.168.0.1/share1 /mnt smbfs credentials=/home/myhomedirectoryofuser/. smbfile,rw,user 0 0
Save and exit the file and execute mount –a, df –H to check if you did any mistakes..
Iscriviti a:
Post (Atom)
Server DNS: come crearlo nella propria LAN locale
Ho dovuto realizzare un server DNS locale per risolvere tutti quei domini interni alla mia rete LAN perché mi sono rotto le palle che su un ...
-
Vesta Control Panel - Forum Community Forum https://forum.vestacp.com/ TUTORIAL: PHP selector for PHP 5.6, 7.0, 7.1, 7.2, 7.3 for...
-
add-apt-repository ppa:ondrej/php add-apt-repository ppa:ondrej/apache2 Installazione PHP 7.4 apt install php7.4 apt install php7.4-common p...
-
Necessario: MUTT e SSMTP # apt-get install mutt ssmtp Configurazione per GMAIL: Editare il file "ssmtp.conf" in /etc/ssmtp/s...