MySQL Backup Script

#!/bin/bash export PATH=/bin:/usr/bin:/usr/local/bin TIMESTAMP=`date +”%Y%d%m-%H%M”` DB_BACKUP_PATH=’/backup/dbbackup’ MYSQL_HOST=’localhost’ MYSQL_PORT=’3306′ MYSQL_USER=’root’ MYSQL_PASSWORD=’mysecret’ DATABASE_NAME=’mydb’ echo “Backup started for database – ${DATABASE_NAME}” mysqldump -h ${MYSQL_HOST} \ -P ${MYSQL_PORT} \ -u ${MYSQL_USER} \ -p${MYSQL_PASSWORD} \ ${DATABASE_NAME} | gzip –best > ${DB_BACKUP_PATH}/${DATABASE_NAME}-${TIMESTAMP}.sql.gz if [ $? -eq 0 ]; then echo “Database backup successfully completed” else echo “Error found during backup” exit … Read more

Configuring HTTPS on CentOS

1. Getting the required software   For an SSL encrypted web server you will need a few things. Depending on your install you may or may not have OpenSSL and mod_ssl, Apache’s interface to OpenSSL. Use yum to get them if you need them. yum install mod_ssl openssl   2. Generate a self-signed certificate   Using … Read more

PHP SOAP example

In order to deploy a webservice API you need at least a server and a client. PHP Soap makes the day! First install php-soap. Let’s suppose to be on a CentOS distro, you should issue a: yum install php-soap remember to reload Apache as well, with a service httpd restart Now you are ready to … Read more