Postfix is fast and popular SMTP server widely used. The main job of postfix is to relay mail locally or to the intended destination outside the network. Some of the most popular SMTP servers are Sendmail, Postfix, and Qmail. By default, Sendmail comes pre-installed with CentOS/RHEL 5. We will need to remove it and install Postfix. You may also like: Install Postfix on Ubuntu Step 1 – Install Postfix If Postfix not already installed on your machine, Install it using the following command. Also, remove sendmail if already installed. yum remove sendmail yum install postfix Make postfix as default MTA…
Author: Rahul
Securing specific URLs in Apache is essential to protect important parts of your website. This guide will help you do it step by step, even if you’re new to Apache. You’ll learn how to limit access to certain URLs to specific IP address or by setting up a login requirement. This means only people with the right username and password or accessing from specified IP address can see those parts of your site. By following these simple instructions, you can keep your website more secure and ensure that sensitive information is protected from unauthorized access. In this tutorial you will…
Sometimes SQL Server logs files acquire a large space on the disk. In that case, we need to reduce the size of the log file to claim some space. But truncating or reducing database log file in SQL Server 2008 can be quite difficult. It also has its own issues. This article contains a set of commands to Shrink Log Files of SQL Server database. Generally this command is I prefer to take a backup of the database before executing below command for a safer side Shrink SQL Server Transaction Log Files First of all, check the actual name of…
Linux provides a number of tools for network configuration. Most important network settings for you Linux machine to access over network are IP configuration Device activation DNS configuration Default gateway 1. Default Network Configuration Files: Default linux interfaces configuration file exists in /etc/sysconfig/network-scripts/ named ifcfg-ethX ( ‘X’ is replace with number 0,1 or 2 etc ). /etc/sysconfig/network : is global configuration file NETWORKING = yes HOSTNAME = server1.tecadmin.net GATEWAY = 192.168.10.1 /etc/sysconfig/network-script/ifcfg-ethX : is Ethernet configuration file so assign ip address, netmask on interface. /etc/resolv.conf : DNS servers ip addresses are specified in this file. /etc/hosts : Is used for…
Packaging software into RPM (Red Hat Package Manager) format is an essential skill for developers and system administrators working with Red Hat-based Linux distributions such as CentOS and RedHat. RPMs allow for easy installation, upgrade, and removal of software, ensuring that applications can be distributed and managed efficiently. This guide will walk you through the process of packaging your script into an RPM, step by step. Prerequisites Before we begin, ensure you have the following: A CentOS or RedHat system for packaging and testing. Your script that you wish to package. rpm-build and rpmdevtools packages installed. You can install them…
Using HAProxy, you can construct high-availability systems and HAProxy stats provide detailed statics. It can be used with popular servers like Apache, Tomcat, NGINX, and others. This post describes how to enable HAProxy statistics on your machine. After you have configured and installed HAProxy on your system, you may monitor its statistics to determine its current performance. With HAProxy Stats, you can view information about the number of connections, data transfer, server status, and more. Because it is browser-based, you can use a web browser to get real-time information about your HAProxy implementation. In this article, we delineate how to…
Sometimes we need to insert a line at middle of the existing file. You can add line at specific line number using Linux command line or shell scripts. In this tutorial, we will discuss about adding a text line at middle of file as specific line number. Let’s have an example, I have a text file named file1.txt with following content: cat file1.txt this is line one this is line two this is line three Now I have to insert text “HelloWorld” at the line number 3. To do this run the following command. sed -i ‘3iHelloWorld’ file1.txt Details of…
Being a system administrator you have all responsibilities to maintain your systems. A system admin is a person having good knowledge about operating systems, networking and applications. Also he must have some primary knowledge about system hardware and software. The responsibilities also varies based on location, organization and infrastructure. Primary Responsibilities of A System Administrator Being a Linux/Windows/Cloud Administrator your primary responsibilities are: User account management. Creating new users and groups. Configure security policies. Changing user passwords at regular intervals. Analyze user security pocily on regular time interval. Data backup and recovery. A good system admin always has a data…
Introduction In the dynamic world of information technology, keeping your systems up-to-date is crucial for security, performance, and stability. This is especially true for users of CentOS and Red Hat Enterprise Linux (RHEL), two of the most popular Linux distributions in the corporate world. This comprehensive guide will delve into the best practices, tools, and strategies to ensure your CentOS and RHEL systems are always current. Understanding the Importance of Regular Updates Updates in CentOS and RHEL include security patches, bug fixes, and occasionally, new features. Regular updates help protect your systems from vulnerabilities, improve functionality, and ensure compatibility with…
As a system administrator, you need to take backup on daily basis. Backups are very useful to recover data from any crashes or corruption. I have written a simple script to take database backup from MySQL server and upload it to FTP server. Being a system administrator, I recommend keeping a remote copy of your every backup. You can also try our new advance script for MySQL databases backup and upload to remote locations. Create a shell script file and copy the below script. Then update all the required values and execute.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | #!/bin/bash ###################################################### # Script Written by: Rahul Kumar # Date: Feb 21, 2013 ###################################################### DATE=`date +%d%b%y` LOCAL_BACKUP_DIR="/backup/" DB_NAME="test" DB_USER="root" DB_PASSWORD="your password" FTP_SERVER="ftp.tecadmin.net" FTP_USERNAME="ftp user name" FTP_PASSWORD="ftp user password" FTP_UPLOAD_DIR="/backup/" LOG_FILE=/backup/backup-DATE.log ############### Local Backup ######################## mysqldump -u $DB_USER -p$DB_PASSWORD $DB_NAME | gzip > $LOCAL_BACKUP_DIR/$DB_NAME-$DATE.sql.gz ############### UPLOAD to FTP Server ################ ftp -n $FTP_SERVER << EndFTP user "$FTP_USERNAME" "$FTP_PASSWORD" binary hash cd $FTP_UPLOAD_DIR #pwd lcd $LOCAL_BACKUP_DIR put "$DB_NAME-$DATE.sql.gz" bye EndFTP if test $? = 0 then echo "Database Successfully Uploaded to Ftp Server File Name $DB_NAME-$DATE.sql.gz " > $LOG_FILE else echo "Error in database Upload to Ftp Server" > $LOG_FILE fi |
Setup Details – Edit the above script…