To add basic authentication to you own http server is really simple, you only need to add inside the “onCommandGet” method the authentication check, as in the example shown after the image Inside the method you can:
1 2 3 4 5 6 7 8 9 10 11 |
if ( ARequestInfo.AuthUsername.ToUpper.Equals('USERNAME'.ToUpper) and ARequestInfo.AuthPassword.Equals('PASSWORD') ) then begin AResponseInfo. ResponseNo : = 401; AResponseInfo. AuthRealm : = 'Autentication required'; exit; end; |
related articles: Build your own HTTPS server with Delphi – Open SSL Example
Tested on: Ubuntu 22.04 Default php version is 8.1 and we want install php 7.4 Ondrej PPA contains PHP 8.2, 8.1, 8.0, 7.4, 7.3, 7.2, 7.1, 7.0 & PHP 5.6 packages. First update the system
1 |
sudo apt update && sudo apt upgrade |
1. Check Active PHP Version
1 |
php -v |
2. Install php on system Set the required PPA wich contains any…
Leggi tutto
To transfer a KVM virtual machine (VM) from one host to another, you can follow the steps below: Make sure you have the same version of KVM on both hosts. You can verify this by running the kvm –version command. Stop the VM you want to transfer. You can do this using the command virsh…
Leggi tutto
Gli helper sono un modo per estendere una classe senza utilizzare l’ereditarietà, utile anche per i record che non consentono affatto l’ereditarietà. La documentazione ufficiale è disponibile all’indirizzo: https://docwiki.embarcadero.com/RADStudio/Sydney/en/Class_and_Record_Helpers_(Delphi). Spesso mi son trovato a creare del codice per esportare un dataset o un singolo record con i suoi valori in uno statement SQL, e tutte…
Leggi tutto
To update Apache2 to the lasted version on Ubuntu is quite simpe: Verify current Apache version:
1 |
sudo apache2 -v |
Add Apache repository:
1 |
sudo add-apt-repository ppa:ondrej/apache2 |
Update apt:
1 |
sudo apt update |
Upgrade apt:
1 |
sudo apt upgrade |
And now ( in my case, with Ubuntu 22.04 current date) my new Apache2 release is:
Install samba server:
1 |
sudo apt install samba |
backup config filee:
1 |
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup |
create a shared folder for your user, like:
1 |
mkdir /home/<username>/mmyshare |
edit samba config file:
1 |
nano /etc/samba/smb.conf |
replace all smb.conf with this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
[global] workgroup = WORKGROUP server string = %h server (Samba, Ubuntu) log file = /var/log/samba/log.%m max log size = 1000 logging = file panic action = /usr/share/samba/panic-action %d server role = standalone server obey pam restrictions = yes unix password sync = yes passwd program = /usr/bin/passwd %u passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdate$ pam password change = yes map to guest = bad user usershare allow guests = yes [printers] comment = All Printers browseable = no path = /var/spool/samba printable = yes guest ok = no read only = yes create mask = 0700 [print$] comment = Printer Drivers path = /var/lib/samba/printers browseable = yes read only = yes guest ok = no [mysharename] comment = public anonymous access path = /home/<username>/mmyshare browsable =yes create mask = 0660 directory mask = 0771 writable = yes guest ok = no |
restart samba:
1 |
sudo systemctl restart smbd |
associarte a samba password to your systemm user:
1 |
sudo smbpasswd -a <username> |
restart samba:
1 |
sudo systemctl restart smbd |