Archive | Linux/Unix RSS feed for this section

Setup Mysql Replication

Setup Primary Server Append following following in Primary Server my.cnf [mysqld] log-bin=/var/log/mysql/binlog.log server-id=1 Create log directory mkdir /var/log/mysql/ chown mysql:mysql /var/log/mysql /etc/init.d/mysql restart Backup desired database mysql -u root -p or if plesk installed mysql -u admin -p`cat /etc/psa/.psa.shadow` Create GRANT REPLICATION SLAVE ON *.* TO ‘replicate_user’@’%’ IDENTIFIED BY ‘dbpass’; FLUSH PRIVILEGES; FLUSH TABLES WITH […]

Read more

drupal update with drush

cd /var/www/drupaldirectroy # Backup everything (codebase + database) drush arb # get a list of all modules: drush up -s # filter it to just those needing an update: drush up -s | grep -i update # filter again for just security updates: drush up -s | grep “SECURITY UPDATE” # get a count of […]

Read more

Rate Limit SSH Brute Force on port 22

iptables -A INPUT -p tcp –dport 22 -i eth0 -m state –state NEW -m recent –set iptables -A INPUT -p tcp –dport 22 -i eth0 -m state –state NEW -m recent  –update –seconds 60 –hitcount 3 -j DROP

Read more

RDS Encrypted individual mysql connection for PCI compliance

download certs from aws cd /etc/ssl/mysql wget https://rds.amazonaws.com/doc/mysql-ssl-ca-cert.pem create user in RDS GRANT ALL PRIVILEGES ON abcdb.* TO ‘anuj’@’%’ IDENTIFIED BY ‘efghij’ REQUIRE SSL; flush privileges; Verify the connection mysql -h host.rds.amazonaws.com -u anuj -pefghij -P 3306 –ssl_ca=/etc/ssl/mysql/mysql-ssl-ca-cert.pem

Read more

Minimal postfix/dovecot installation

yum install postfix chkconfig postfix on chkconfig sendmail off /etc/init.d/sendmail stop /etc/init.d/postfix start Put these 5 lines in /etc/postfix/main.cf inet_interfaces = 127.0.0.1, 88.155.666.111    :Listen on loopback and public interface myorigin = mail.anuj.com         :visible hostname in email mydestination = mail.anuj.com        :accept email for any@mail.anuj.com relay_domains = anuj.com        :To relay domain as required […]

Read more
Random Pages By Best Accounting Services