centos etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster
centos etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster

28 Eylül 2017 Perşembe

PowerDNS Amazon Linux Installation

Standalone PowerDns & Poweradmin sqlite Installation notes;

Repository Configuration for Amazon Linux;


$ sudo curl -o /etc/yum.repos.d/powerdns-auth-40.repo https://repo.powerdns.com/repo-files/centos-auth-40.repo
$ sudo curl -o /etc/yum.repos.d/powerdns-rec-40.repo https://repo.powerdns.com/repo-files/centos-rec-40.repo
$ sudo vi /etc/yum.repos.d/powerdns-auth-40.repo
#baseurl=http://repo.powerdns.com/centos/$basearch/$releasever/auth-40
Replace  above to bottom url
baseurl=https://repo.powerdns.com/centos/x86_64/6Server/auth-40/
$ sudo vi /etc/yum.repos.d/powerdns-rec-40.repo
#baseurl=http://repo.powerdns.com/centos/$basearch/$releasever/rec-40
Replace  above to bottom url
baseurl=https://repo.powerdns.com/centos/x86_64/6Server/rec-40/
$sudo yum update

PowerDns Installation for Amazon Linux;

$sudo yum install pdns pdns-recursor pdns-tools pdns-backend-sqlite
$sudo mv /etc/pdns/pdns.conf /etc/pdns/pdns.conf.orig
$sudo mv /etc/pdns-recursor/recursor.conf /etc/pdns-recursor/recursor.conf.orig
$sudo vi /etc/pdns/pdns.conf
launch=gsqlite3
gsqlite3-database=/etc/pdns/pdns.sqlite3
allow-axfr-ips=0.0.0.0/0
disable-axfr=no
allow-recursion=0.0.0.0/0
recursor=127.0.0.1:5353

local-address=0.0.0.0
local-port=53

$sudo vi /etc/pdns-recursor/recursor.conf
local-address=127.0.0.1
local-port=5353
allow-from=0.0.0.0/0

$sudo sqlite3 /etc/pdns/pdns.sqlite3 < /usr/share/doc/pdns/schema.sqlite3.sql
$sudo chmod 0777 /etc/pdns/
$sudo chmod 0666 /etc/pdns/pdns.sqlite3
$sudo service pdns start
$sudo service pdns-recursor start

PowerAdmin Installation for Amazon Linux;

$sudo yum install httpd php php-pdo php-mcrypt
$ tar xvfz poweradmin-2.1.7.tgz
$sudo mv poweradmin-2.1.7 /var/www/html/poweradmin
$sudo chown -R apache:apache /var/www/html/poweradmin/
$sudo service httpd start

Installation will complete via web browser

Add to startup configuration;


$sudo chkconfig pdns on
$sudo chkconfig pdns-recursor on
$sudo chkconfig httpd on
$sudo chkconfig --list

8 Ocak 2016 Cuma

How to install mikoomi plugin of mongodb on the zabbix server

Mongodb mikoomi plugin installation

I used template of mikoomi server side ;
I tested of mongo db 3.0.7 and it works .

https://code.google.com/p/mikoomi/wiki/03

Setup and Configuration

The MongoDB plugin uses the MongoDB PHP driver which needs to be installed on the Zabbix server. For this, install and setup the following packages:
  • php5-dev (or php5-devel) = Files for PHP5 module development
  • php5-pear = PEAR - PHP Extension and Application Repository
  • gcc = GNU C Compiler
  • make = make utility
To install the above on a Zabbix appliance, login into the appliance as root (default password = zabbix) and run the following commands:
  • yast -i php5-devel
  • yast -i gcc
  • yast -i php5-pear
  • yast -i make
Now install the php MongoDB driver using the instructions at http://us2.php.net/manual/en/mongo.installation.php
In the case of the Zabbix appliance, run the the following pecl command:
  • pecl install mongo
After successful installation of the MongoDB driver, you need to "enable" it within php5. Edit the two files /etc/php5/cli/php.ini and /etc/php5/apache2/php.ini and add a line to the "Dynamic Extensions" sections as shown below.
;;;;;;;;;;;;;;;;;;;;;;
; Dynamic Extensions ;
;;;;;;;;;;;;;;;;;;;;;;

extension=mongo.so
Ensure that the php MongoDB driver is setup and configured properly by testing out one of the sample php programs for MongoDB driver (http://us2.php.net/manual/en/mongo.tutorial.php).
Dowload template and script files;
http://mikoomi.googlecode.com/svn/plugins/MongoDB%20Plugin/
[root@zabbix ~]# grep ExternalScripts /etc/zabbix/zabbix_server.conf
You have to Change to mikoomi of shell script file of about the externalscirpt .
And all of scripts are download at the externalscirpt directory.
And delete the word of "shift" . If you don't delete, your script doesn't work.
Next open up a browser and download the MongoDB Zabbix template. Now login to the Zabbix frontend (user = admin, password = zabbix).
Navigate as follows:
  • Configuration >> Templates
  • Click on the "Import Template" button on the top right-hand corner
  • In the "Import file" dialog box, browse/search/enter the filename of the Zabbix template that was downloaded
  • Upload the template
Now you are ready to start monitoring your MongoDB servers !
If you have any question please leave comments.

21 Nisan 2015 Salı

Haproxy Transparent Mode on Centos 7

Haproxy Transparent Mode on Centos 7

 HAProxy can’t do transparent binding or proxying alone. It must stand on a compiled and tuned Linux Kernel and operating system.
But Centos 7 supported haproxy transparent mode.
Step by step configuration; 
1. sysctl settings
2. iptables rules
3. ip route rules
4. HAProxy configuration

Step 1 is Sysctl serttings;
 – net.ipv4.ip_forward
  – net.ipv4.ip_nonlocal_bind
# echo 1 > /proc/sys/net/ipv4/ip_forward
# echo 1 > /proc/sys/net/ipv4/ip_nonlocal_bind

Step 2 is iptables rules;
#iptables -F -t mangle
#iptables -F
#iptables -F -t nat
#iptables -t mangle -N DIVERT
#iptables -t mangle -A PREROUTING -p tcp -m socket -j DIVERT
#iptables -t mangle -A DIVERT -j MARK --set-mark 1

#iptables -t mangle -A DIVERT -j ACCEPT

Step 3 is ip route rules;
tell the Operating System to forward packets marked by iptables to the loopback where HAProxy can catch them:
#ip rule add fwmark 1 lookup 100

#ip route add local 0.0.0.0/0 dev lo table 100

Step 4 is haproxy configuration;
Finally, you can configure HAProxy.
  * Transparent binding can be configured like this:
frontend App_in
        bind ipofhaproxy:10421 transparent

        mode tcp

backend App_out
        mode tcp
        log global
        source 0.0.0.0 usesrc clientip
        balance roundrobin
        server backend1 ipofbackend01:10421 check
        server backend2 ipofbackend02:10421 check

Note: When you reboot the server ,ip rules will be delete.
Bash script will help you ;)
#!/bin/bash
iptables -F
iptables -F -t nat
iptables -t mangle -N DIVERT
iptables -t mangle -A PREROUTING -p tcp -m socket -j DIVERT
iptables -t mangle -A DIVERT -j MARK --set-mark 1
iptables -t mangle -A DIVERT -j ACCEPT
ip rule add fwmark 1 lookup 100
ip route add local 0.0.0.0/0 dev lo table 100