rsyslog + MySQL + LogAnalyzer on OpenSUSE

rsyslog Features Map

1. Install requirements

2. Create RuleBase for PHP log

3. Prepare MySQL

4. rsyslog Configuration for Log-Servers

5. rsyslog Configuration for Log-Client

6. Install LogAnalyzer

7. LogAnalyzer Configuration http://localhost/loganalyzer   ♦ References http://www.the-art-of-web.com/system/rsyslog-config/ http://www.liblognorm.com/files/manual/configuration.html  

Upload PKCS#12 Server Certificates to AWS

AWS IAM Certificate Manager

1. Extract RSA Private key

2. Extract Certificate

3. Extract Certificate Chains

4. Trimming  Certificates for AWS

5. Upload Key & Certificates to AWS via CLI

Using request of JSON Payload in Slim framework

Slim Framework

How to enable JSON-Payload input in Slim Framework… SlimMiddlewareContentTypes.php

index.asp

 

MySQL Procedure Pattern for Nested Transaction

MySQL

The MySQL dose not supports ‘Nested Transaction’. Transactions cannot be nested. This is a consequence of the implicit commit performed for any current transaction when you issue a START TRANSACTION statement or one of its synonyms. (https://dev.mysql.com/doc/refman/5.7/en/implicit-commit.html) But I want to use ‘Stored Procedure’ what work well with a transaction independently and with nested calling. This pattern isn’t correct nested transactions, but enables the use of nested procedures. The basic idea is to use the @@ AUTOCOMMIT environment variable. The procedure will determine whether the transaction is started from the ‥‥‥

Install OpenVPN on openSUSE

OpenVPN

0. Plan Public IF : eth1 (210.1.1.1) Private IF : eth0 (10.1.0.0/16) Virtual Tunneling IF : tun0 (172.16.1.0/24) 1. Download and install packages

2. Install EasyRSA and create server ertificates

3. Configuration for PAM-plugin

4. Configuration for rsyslog

5. Configure SuSEfirewall

6. Configure IP setting shell script

7. Status file script and add to cron job

8. Configure OpenVPN and Start service Run yast Add network device “tun0” type TUN Assign tun0 to External Network at Firewall 9. Configure OpenVPN and Start service

  ∗ Create new client certificate ‥‥‥

Enable SFTP Logging on OpenSUSE

1. Update rsyslog(syslog) configuration

2. SSHD Configuration file

 

Chroot for SFTP on OpenSUSE

1. Add chroot to SSHD Configuration file

2. Mount directory to home directory

 

MySQL, Checking the IP address in a range

fn_ipv4_match( needle, haystack ) Returns 1 if haystack contains needle. needle : IPv4 address haystack : IPv4 address, IPv4 address with subnet mask, IPv4 address with netmask bits

Results

 

Install DKIMproxy on OpenSUSE

1. Install requirements

2. Create keys

3. Configuration file

4. Setting up postfix

5. Restart services

6. Add DNS record (sender’s domain)

  ♦ References http://dkimproxy.sourceforge.net/usage.html

Install nginx + php-fpm on openSUSE

1. Download and install packages

2. Configure php-fpm

3. Configure php-fpm

4. Configure nginx for reverse proxy

5. Restart service

♦ ulimit for open files

  ♦ References http://www.howtoforge.com/perfect-server-opensuse-12.2-x86_64-nginx-dovecot-ispconfig-3-p4 https://www.linux.co.kr/home2/board/subbs/board.php?bo_table=lecture&wr_id=1685 http://stackoverflow.com/questions/7325211/tuning-nginx-worker-process-to-obtain-100k-hits-per-min http://www.codestance.com/tutorials-archive/nginx-tuning-for-best-performance-255 https://www.digitalocean.com/community/tutorials/how-to-optimize-nginx-configuration