Server LAMP (Linux + Apache + MySQL + PHP) su Debian 11 - il metodo più rapido
Su una Debian 11 diventiamo root
$ sudo su
# apt install mariadb-client mariadb-server
# mysql_secure_installation
# apt install php php-mysql
# sudo apt install php libapache2-mod-php php-cli php-fpm php-json php-pdo php-mysql php-zip php-gd php-mbstring php-curl php-xml php-pear php-bcmath
# apt-get install -y wget
# export VER="4.9.0.1"
# cd /tmp
# wget https://files.phpmyadmin.net/phpMyAdmin/${VER}/phpMyAdmin-${VER}-all-languages.tar.gz tar xvf phpMyAdmin-4.9.0.1-all-languages.tar.gz
# rm phpMyAdmin*.gz
# mv phpMyAdmin-* /usr/share/phpmyadmin
# mkdir -p /var/lib/phpmyadmin/tmp
# chown -R www-data:www-data /var/lib/phpmyadmin
# mkdir /etc/phpmyadmin/
# cp /usr/share/phpmyadmin/config.sample.inc.php /usr/share/phpmyadmin/config.inc.php
# nano /usr/share/phpmyadmin/config.inc.php
Configuriamo Blowfish:
$cfg[‘blowfish_secret’] = ‘H2OxcGXxflYd8JwrwVlh7KW6s2rER63i’;
(‘H2OxcGXxflYd8JwrwVlh7KW6s2rER63i’ è un esempio, cambiate a vostro piacere)
$cfg[‘TempDir’] = ‘/var/lib/phpmyadmin/tmp’;
# nano /etc/apache2/conf-enabled/phpmyadmin.conf
# mysql --user=root mysql
oppure, in caso di accesso negato:
# mysql -u root -p
CREATE USER ‘fabrizio’@’localhost’ IDENTIFIED BY ‘PasswordATuoPiacere;
GRANT ALL PRIVILEGES ON *.* TO ‘fabrizio’@’localhost’ WITH GRANT OPTION;
FLUSH PRIVILEGES;
(user per mysql: fabrizio)
<VirtualHost *:80>
ServerName rubino.solutions
ServerAdmin me@fabriziorubino.com
DocumentRoot /var/www/html/rubino.solutions
ErrorLog /var/log/apache2/virtual.host.error.log
CustomLog /var/log/apache2/virtual.host.access.log combined
LogLevel warn
</VirtualHost>
# a2ensite rubino.solutions
# systemctl restart apache2
# chown -R www-data:www-data /var/www/
e su # /etc/apache2/sites-available/phpmyadmin.rubino.solutions
qualcosa del genere:
<VirtualHost *:80>
ServerName phpmyadmin.rubino.solutions
ServerAdmin me@fabriziorubino.com
DocumentRoot /usr/share/phpmyadmin
ErrorLog /var/log/apache2/virtual.host.error.log
CustomLog /var/log/apache2/virtual.host.access.log combined
LogLevel warn
</VirtualHost>
(“rubino.solutions” è solo un esempio)
FTP:
# apt install vsftpd ftp
# nano /etc/vsftpd.conf
e quindi:
anonymous_enable=NO
local_enable=YES
write_enable=YES
chown_uploads=YES
chown_username=www-data
pam_service_name=ftp
creiamo la pass per www-data:
# passwd www-data
riavviamo:
# /etc/init.d/vsftpd restart
Sendmail
# apt-get install sendmail