This is a list of useful Linux commands for Server Administrators. Please use following commands on a CentOS server. You can connect via SSH to your Linux server using ExtraPutty or ServerAuditor. How to access your server via SSH? Follow this link: https://www.valoroso.it/linux-server-lamp-and-mail-for-hosting-purposes/.
Useful Linux commands: update
You should check periodically for updates. Run:
A list of all available updates will appear. Press ‘y’ to let yum update your server, otherwise press ‘n’.
Even if I never had problems during this procedure, do not forget to perform a server backup before and after the update. Check if apache, exim, mysql and all other server programs are still working!
To exclude a specific package from update:
yum –exclude=package* update
Useful Linux commands: add or remove software
yum install name (where name is the name of software you want to install)
Of course you need to have the repositories installed in /etc/yum.repos.d/, otherwise yum may not be able to install the software.
yum remove name (where name is the name of software you want to remove)
Useful Linux commands: exim (mail transfer agent)
This is a list of useful commands to understand what exim (the mail transfer agent) is doing on your server.
exim -bp (list the messages queue)
exim -bp | exiqsumm (count the queued messages)
exim -bpc (number of queued messages)
exiwhat (what is exim doing now?)
exim -bP (list all the configuration parameters)
exim -bP queue_run_max (see a specific configuration parameter, i.e. queue_run_max)
Useful Linux commands: files
df -h (available space on drives)
du -kscxh * (to run in the / folder, show subfolders dimensions)
find / -name *file* (find a specific file in the hdd)
cd folder (change current folder)
wget http://address/file.ext (download the specified file from the Internet)
This is a useful command, especially when you restore a website from a compressed archive via SSH and you have root privileges. Without running chown, just root user can modify files, so WordPress will not work properly. You need to change user from root to the proper user:
chown -R user /home/user/web (replace user with the proper username, /home/user/web is the folder where VestaCP stores websites)