APC is a free and  open PHP5 opcode cacher for caching & optimizing PHP5 intermediate code.
It is similar to other PHP5 opcode cachers, such as eAccelerator & XCache.

1. Install APC on Debian:

APC is a PHP5 extension and we will install it using PECL.For that we need to install APC dependencies:

apt-get install php5-dev apache2-prefork-dev build-essential

Now install APC:

pecl install apc

2. Enable APC:

After install you need to enable APC. Add the following line in php.ini file:

Continue Reading…

OpenVZ Web Panel is a GUI web-based frontend for controlling of the hardware and virtual servers with the OpenVZ.

 Install OpenVZ Web Panel  on Debian:

wget http://ovz-web-panel.googlecode.com/svn/installer/ai.sh
chmod +x ai.sh
./ai.sh

Now the web panel will install automatically on your server:

Installation finished.
Product was installed into: /opt/ovz-web-panel/
Starting services…
Starting OpenVZ Web Panel
Starting watchdog daemon…
=> Booting WEBrick…
=> Rails 2.2.2 application started on http://0.0.0.0:3000
[2012-03-02 17:57:30] INFO  WEBrick 1.3.1
[2012-03-02 17:57:30] INFO  ruby 1.8.7 (2010-08-16) [i486-linux]
Syncing physical servers state…
Place hardware daemon on machine with OpenVZ.
To start hardware daemon run:
sudo ruby /opt/ovz-web-panel//utils/hw-daemon/hw-daemon.rb start
Panel should be available at:
http://your-ip:3000
Default credentials: admin/admin
———————————– Continue Reading…

MySQL string replace

khaled —  March 9, 2012 — 1 Comment

One of the MySQL functions that is extremely useful is the MySQL REPLACE() function. The REPLACE syntax looks as follows:

REPLACE(str,from_str,to_str)

For example, if for some reason you need to update the links in your body fields and replace all your current links URL with new links URL you can use the following query:
update my_table set body=replace(body,’http://www.example1.com’,’http://www.example2.com’);

 

1. Install Apache 2.4 from source:

1.1 Prerequisites:

For installing Apache2.4 on Debian you need APR library. You can install this using the following command:

apt-get install libaprutil1 libaprutil1-dev

1.2  Download Apache2.4:

Download the latest version from here: http://httpd.apache.org/download.cgi#apache24
Go to /usr/src directory and download the latest version.

cd /usr/src
wget http://lnx.apollo-hw.ro/apache//httpd/httpd-2.4.1.tar.gz

1.3. Extract and Install Apache2.4:

Continue Reading…

Suhosin can be disabled by 2 methods:

1. Disable Suhosin using php.ini:

Open the php.ini file and add the following code:

[suhosin]
suhosin.simulation = On

NOTE: On means disabled and  Off means enabled.

Now restart the Apache2 server and Suhosin will be disabled.

/etc/init.d/apache2 restart

2. Disable Suhosin for specific domain using  .htaccess file: Continue Reading…