- Enable FileInfo in PHP to resolve HTTP Error.
- The memory limit is the maximum amount of memory this process can use. If you exceed it, the process fails and Apache reports an HTTP 500 error.
SSH commands for deleting file, files and folder
To delete file
rm filename.txt
To delete files
rm filename1.txt filename2.php filename3.docx
To delete folder
rm foldername/
To delete all files with .html extension
rm *.html
Create SSH Keys with PuTTY on Windows
Download and install PuTTY on your computer.
After installing putty, run PuTTYgen from start menu
You may customize Parameter at the bottom. But generally default values are appropriate.
Now click on Generate and move the mouse on blank area to complete key generation.
Save private key in save place. Noted that you may or may not use Key passphrase.
Close PuTTYgen tools.
Connect to server with Private Key
Open PuTTY
Put hostname or IP in session.
Go to Connection > SSH > Auth and browse private key.
Now you will be prompted Login as
How to restrict direct root access | Linux | CentOS
We can do it just in two steps.
Step One:
At first we will create new root user as follows (for example, newroot)
- Login as root using SSH.
- Create new user e.g., newroot and add user to wheel group
useradd -G wheel newroot
- Set password for newroot
passwd newroot
- You will get option to enter password. Use letter and number only.
Save the newroot and password somewhere of you edge. - Su to newroot
su - newroot
- Test sudo permission (permission should be root)
sudo whoami
- Enter password of newroot and it will show result “root”.
- Open sshd config file and check whether it has the “newroot” in AllowUsers. If not, add the user manually. (usually at the end).
vi /etc/ssh/sshd_config
[Permission Denied!] Quit :q
AllowUsers newroot
- Restart sshd.service
sudo systemctl restart sshd.service
Step Two:
Now we are going to disable the root user. Before doing this, you have to logout from “root” and then login with “newroot”.
You can only disable the “root”, if you can successfully login with “newroot”.
- After successfully login with “newroot”, su to “root” using root password.
su - root
- Then open sshd_config.
vi /etc/ssh/sshd_config
- Search and change permitRootLogin “yes” to “no” as follows.
permitRootLogin no
- Restart sshd.service to implement the change
sudo systemctl restart sshd.service
- Now logout from “newroot” and try to login “root”
- Login with root now not allowed. Access Deny.
- So login with “newroot” and then su to root with root password
su - root
DirectAdmin SSL Certificate | LetsEncrypt
How to enable LetsEncrypt
https://help.directadmin.com/item.php?id=648
Automatically setup LetsEncrypt SSL for *all* domains that do not currently have a certificate
https://help.directadmin.com/item.php?id=675
Force https using an .htaccess file
https://help.directadmin.com/item.php?id=624