Tuesday, July 23, 2013

homeloader.so problem (cpanel) [solved]

ref: http://stackoverflow.com/questions/9688452/php-module-does-not-compile-does-not-recognize-static-function-entry

i have a problem with homeloader.so after upgrading to php 5.4 using easyapache.

 [23-Jul-2013 12:17:55 Asia/Kuala_Lumpur] PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20100525/homeloader.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20100525/homeloader.so: cannot open shared object file: No such file or directory in Unknown on line 0  

 root@cp [~]# locate homeloader  
 /usr/local/cpanel/src/userphp/homeloader.c  
 /usr/local/cpanel/src/userphp/homeloader.loT  
 /usr/local/cpanel/src/userphp/php_homeloader.h  
 /usr/local/lib/php/extensions/no-debug-non-zts-20090626/homeloader.so <-- 20100525="" code="" nbsp="" no="">
current working directory is  
 /usr/local/lib/php/extensions/no-debug-non-zts-20100525/  

 trying to compile homeloader.c manually but have error. 
 
 root@cp [/usr/local/cpanel/src/userphp]# ./install  
 Configuring for:  
 PHP Api Version: 20100412  
 Zend Module Api No: 20100525  
 Zend Extension Api No: 220100525  
 checking for egrep... grep -E  
 checking for a sed that does not truncate output... /bin/sed  
 .....................blablabla  
 and finally  
 cc -I. -I/usr/local/cpanel/src/userphp -DPHP_ATOM_INC -I/usr/local/cpanel/src/userphp/include -I/usr/local/cpanel/src/userphp/main -I/usr/local/cpanel/src/userphp -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /usr/local/cpanel/src/userphp/homeloader.c -fPIC -DPIC -o .libs/homeloader.o  
 /usr/local/cpanel/src/userphp/homeloader.c:46: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before âhomeloader_functionsâ  
 /usr/local/cpanel/src/userphp/homeloader.c:149: error: âhomeloader_functionsâ undeclared here (not in a function)  
 gmake: *** [homeloader.lo] Error 1  

the solution:

 vi /usr/local/cpanel/src/userphp/homeloader.c  

go to line 46
type :46 on vi
replace function_entry with static zend_function_entry

exit vi. type :wq


./install

and success: :)
 Build complete.  
 Don't forget to run 'make test'.  
 Installing shared extensions:   /usr/local/lib/php/extensions/no-debug-non-zts-20100525/  


 root@cp [/usr/local/cpanel/src/userphp]# updatedb  
 root@cp [/usr/local/cpanel/src/userphp]# locate homeloader.so  
 /usr/local/lib/php/extensions/no-debug-non-zts-20090626/homeloader.so  
 /usr/local/lib/php/extensions/no-debug-non-zts-20100525/homeloader.so  <-- code="" success="">

Monday, July 22, 2013

suhosin (cpanel) on PHP5.4

after upgrading to latest php using easyapache, no suhosin.so created.
i'm compile myself and its work:
reference:https://github.com/stefanesser/suhosin/issues/17

cd ~
mkdir suhosin
cd suhosin
wget https://github.com/stefanesser/suhosin/archive/master.zip
unzip master.zip
Start Compiling
phpize
./configure
make
make install

updatedb
locate memcache.so

/usr/local/lib/php/extensions/no-debug-non-zts-20090626/suhosin.so
/usr/local/lib/php/extensions/no-debug-non-zts-20100525/suhosin.so

Done!

Friday, July 12, 2013

unify, vlan tagging, ipv6 connection

store for future reading
http://blog.namran.net/2011/01/30/setting-up-ipv6-network-via-tm-unifi-on-centos-5/

currently not able to connect to vlan pppoe using centos.

i have this but not sure how to use:
http://home.abubakar.net/gitpub/?p=unifi_pppoe;a=commitdiff_plain

this article about creating vlan interface:
http://www.cyberciti.biz/tips/howto-configure-linux-virtual-local-area-network-vlan.html

exploring. pls wait for successfull stories :p

UPDATES (2):
i have a problem with PADO (no receive response from server)
http://wiki.mikrotik.com/wiki/Manual:Interface/PPPoE

further search i think there maybe bugs with my pppd
http://thomashw.github.io/blog/2012/09/06/rp-pppoe-and-pppd-lcp-timeout-sending-config-requests/

UPDATES (1):
http://www.tunnelbroker.net/forums/index.php?topic=951.0;wap2
found unifi dialer:
http://home.abubakar.net/gitpub/?p=unifi_pppoe;a=summary


 #! /bin/sh   
 #  
 # unifi-pppoe          Script to run PPPOE/VLAN for Telekom Malaysia  
 #        UniFi Broadband Internet Service.  
 # chkconfig: 345 10 90  
 # description: UniFi service provides Internet and IPTV service  
 #       over VLANs. This script sets your system to   
 #       connect to the IP Network. It also sets up a   
 #       bridged device to connection to the set top box  
 #       via another NIC.   
 ### BEGIN INIT INFO  
 # Provides:  unifi-pppoe  
 # Required-Start: $local_fs   
 # Required-Stop: $local_fs  
 # Default-Start:  3 4 5  
 # Default-Stop:  0 1 2 6  
 # Short-Description: PPPoE/VLAN for UniFi  
 ### END INIT INFO  
 # Settings:  
 USER=user@unifi  
 PASS=unifipassword  
 WANIFACE=eth1  
 INETVLAN=500  
 IPTVIFACE=eth2  
 IPTVVLAN=600  
 # INSTRUCTIONS:  
 #  
 # (1) Install this script   
 #  
 # Copy it to /etc/init.d/unifi-pppoe. Make sure it is owned by  
 # root and set the permission for it to 700.  
 #  
 # don't forget to install the following packages:  
 #      yum install vconfig rp-pppoe ppp bridge-utils  [CentOS]  
 #      sudo apt-get install vlan pppoe ppp bridge-utils [Ubuntu]  
 #  
 # Set it to run on startup automatically using:  
 #  chkconfig unifi-pppoe on        [CentOS]  
 #  update-rc.d unifi-pppoe defaults    [Ubuntu]  
 #  
 # (2) Edit the settings above  
 # Set USER to your UniFi user-id, PASS to your internet password.  
 # WANIFACE is the interface from which you connect your PC to the  
 # BTU.   
 # If you are using a vlan-tagging switch (e.g. mikrotik RB250GS or  
 # equivalent), set INETVLAN to blank. If your PC is connected   
 # directly to the BTU, set it to 500.  
 # Added a patch from Stanley Seow/rizvanrp for IPTV Vlan. You would   
 # need to set IPTVIFACE to the ethernet that your set top box is   
 # connected to, and IPTVVLAN to 600. If you don't have IPTV (e.g.  
 # UniFi BIZ), leave both settings blank.  
 # Example connection:  
 #  
 # +---------+     +-------------------+  
 # |Fiber BTU|---------|eth0  Linux PC  |  
 # +---------+     |          |  
 #           |  eth1   eth2  |  
 #           +-------------------+  
 #  +------+        |    |  
 #  | IPTV |----------------+    +--------- (LAN PCs)  
 #  +------+  
 #  
 # (3) Test it using:  
 #  /etc/init.d/unifi-pppoe start  [to start]  
 #  /etc/init.d/unifi-pppoe stop   [to stop]  
 # Note: If you're planning to run this for more than a few minutes,   
 #    make sure you setup a firewall on your system. Also, you  
 #    may share the internet connection with other PCs via   
 #    another interface. You can accomplish both of these using  
 #    the excellent arno-iptables-firewall script. Install this  
 #    from the website (for CentOS) or "sudo apt-get install  
 #    arno-uptables-firewall" on ubuntu and follow the instructions.  
 # Written by shahada abubakar <shahada AT abubakar.net>  
 #  
 # Copyright (c) 2011, Shahada Abubakar.  
 #  
 # This program is free software: you can redistribute it and/or modify  
 # it under the terms of the GNU General Public License as published by  
 # the Free Software Foundation, either version 3 of the License, or  
 # (at your option) any later version.  
 #  
 # This program is distributed in the hope that it will be useful,  
 # but WITHOUT ANY WARRANTY; without even the implied warranty of  
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the  
 # GNU General Public License for more details.  
 #  
 # You should have received a copy of the GNU General Public License  
 # along with this program. If not, see <http://www.gnu.org/licenses/>  
 start_vpn() {  
      if [ -e /var/run/ppp-unifi.pid ]; then  
           PID=`head -1 /var/run/ppp-unifi.pid`  
           GOT=`ps xa | grep "$PID" | grep -v grep | wc -l`  
           if [ "$GOT" -ne 0 ] ; then  
                echo "unifi-pppoe is already running..."  
                return 1  
           fi  
      fi  
      if [ "$INETVLAN" != "" ] ; then  
           ifconfig $WANIFACE up 0.0.0.0  
           modprobe 8021q  
           vconfig set_name_type DEV_PLUS_VID_NO_PAD 2>&1 > /dev/null  
           vconfig add $WANIFACE $INETVLAN 2>&1 > /dev/null  
           # see contents of /proc/net/vlan/config for current status  
           PPPOEDEV=$WANIFACE.$INETVLAN  
      else  
           PPPOEDEV=$WANIFACE  
      fi  
      ifconfig $PPPOEDEV up 0.0.0.0  
      if [ "$INETVLAN" != "" -a "$IPTVVLAN" != "" -a "$IPTVIFACE" != "" ] ; then  
           vconfig add $WANIFACE $IPTVVLAN  
           ifconfig $WANIFACE.$IPTVVLAN up 0.0.0.0  
           ifconfig $IPTVIFACE up 0.0.0.0  
           brctl addbr iptv-bridge  
           brctl addif iptv-bridge $WANIFACE.$IPTVVLAN  
           brctl addif iptv-bridge $IPTVIFACE  
           # from stanleyseow AT gmail.com  
           # Up the bridge interface named iptv-bridge  
           ifconfig iptv-bridge up 0.0.0.0  
      fi  
      logger "Starting UniFi PPPoE session"  
      # note: add UniFi specific routes and post-up commands to   
      #    /etc/ppp/ip-up.local  
      /usr/sbin/pppd pty \  
           "/usr/sbin/pppoe -p /var/run/pppoe-unifi.pid -I $PPPOEDEV -T 80 -U -m 1412" \  
           noipdefault noccp noauth hide-password usepeerdns mtu 1492 \  
           defaultroute mru 1492 noaccomp nodeflate nopcomp novj novjccomp \  
           user $USER lcp-echo-interval 20 lcp-echo-failure 3 \  
           password $PASS debug maxfail 0 persist \  
           linkname unifi ipparam unifi   
 }  
 status_vpn () {  
      if [ -e /var/run/ppp-unifi.pid ]; then  
           PID=`head -1 /var/run/ppp-unifi.pid`  
           GOT=`ps xa | grep "$PID" | grep -v grep | wc -l`  
           if [ "$GOT" -ne 0 ] ; then  
                echo "unifi-pppoe is running..."  
                return 1  
           else  
                echo "unifi-pppoe is dead but pid file exists"  
                return 0  
           fi  
      else  
           echo "unifi-pppoe is not running..."  
           return 0  
      fi  
 }  
 stop_vpn () {  
      if [ -e /var/run/ppp-unifi.pid ] ; then  
           PID=`head -1 /var/run/ppp-unifi.pid`  
           kill $PID  
           ifconfig $WANIFACE up 0.0.0.0  
           if [ "$INETVLAN" != "" ] ; then  
                if [ "$IPTVVLAN" != "" ] ; then  
                     ifconfig iptv-bridge down  
                     brctl delif iptv-bridge eth2   
                     brctl delif iptv-bridge $WANIFACE.$IPTVVLAN  
                     brctl delbr iptv-bridge  
                     vconfig rem $WANIFACE.$IPTVVLAN  
                fi  
                vconfig rem $WANIFACE.$INETVLAN  
           fi  
      else  
           echo "unifi-pppoe is not running..."  
           return 0  
      fi  
 }  
 case "$1" in  
      start)  
           start_vpn;  
           RETVAL=$?  
           ;;  
      stop)  
           stop_vpn;  
           RETVAL=$?  
           ;;  
      restart)  
           stop_vpn;  
           sleep 1;  
           start_vpn  
           RETVAL=$?  
           ;;  
      status)  
           status_vpn;  
           RETVAL=$?  
           ;;  
      *)  
           echo "Usage: unifi-pppoe start|stop|restart|status"  
           exit 1  
 esac  
 exit $RETVAL  

Monday, May 20, 2013

windows 8 dns not responding

ref: http://atechjourney.com/dns-server-not-responding-error-fix.html/


How to fix DNS Server Not Responding Error Normally

  • Open command prompt window by clicking on Run –> cmd (run with administrator privilege)
  • netsh int ip reset c:\resetlog.txt This will reset the ip
  • type netsh winsock reset. This command will create a prompt to restart the computer, don’t restart now. This will help reset winsock settings. Although resetting winsock is not related to this error, this might be helpful in fixing other issues which can lead to this error.
  • type ipconfig /flushdns This will help in flushing the stored DNS cache.
  • Restart the computer and check if the issue is fixed.

Monday, May 13, 2013

Enabling DNSSEC in MyNIC .my domains

ref: http://imouto.my/enabling-dnssec-in-mynic-my-domains-using-bind-9-9/

storing url for free time reading :)


This guide is written by myself so that I do not forgot how to do this again in the future. This should remind me how to set up DNSSEC with BIND 9.9 complete with keys rollover scheme that should be painless to implement.
I assume that you already have:-
  • BIND 9.9 installed. Older version doesn't work with this guide. And trust me, you don't want to deal with dynamic zones which DNSSEC-enabled BIND <9 .9="" 6="" called="" centos="" created="" daemon="" guide="" have="" is="" li="" named="" process="" running="" the="" therefore="" this="" to.="" under="" unless="" used="" user="" using="" you="">
  • Fully working .my zone(s) in that BIND installation.
  • Technical contact access in domainregistry.my control panel for your .my domain.
First, ensure that DNSSEC is enabled in the BIND install (it should be on by default).
options {
    listen-on port 53 { 127.0.0.1; };
    listen-on-v6 port 53 { ::1; };
    directory     "/var/named";
    dump-file     "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
        memstatistics-file "/var/named/data/named_mem_stats.txt";
    recursion no;
    version "It's over 9000";
    dnssec-enable yes;
    dnssec-validation yes;
    dnssec-lookaside auto;

    sig-validity-interval 30 8;
    /* Path to ISC DLV key */
    bindkeys-file "/etc/named.iscdlv.key";
    managed-keys-directory "/var/named/dynamic";
};
Related Posts Plugin for WordPress, Blogger...