Categories
Web Server

Integrating PHP in Apache

To enable PHP in Apache add the following to httpd.conf and restart Apache:

LoadModule php7_module /usr/local/opt/php/lib/httpd/modules/libphp7.so
    <FilesMatch \.php$>
        SetHandler application/x-httpd-php
    </FilesMatch>

Finally, check DirectoryIndex includes index.php

DirectoryIndex index.php index.html

The php.ini and php-fpm.ini file can be found in:

/usr/local/etc/php/7.4/
Categories
Command Line

Plesk basic commands

Create customer

/usr/local/psa/bin/customer --create USERNAME -passwd PASSWORD -name USERNAME

Create user

plesk bin user --create EMAIL -owner USERNAME -passwd PASSWORD -cname USERNAME -role ROLE

The role could be owner or webmaster or …

Create subscription

plesk bin subscription --create example.com -owner USERNAME -service-plan "Default Domain" -ip xx.xx.xx.xx -login USERNAME -passwd "PASSWORD"
Categories
Web Server

Add correct host key in known_hosts

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
[...].
Please contact your system administrator.
Add correct host key in /home/root/.ssh/known_hosts to get rid of this message.
Offending RSA key in /home/root/.ssh/known_hosts:86
RSA host key for [...] has changed and you have requested strict checking.
Host key verification failed.

Fix

ssh-keyscan -t rsa [IP ADDRESS]
ssh-keyscan -t rsa 192.168.44.44

Example response,

# 192.168.44.44 SSH-2.0-OpenSSH_4.3
192.168.44.44 ssh-rsa AAAAB3NzaC1yc2EAAAGDSGAAAQEAwH5EXZG...

Add the entire line in known_hosts

# nano ~/.ssh/known_hosts
192.168.44.44 ssh-rsa AAAAB3NzaC1yc2EAAAGDSGAAAQEAwH5EXZG...
Categories
Linux

Find files Linux commands

Search zip files

find . -type f -name '*.zip' -exec du -ch {} + | sort -h -r | head -n 20

Search folders with large size

du -a * | sort -n -r | head -n 20
Categories
Linux

Trace Route for an IP

Traceroute command

traceroute 8.8.8.8

IP Route command

ip route get 8.8.8.8

Other commands

ip route list