SERVER
mercoledì, gennaio 18, 2023
sabato, maggio 14, 2022
aaPanel -- How to install aaPanel web hosting control panel on CentOS 7 or Ubuntu
Install wget
sudo yum install wget
For CentOS or Redhat 7 0r 8 Linux
wget -O install.sh http://www.aapanel.com/script/install_6.0_en.sh
For Debian or Ubuntu Linux
wget -O install.sh http://www.aapanel.com/script/install-ubuntu_6.0_en.sh
Run install.sh script of aaPanel Linux web control panel
bash install.sh
mercoledì, aprile 13, 2022
VestaCP - Aggiornare PHP a 7.4 o 8.0
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 php7.4-mysql php7.4-xml php7.4-xmlrpc php7.4-curl php7.4-gd php7.4-imagick php7.4-cli php7.4-dev php7.4-imap php7.4-mbstring php7.4-opcache php7.4-soap php7.4-zip php7.4-intl
a2dismod php7.2
a2enmod php7.4
systemctl restart apache2
apt remove php7.2*
apt autoremove
apt install php7.4-bcmath php7.4-gmp
systemctl restart apache2
Installazione PHP 8.0
apt install php8.0
apt install php8.0-common php8.0-mysql php8.0-xml php8.0-curl php8.0-gd php8.0-imagick php8.0-cli php8.0-dev php8.0-imap php8.0-mbstring php8.0-opcache php8.0-soap php8.0-zip php8.0-intl
a2dismod php7.4
a2enmod php8.0
systemctl restart apache2
venerdì, aprile 08, 2022
VestaCP - Come disabilitare accesso diretto IP pubblico
Modificare il file /etc/nginx/conf.d/your-ip.conf in questo modo:
# Per accesso in http
server {
listen [il tuo ip]:80 default;
server_name _;
location / {
access_log /dev/null;
error_log /dev/null;
return 444;
}
# per abilitare l'accesso in phpmyadmin
location /phpmyadmin/ {
proxy_pass http://[il tuo ip]:8080;
}
# per abilitare l'accesso in webmail
location /webmail/ {
proxy_pass http://[il tuo ip]:8080;
}
}
# Per accesso in https
server {
listen [il tuo ip]:443 default;
server_name _;
ssl on;
ssl_certificate /home/user/conf/web/ssl.domain.ru.pem;
ssl_certificate_key /home/admin/conf/web/ssl.domain.ru.key;location / {
access_log /dev/null;
error_log /dev/null;
return 444;
}
# per abilitare l'accesso in phpmyadmin
location /phpmyadmin/ {
proxy_pass http://[il tuo ip]:8080;
}
# per abilitare l'accesso in webmail
location /webmail/ {
proxy_pass http://[il tuo ip]:8080;
}
}
Riavviare NGINX
lunedì, dicembre 13, 2021
sabato, maggio 29, 2021
Uninstalling Preinstalled Android Apps without root
Uninstalling
Preinstalled Android Apps without root
On my Moto G6 every Update seems to re-enable the Outlook
and linked-in in apps I disabled on purpose. You can not uninstall apps that
have been installed by the manufacturer via the play store or app settings,
only disable them.
So far I have been disabling them after each update but I
have gotten quite annoyed by it and did a little bit of research to find out
how to fully uninstall them.
Prerequisites
What you need is the Android Developer Bridge (ADB) on your
computer and you need to enable USB debugging on the phone.
I have used Windows in this guide but there is a great guide
on how to set everything up in Windows, Mac & Linux over at
XDA-Developers that walks you through the process.
USB Debugging on the Phone
If you haven’t enabled the Developer Mode on your phone yet,
you have to navigate to Settings, then System -> About and scroll down to
the buid number. Tap this 7 times to enable Developer mode.
Then You will find the Developer Settings in the Systems
Settings menu. Go there and enable USB debugging.
ADB on Windows
Setting up ADB on Windows is straight forward. Download
the latest
ADB version, extract the files in the zip and navigate in Powershell to the
extracted folder.
Tipp: You can hold down SHIFT when
right-clicking in Explorer and use “Open Powershell here”
From here you can run the adb commands. Since we did not add
the folder to the PATH we will have to preface the command with .\ to make it
use the adb.exe in this folder.
If you follow this guide on a different OS or have ADB in
your PATH you don’t have to use the .\
Connecting the Phone
Connect the phone via USB and double check that USB
debugging is enabled.
Then you check for connected devices
.\adb devices
This starts up the ADB service and lists connected devices
* daemon not running; starting now at tcp:5037
* daemon started successfully
List of devices attached
ZY322XXXX
unauthorized
On your phone you should get a pop-up asking you to confirm
the ADB connection to the computer. After accepting it
.\adb devices
Should list your device now not as unauthorized anymore.
List of devices attached
ZY322XXXX device
Listing the Apps
.\adb shell pm list packages
Prints out a long list of all installed apps. You can use
this list to find the full name of the apps you want to uninstall.
...
package:com.google.android.apps.inputmethod.zhuyin
package:com.microsoft.office.outlook
package:com.google.zxing.client.android
package:com.qualcomm.qti.dynamicddsservice
package:com.google.android.setupwizard
package:eu.siacs.conversations.legacy
package:com.qualcomm.qcrilmsgtunnel
...
package:com.keylesspalace.tusky
package:com.motorola.msimsettings
package:com.android.bookmarkprovider
package:com.linkedin.android
package:com.android.settings
package:com.motorola.arselfie
package:com.qualcomm.qti.lpa
package:com.qualcomm.qti.uim
package:com.google.android.inputmethod.pinyin
...
While you can uninstall most apps like linkedin and outlook
you should be more careful with system apps.
Uninstalling the App
.\adb shell pm uninstall --user 0 [Package Name]
Will uninstall the app. So in my case I just had to issue
.\adb shell pm uninstall --user 0 com.microsoft.office.outlook
and
.\adb shell pm uninstall --user 0 com.linkedin.android
Once ADB returns with Success you can unplug your device and
are done.
Remember to disable USB Debugging again in your Developer
Settings.
giovedì, novembre 07, 2019
Backup dei server Windows con rsync
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
domenica, giugno 16, 2019
VESTA CONTROL PANEL Tutorial installazione versioni diverse di PHP
Vesta Control Panel - Forum
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
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
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'
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'
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
apt-get update
a2enmod proxy_fcgi setenvif
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
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
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
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
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.shFor PHP 7.4apt-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.shStep 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:
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
# 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
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
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
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
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
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
# smbclient -L <server> -Uusername
lunedì, marzo 27, 2017
sshpass, per inserire password dentro script di comandi
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)
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
# apt-get install screen
# screen rsync -av /sorgente /destinazione
# 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
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
- 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
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 ...
-
Sul proprio server abilitare il MOD_REWRITE # a2enmod rewrite Editare il file di configurazione di Apache, nel nostro caso nella director...
-
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...
-
Necessario sia RSYNC che CURLFTPFS Installazione: # apt-get install rsync # apt-get install curlftpfs Eseguire mount su server linux d...

