Socialabel

Sunday, June 5, 2016

Gluster FS Install on Centos

gluster volume create DFS-DATA replica 2 transport tcp dfs-master:/DATA dfs-node:/DATA

gluster volume start distribute                                                                                                                                 
gluster volume info                                                                                                                                             
gluster volume delete dist-volume 


umount -t glusterfs dfs-master:/DFS-DATA
mount -t glusterfs dfs-master:/DFS-DATA/ok /mnt/test/


gluster volume create test replica 2 transport tcp dfs-master:/DATA/DFS-103.241.5.100-1 dfs-node:/DATA/DFS-103.241.5.100-1

mount -t glusterfs dfs-master:/DFS-103.241.5.100 /gluster



###INI JIKA VOLUME ALREADY
setfattr -x trusted.glusterfs.volume-id $brick-path
setfattr -x trusted.gfid $brick-path
rm -rf $brick-path/.glusterfs

Wednesday, April 27, 2016

Raspberry Pi, Error Compile Asterisk


Makefile:50: recipe for target 'gsm/lib/libgsm.a' failed
make[1]: *** [gsm/lib/libgsm.a] Error 2


Buka file makeopts setelah melakukan ./configure pada source code asterisk

Replace armv6l dengan armv6 (ada 3 bagian)

Tuesday, April 5, 2016

CWP Firewall Error




Firewall pada CWPterdisable dan menggalami kegagalan untuk running pada saat Firewal di triger untuk bekerja





FIle log dari csf dan lfd mengalamai

#csf -u
Can't locate object method "ssl_opts" via package "LWP::UserAgent" at /usr/local/csf/lib/ConfigServer/URLGet.pm line 142.


Solusi
# sed -i "s/\$ua->ssl_opts/#\$ua->ssl_opts/" /usr/local/csf/lib/ConfigServer/URLGet.pm
# csf -u
 

Monday, April 4, 2016

Access to Centos Web Panel not working with SSL / https

vi /usr/local/cwpsrv/conf.d/cwp-ssl.conf

Listen 2031
<VirtualHost 123.456.789.012:2031>
        ServerName 123.456.789.012
        SSLEngine on
        SSLCertificateKeyFile /etc/pki/tls/cwp-123.456.789.012.key
        SSLCertificateFile /etc/pki/tls/cwp-123.456.789.012.cert
        SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
</VirtualHost>

change to:

Listen 2031
<VirtualHost *:2031>
        ServerName *
        SSLEngine on
        SSLCertificateKeyFile /etc/pki/tls/cwp-123.456.789.012.key
        SSLCertificateFile /etc/pki/tls/cwp-123.456.789.012.cert
        SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
</VirtualHost>

service cwpsrv restart

Now it works fine with https.

Sunday, April 3, 2016

REVERSE PROXY APACHE HTTP DAN HTTPS

========================================
MODE 1
======================================== 
 
<VirtualHost *:*>
    ProxyPreserveHost On

    # Servers to proxy the connection, or;
    # List of application servers:
    # Usage:
    # ProxyPass / http://[IP Addr.]:[port]/
    # ProxyPassReverse / http://[IP Addr.]:[port]/
    # Example: 
    ProxyPass / http://0.0.0.0:8080/
    ProxyPassReverse / http://0.0.0.0:8080/

    ServerName localhost
</VirtualHost> 
 
 
 
 
=====================================
MODE 2 
=====================================
<Proxy balancer://mycluster>
    # Define back-end servers:

    # Server 1
    BalancerMember http://0.0.0.0:8080/

    # Server 2
    BalancerMember http://0.0.0.0:8081/
</Proxy>

<VirtualHost *:*>
    # Apply VH settings as desired
    # However, configure ProxyPass argument to
    # use "mycluster" to balance the load

    ProxyPass / balancer://mycluster
</VirtualHost>
 
 
 
=========================================
MODE 3 - SSL ON
========================================
Listen 443

NameVirtualHost *:443
<VirtualHost *:443>

    SSLEngine On

    # Set the path to SSL certificate
    # Usage: SSLCertificateFile /path/to/cert.pem
    SSLCertificateFile /etc/apache2/ssl/file.pem


    # Servers to proxy the connection, or;
    # List of application servers:
    # Usage:
    # ProxyPass / http://[IP Addr.]:[port]/
    # ProxyPassReverse / http://[IP Addr.]:[port]/
    # Example: 
    ProxyPass / http://0.0.0.0:8080/
    ProxyPassReverse / http://0.0.0.0:8080/

    # Or, balance the load:
    # ProxyPass / balancer://balancer_cluster_name

</VirtualHost>
 

PAT Pada Mikrotik

ip firewall nat add chain=dstnat src-address=0.0.0.0/0 dst-address=103.241.5.99 protocol=udp port=22221 action=dst-nat to-addresses=172.16.222.2 to-ports=22

Saturday, April 2, 2016

Port Address Translation (PAT) Pada Centos

iptables -t nat -A PREROUTING -p tcp --dport 2222 -j DNAT --to-destination 172.16.121.2:22

Friday, April 1, 2016

Mengganti Nama Interface Centos

/sbin/ip link set eth0 down
/sbin/ip link set eth0 name publik
/sbin/ip link set publik up
 
 
Edit the file /etc/udev/rules.d/70-persistent-net.rules to change the interface name of a network device. 

# PCI device 0x11ab:0x4363 (sky2)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*",
ATTR{address}=="00:00:00:00:00:00",ATTR{dev_id}=="0x0", ATTR{type}=="1",
KERNEL=="eth*", NAME="eth0"

Thursday, February 25, 2016

Disable Rule Mod Security

Disable rule pada mod security apache 
 
#<IfModule security2_module>
#        SecRuleEngine Off
#</IfModule> 
 
<IfModule mod_security2.c>
 SecRuleRemoveById ######
</IfModule>
 
 
service httpd graceful
 

Tuesday, February 2, 2016

Backup SQL Server Remote

sqlbackup <Host> <User> <Password> <DB> <TUJUAN> <KOMENTAR>

################# BASH BACKUP SQL ########################
serverdb=$1
userdb=$2
passwd=$3
namadb=$4
tujuan=$5
komen=$6

DATE=`date +%Y-%m-%d_%H_%M_%S`

#echo "$serverdb,$userdb,$passwd,$namadb"

mysqldump --opt --lock-tables=false --host $serverdb -P 3306 -u $userdb -p"$passwd" $namadb > $tujuan/$namadb.sql+$serverdb+$userdb+$DATE+$komen
################# BASH BACKUP SQL ########################