cleaning up Cpanel RedHat servers – free some spaces.

We can clean up lots more spaces from cpanel or any linux web hosting servers. Few step we can always follows:

1. Clean the tmp folder. 

tmp folder / mount can be cleared manually by going
 to that folder and running command: 
$ cd /tmp
$ tmp> rm -rf *

Its better to use tmpwatch to clear tmp folders:

tmpwatch --mtime --all 1 /tmp
this command will remove all files more than a day old.

2. clean the access logs of the servers.

access_log for web host will built up over the time so its better to clean them time to time.

access files are located in /usr/local/apache/logs



best way to do this in cpanel server is to limiting the log file size from :

cPanel: Main >> Logs >> Raw Access Logs >> Configure Logs

make sure

Archive Logs in your home directory at the end of each stats run
Remove the previous month’s archived logs from your home directory at the end of each month” are checked.

others files like error_log, messages, stats logs can also be managed from:

a)WHM > Tweak Settings > Log Rotation Size Threshold 

b)WHM >Service Configuration>cPanel Log Rotation Configuration

c)cPanel > Logs > Raw Access Logs > Configure Logs

3) Backup files:

All the backup files will be placed in the cpanel backup directory which is normally /home/backup but depends on the server settings.

you should download your backup files and remove the backup from the folder by using rm backup_file_name.tar.gz

Cpanel linux server logs locations.

Most common logs files location in linux with cpanel:

1. Apache domain access log location

/usr/local/apache/domlogs/<domain name>

2. apache conf file location


3. apache error_log location

4. apache global access_log location

5.> Mysql my.ini config file location

6.> mysql  log files

7. mysql database default location.
/var/lib/mysql/<db name>

8. General log files

9. Exim log file

10. apache hosts files.

11. nginx conf file.

12. nginx host files
/etc/nginx/vhosts/<domain name>

13. General log messages.

14. php.ini file location

If you are looking for any files let me know in the comment box so that i will also include those.