Posts

Showing posts with the label Centos

How to implement Log File Rotation in Linux Servers

NB: We are using CentOS Servers Switch to root user cd /etc/logrotate.d/  (by default we will be having this directory in our server) create a new file project-logs   vi project-logs Add the following piece of code to this file             /folder-path-of-your-log/*.log {                size=10M                missingok                rotate 20                compress                delaycompress                notifempty                copytruncate               daily           }       5.   logrotate -f /etc/logrotate.d/        This will create new log ...

Server Fine Tuning Scripts

Provides a instant view of running resource usage https://community.rackspace. com/products/f/25/t/647 Apache Tuning scripts https://github.com/ gusmaskowitz/apachetuner (bash script) https://github.com/ gusmaskowitz/apachebuddy.pl (perl script that supercedes apachetuner) MySQL Tuning script https://github.com/major/ MySQLTuner-perl Resource usage logging https://github.com/rackerlabs/ recap

How to add Startup Script for MySQL or any other services in Centos/RedHat

Note: Perform the below steps as root user 1) Find out the name of service’s script from /etc/init.d/ directory e.g. mysqld or httpd 2) Add it to chkconfig chkconfig --add mysqld 3) Make sure it is in the chkconfig chkconfig --list mysqld 4) Set it to autostart chkconfig mysqld on Note: To stop a service from auto starting on boot chkconfig mysqld off If you have IPTables you need to flush them  and save that, So that on every reboot we get a flushed iptable. 1) iptables -F 2)  service iptables save

ImageMagick Installation in Centos

Run the commands as root user  yum install ImageMagick ImageMagick-perl yum install ImageMagick-devel gem install rmagick Now restart your server and you are ready to shoot..!!