Archive for May, 2011

 Powered by Max Banner Ads 

Warning: Cannot modify header information – headers already sent by (output started at /home/rayg1/public_html/dogtraining/wp-content/plugins/tubepress/classes/net/php/pear/HTTP/Request2/Adapter.class.php:297) in /home/rayg1/public_html/dogtraining/wp-includes/pluggable.php on line 865

Saturday, May 28th, 2011

The solution is just delete this plugin  ” tubepress”

i have applied the solution my self and fixed the issue.

Thank you.

How to switch to a different PHP version?

Saturday, May 28th, 2011

How to switch to a different PHP version?

SiteGround has implemented a unique server setup that allows each customer to choose which version of PHP to use for his / her account. What is more, the customer can even use different PHP versions for different directories in one and the same hosting account.

The PHP versions currently supported are: PHP 4.4 PHP 5.0,  PHP 5.1, PHP 5.2, PHP 5.3 and a special additionally secured version of PHP 5.2 with Suhosin patch.

It is really easy to change PHP versions for your website with a web hosting account with SiteGround. All you need to do is follow those step:

1. Log in to cPanel for your account.
2. Go to Advanced section -> PHP Version Change
3. Navigate to the directory you would like to change the PHP version for (note that the change will apply to sub-directories for it as well)
4. Click on the directory name.
5. Select the desired PHP version and click Save.

That is all.

You can find detailed instructions how to manually change the PHP version for your account below:

Go to cPanel, File Manager and choose “Web Root (public_html/www)”. There create a new file (or edit the existing one) called .htaccess and add the following line:
To switch to PHP 4.4:

AddHandler application/x-httpd-php4 .php .php4 .php3

To switch to PHP 5.0:

AddHandler application/x-httpd-php5 .php .php5 .php4 .php3

To switch to PHP 5.1:

AddHandler application/x-httpd-php51 .php .php5 .php4 .php3

To switch to PHP 5.2:

AddHandler application/x-httpd-php52 .php .php5 .php4 .php3

To switch to PHP 5.3:

AddHandler application/x-httpd-php53 .php .php5 .php4 .php3

To switch to the secure PHP 5.2 with Suhosin patch:

AddHandler application/x-httpd-php52s .php .php5 .php4 .php3

This setting will apply recursively to all of the subdirectories. In case you’d like to have a different version of PHP in a subdirectory, create a new .htaccess file in it with the directive for the desired PHP version in it.

Rebuild php.ini in cpanel server (linux)

Saturday, May 28th, 2011

You can rebuilt php.ini by running the below command





Saturday, May 28th, 2011

OpenVPN Termination on OpenWrt

This page contains an overview on how to configure an OpenVPN client on a Linksys WRT54GS running OpenWrt.

Introductory Information

To secure the wireless network link between the WRT client and the remote access point, I chose to setup a VPN tunnel, and route all traffic from the network behind the WRT through this VPN tunnel.

OpenVPN was chosen, due to the availability of packages for OpenWrt and numerous other platforms, the security it provides, and the flexibilty and ease of configuration.

I chose to configure my linux router at the remote end as the OpenVPN server, with the OpenVPN client being the WRT.

Note that I’m using pre-shared keys, rather than SSL/TLS, as it simplifies the configuration.

As the subnet behind the WRT is houwels.sgnet.wafreenet, and it is connecting to the SGNet router, I prefix all OpenVPN configuration files with the name of the subnet, namely houwels.

Network Addressing
The following network addresses are used below: client subnet behind WRT LAN interface of WRT client PCs behind WRT client link between SGNet and WRT virtual interface on SGNet router WLAN interface of WRT VPN link between SGNet and WRT VPN end-point on SGNet router VPN end-point on WRT

Substitute your own network addresses when implementing your own configuration.

Install & Configure OpenVPN Server
Install OpenVPN Server
I’m using an OpenVPN 2.0.5 server on a RedHat 9 linux box. Refer to the OpenVPN documentation for information on installing OpenVPN on RedHat and other linux distributions.

Create Static Key
On the linux router, create a pre-shared static key for the VPN link:

  openvpn --genkey --secret /etc/openvpn/houwels_static.key

Create Configuration File
The OpenVPN configuration file (/etc/openvpn/houwels_openvpn.conf) on the SGNet linux router is similar to this:

  # Use a dynamic tun device.
  dev tun0

  # is our local VPN endpoint (SGNet).
  # is our remote VPN endpoint (WRT).

  # up script will establish routes once the VPN is alive.
  up ./houwels.up

  # pre-shared static key
  secret houwels_static.key

  # OpenVPN uses UDP port 1194 by default.
  # Each OpenVPN tunnel must use a different port number.
  port 1194

  # Downgrade UID and GID to "nobody" after initialization for extra security.
  user nobody
  group nobody

  # use LZO compression.

  # More reliable detection when a system loses its connection.  
  ping 15
  ping-restart 45

  # Silence  the output of replay warnings, which are a common false
  # alarm on WiFi networks.  This option preserves the  security  of
  # the replay protection code without the verbosity associated with
  # warnings about duplicate packets.

  # Verbosity level.
  # 0 = quiet, 1 = mostly quiet, 3 = medium output, 9 = verbose 
  verb 3

Create Routing Script
OpenVPN can run a script when the VPN link is established. This is useful, as it allows you to add a route through the VPN tunnel.

On the SGNet router, I use the following script (/etc/openvpn/houwels.up) to add a route to the subnet behind the WRT (


  # add route to houwels network via VPN end-point of WRT
  route add -net netmask gw $5

Note that the houwels.up script must be executable:

chmod 755 /etc/openvpn/houwels.up

Start OpenVPN
Once configured, start OpenVPN. On my RedHat linux router, it’s simply a matter of running

  /etc/init.d/openvpn start

and OpenVPN will parse each .conf file it finds in /etc/openvpn/, and start an OpenVPN daemon for each.

Install Components on OpenWrt
Install IPK Packages
Firstly, install the OpenVPN package and dependancies.

ipkg install openvpn

and ipkg will automatically install all required dependancies, including kmod-tun, liblzo, libopenssl, and of course the openvpn package.

The liblzo package provides libraries to support lzo compression for OpenVPN, the libssl package provides libraries for SSL encryption used by OpenVPN, and the kmod-tun package provides the TUN/TAP device driver kernel module required by OpenVPN.

Create Configuration Files
Firstly, create a directory for all OpenVPN configuration files on the WRT:

  mkdir /etc/openvpn

Copy the previously created shared static key (houwels_static.key) from the linux router into /etc/openvpn on the WRT.

Create the configuration file for the OpenVPN link, /etc/openvpn/houwels_openvpn.conf:

  # Use a dynamic tun device.
  dev tun

  # OpenVPN server is the SGNet router.

  # is our local VPN endpoint (WRT).
  # is our remote VPN endpoint (SGNet).

  # up script will establish routes once the VPN is alive.
  up /etc/openvpn/houwels.up

  # pre-shared static key
  secret /etc/openvpn/houwels_static.key

  # OpenVPN uses UDP port 1194 by default.
  # Each OpenVPN tunnel must use a different port number.
  port 1194  

  # Downgrade UID and GID to "nobody" after initialization for extra security.
  user nobody

  # use LZO compression.

  # More reliable detection when a system loses its connection.
  ping 15
  ping-restart 45

  # Verbosity level.
  # 0 = quiet, 1 = mostly quiet, 3 = medium output, 9 = verbose
  verb 3

Create a script /etc/openvpn/houwels.up to establish a default route through the VPN once it is active:


  # add default route through VPN tunnel
  route add -net netmask gw $5

Once again, the houwels.up script must be executable:

chmod 755 /etc/openvpn/houwels.up

Using OpenVPN on OpenWrt
Start OpenVPN
Before OpenVPN can be started, the tun device driver needs to be loaded:

  insmod tun

Note that this module will be automatically loaded by OpenWrt during a reboot, as installation of the OpenVPN ipkg has alreadycreated /etc/modules.d/20-tun.

Now manually start OpenVPN using:

  openvpn --daemon --config /etc/openvpn/houwels_openvpn.conf

Test the VPN by trying to ping the remote end-point of the VPN tunnel.
If it’s not working, increase the verbosity level in the configuration file, restart OpenVPN, and monitor the syslog to see why it might be failing to connect (use logread on OpenWrt, and monitor /var/log/messages on the linux router).

Configure OpenVPN to Auto-Start
To get OpenVPN to start each time the WRT is rebooted, create /etc/init.d/S65openvpn with the following contents:


  # start the VPN
  openvpn --daemon --config /etc/openvpn/houwels_openvpn.conf --ifconfig-nowarn

and make the script executable:

  chmod 755 /etc/init.d/S65openvpn

Completing Configuration
Firewall Script
Note that you’ll need to modify the firewall script on the WRT to allow for the VPN tunnel.
I modified the firewall to only allow traffic through the VPN tunnel, and block all other non-VPN-ed traffic.

Performance Testing
Network Architecture
This WRT is connecting to an 802.11b Minitar MNWAPB access point, and hence is restricted to 802.11b 11Mbps speeds.

The throughput was measured by using wget to retrieve a 3MB file over the wireless link.

Initial tests were performed during setup, when the WRT was physically located close to the Minitar access point, so the WRT was associated to the Minitar with a link rate of 11Mbps. The tests were repeated once the WRT was installed at the client site, with similar results.

Throughput Without VPN
Throughput over the wireless link between the WRT and the Minitar was tested at approximately 600 kbytes/sec (ie, typical for an 802.11b wireless link).

Throughput With VPN
Once the VPN tunnel was established, and all traffic routed through it, the tests were repeated. Throughput dropped to approximately 300 kbytes/sec.

The major cause of this slow-down is the CPU in the WRT, as it needs to encrypt and decrypt all the traffic that is passing through the VPN tunnel. This can be observed by monitoring the CPU usage on the WRT while transferring large amounts of traffic through the VPN tunnel – the OpenVPN process consumes 99% of the CPU during this time.

The slow-down caused by the VPN tunnel is acceptable in the situation I’m using the WRT. If this isn’t the case, the throughput of the VPN tunnel can be increased by moving the VPN termination from the WRT onto a faster device (ie, a linux router) behind the WRT.



Install IonCube in Windows server

Thursday, May 26th, 2011

1- go to this URL and download the zip file http://www.ioncube.com/loaders.php

2- extract the zip file and copy this file  loader-wizard.php from the zip file to the localhost which mean to


3- open the locahost in side the server   localhost/loader-wizard.php then you will guide you what you need to do, for example copy the ioncube 5.x.x .dll to C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP5 or othes direction , is diffrent from server to server

then edit php ini ,  all the info u will see in http://www.ioncube.com/loaders.php

Thank you.

install Mysql and Phpmyadmin using yum

Wednesday, May 25th, 2011

yum -y install mysql mysql-server php-mysql

Start mysql service

/etc/rc.d/init.d/mysqld start

You’ll see mysql is being started, keep on watching for following line:

To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password ‘new-password’
/usr/bin/mysqladmin -u root -h vps-hostname password ‘new-password’

MySQL instruct you to create for mysql root’s password, so do it.

/usr/bin/mysqladmin -u root password ‘new-password’
/usr/bin/mysqladmin -u root -h vps-hostname password ‘new-password’

change new-password to vps password
change vps-hostname to vps hostname you have set up from PMC

Test newly set password by log in to mysql

mysql -u root -p
Enter password:

You should be able to log into mysql with the password if set correctly.

Create .my.cnf inside /root folder

vim /root/.my.cnf

add following lines


Save & exit & change mode that file

chmod 600 /root/.my.cnf

Download phpmyadmin from phpmyadmin’s site, untar it under /var/www/html

cd /var/www/html
wget http://downloads.sourceforge.net/project/phpmyadmin/phpMyAdmin/3.4.1/phpMyAdmin-3.4.1-all-languages.tar.gz?r=http%3A%2F%2Fwww.phpmyadmin.net%2Fhome_page%2Findex.php&ts=1306296119&use_mirror=cdnetworks-kr-1
tar xvzf phpMyAdmin-3.4.1-all-languages.tar.gz
ln -s phpMyAdmin-3.4.1-all-languages phpmyadmin
chown -R apache.apache phpMyAdmin-3.4.1-all-languages
chown -R apache.apache phpmyadmin
cd phpmyadmin
cp -p config.sample.inc.php config.inc.php
vim config.inc.php

look for line

$cfg[‘blowfish_secret’] = ”; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */

add random text to become like this

$cfg[‘blowfish_secret’] = ‘$5^tY7F3w’; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */

random text can be anything

Check phpmyadmin from browser



Install PHP using yum

Wednesday, May 25th, 2011

to install php, you need to use below commands

yum -y install php php-mbstring php-mcrypt php-gd

Restart httpd and verify PHP by create phpinfo.php

/etc/rc.d/init.d/httpd restart
cd /var/www/html
vim phpinfo.php

add these line

<? phpinfo() ?>

Change own phpinfo.php

chown apache.apache phpinfo.php

Browse from the browser https://ip-address/phpinfo.php

Install yum from the Hardware node

Wednesday, May 25th, 2011

to install yum,

you need to run the below command

vzpkg install VEID -p yum

VEID = vps ID

Verify yum has been installed into VPS by log into newly created VPS from hardware node.

vzctl enter VEID
rpm -qa | grep yum

Install APC php cacher in linux server

Wednesday, May 25th, 2011

You need to install ELS first then install APC using below command

els –apc

That is all,

how to install ELS? you will find the guide in the current blig, just serarch about it

If you need further assist,, feel free to send email

Thank you.

Install Els in linux server

Wednesday, May 25th, 2011

To install ELS, simply run the following command as root:
wget --output-document=installer.sh http://servermonkeys.com/projects/els/installer.sh; chmod +x installer.sh; sh installer.sh



Thant is all