configure: error: libpng.(a|so) not found.

April 26, 2008 on 2:53 pm | In Installation, PHP | 1 Comment

cd /usr/local/src
wget http://prdownloads.sourceforge.net/libpng/libpng-1.2.26.tar.gz?download
cd libpng-1.2.26

./configure
make
make install

configure: error: libjpeg.(a|so) not found

April 26, 2008 on 2:48 pm | In PHP | No Comments

===============================
cd /usr/local/src/
wget http://site.n.ml.org/download/19980327153823/libjpeg/libjpeg-6b.tar.gz
cd jpeg-6b
./configure
make
make install
===============================

If everything went fine do

===============================
updatedb
===============================

If it is not present

===============================
ldconfig
===============================

Continue with PHP compilation

up2date PHP yum php , Source Install tips

April 26, 2008 on 2:41 pm | In PHP | No Comments

In RHEL 4

You can update PHP using

———————————————-
up2date @php
———————————————-

In RHEL 5 and CentOs

———————————————-
yum groupinstall php
———————————————-

Only if you are unable to proceed with the above installation or if you need a specific version of PHP you should go for source compilation.

Note: you can upgrade PHP with the help of /scripts/easyapache in Cpanel server.
In Plesk server, you should not recompile PHP with source. Only rpm should be used for installation.

Before trying the source installation, please note this is for advanced users and those who have good knowledge in installation.

Source Installation

cd /usr/local/src/

Download the Complete source from the link http://www.php.net/downloads.php
Get the tar.gz format .

wget http://us.php.net/get/php-5.2.5.tar.gz/from/this/mirror
tar -zxf php-5.2.5.tar.gz
cd php-5.2.5

./configure (options) —————-> options are given like eg: –with-mysql=/usr/
you need to add the corresponding options to integrate the module with php
make
make install

However, this is just for your knowledge . You will not be able to install it you are a newbee….

CubeCart Installation

April 25, 2008 on 2:25 pm | In Cpanel, CubeCart, Installation, Plesk | No Comments

Before going for an install check whether you meet the requirements

Create a subdirectory in which you need to install the CubeCart
example domain.com/business/

# Download the source code from their site at : http://www.cubecart.com/site/home/
Free download as well as paid ones are available.
# Uncompress the source code to the store directory created above.
# Create a database using the control panel.
# In the browser access the link : https://www.cubecart.com/build/
# Enter the details about the database you have created and also about the administrator details. You can select any skin. In the ‘Advanced’ settings
Store URL : http://www.domain.com/business(If the directory name of the cart(ie. ‘upload’ file) is set as ‘store’)
Server Root Directory : /home/user/public-html/store
Site Root Relative Path : /store/

Once the form is complete they will provide a config file named ‘global.inc.php’ and an SQL database dump.
Copy the contents of global.inc.php and paste it to upload/includes/global.inc.php.
Restore the database dump to the database you have created.

Now you can access the shopping cart at: http://domain.com/business
And the admin area can be accessed at: http://domain/business/admin

The configuration file for cubecart is ‘global.inc.php’.

:)

Advanced Suhosin Configuration

April 25, 2008 on 1:49 pm | In PHP | No Comments

Manual configuration for Suhosin in php.ini
Please note that these lines should be added below to the line extension=suhosin.so

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

; Module Settings ;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

[suhosin]
; Logging Configuration
suhosin.log.use-x-forwarded-for = Off
suhosin.log.syslog.facility = 9

; Executor Options
suhosin.executor.max_depth = 0
suhosin.executor.include.max_traversal = 4
suhosin.executor.disable_emodifier = Off
suhosin.executor.allow_symlink = Off

; Misc Options
suhosin.simulation = Off
suhosin.apc_bug_workaround = Off
suhosin.sql.bailout_on_error = Off
suhosin.multiheader = Off
suhosin.mail.protect = 1
suhosin.memory_limit = 20

; Transparent Encryption Options

suhosin.session.encrypt = On
suhosin.session.cryptua = On
suhosin.session.cryptdocroot = On
suhosin.session.cryptraddr = 0
suhosin.cookie.encrypt = On
suhosin.cookie.cryptua = On
suhosin.cookie.cryptraddr = 0

; Filtering Options

suhosin.filter.action = 406
suhosin.cookie.max_array_depth = 100
suhosin.cookie.max_array_index_length = 64
suhosin.cookie.max_name_length = 64
suhosin.cookie.max_totalname_length = 256
suhosin.cookie.max_value_length = 10000
suhosin.cookie.max_vars = 100
suhosin.cookie.disallow_nul = On
suhosin.get.max_array_depth = 50
suhosin.get.max_array_index_length = 64
suhosin.get.max_name_length = 64
suhosin.get.max_totalname_length = 256
suhosin.get.max_value_length = 512
suhosin.get.max_vars = 100
suhosin.get.disallow_nul = On
suhosin.post.max_array_depth = 100
suhosin.post.max_array_index_length = 64
suhosin.post.max_totalname_length = 256
suhosin.post.max_value_length = 65000
suhosin.post.max_vars = 200
suhosin.post.disallow_nul = On
suhosin.request.max_array_depth = 100
suhosin.request.max_array_index_length = 64
suhosin.request.max_totalname_length = 256
suhosin.request.max_value_length = 65000
suhosin.request.max_vars = 200
suhosin.request.max_varname_length = 64
suhosin.request.disallow_nul = On
suhosin.upload.max_uploads = 25
suhosin.upload.disallow_elf = On
suhosin.upload.disallow_binary = Off
suhosin.upload.remove_binary = Off
suhosin.session.max_id_length = 128

How to Install Suhosin. Cpanel Plesk Direct Admin etc…

April 25, 2008 on 9:02 am | In Installation, PHP | No Comments

What is Suhosin?

Suhosin is a protective covering for PHP. Lets move with ordered steps.
There are 2 separate versions on Suhosin. Both of them can be run together or separately.

First is the raw patch where you need to recompile PHP in shell to work. This adds low level protection against things like buffer overflows and format string vulnerabilities.
Second is a PHP extension that protects at runtime, easy to install.
Both versions will still you allow you to use other PHP extensions like Zend Optimizer without any issues.

We will deal with the installation of the extension.

Installing Suhosin
Before you start, make a phpinfo page.
Next is to make sure that PHP is NOT compiled with –enable-versioning
This can be seen from the Configure Command section at the top, make sure you do not see
–enable-versioning
If it contains this option, the extension will not work.
Then the only option left is to recompile PHP.

The final check is applied if you are using Zend Optimizer. Make sure you are using at least version 3.2.1 or above of Zend Optimizer. If you are using anything below that there is a known bug in Zend Optimizer that gets caught up in Suhosin while reading zend encoded pages.

So be sure to upgrade Optimizer to a more recent release before you install Suhosin to avoid issues.

If you have it installed you’ll see something like:

#php -v
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies

with Zend Extension Manager v1.0.10, Copyright (c) 2003-2006, by Zend Technologies

with Zend Optimizer v3.0.1, Copyright (c) 1998-2006, by Zend Technologies

Suhosin works fine on cPanel/WHM servers, DirectAdmin, Plesk and any others.

Installing Suhosin Extension

Download the source file for the Suhosin extension

============================
cd /usr/local/
wget http://www.hardened-php.net/suhosin/_media/suhosin-0.9.18.tgz
tar -zxvf suhosin-0.9.18.tgz
cd suhosin-0.9.18
phpize
./configure
make
make install
============================

Output for “make install” will be something like this:

Installing shared extensions: /usr/local/lib/php/extensions/no-debug-non-zts-20020429/
Make a note of the directory location and confirm it exists and has suhosin.so in it:

ls –lah /usr/local/lib/php/extensions/no-debug-non-zts-20020429/
-rwxr-xr-x 1 root root 334K Mar 19 09:17 suhosin.so*

Now copy suhosin.so to /usr/lib/php/extensions since our php.ini points to that directory and not the one the make install used

============================
cp /usr/local/lib/php/extensions/no-debug-non-zts-20020429/suhosin.so /usr/lib/php/extensions/no-debug-non-zts-20020429
============================

Checking PHP

Now we need to check PHP to ensure suhosin will be added in.
Find where your current PHP.ini is:

============================
php -i |grep php.ini
============================

Configuration File (php.ini) Path => /usr/local/Zend/etc/php.ini

Edit the php.ini

vi /usr/local/Zend/etc/php.ini
Please take a backup of the php.ini !!!!

Ensure the include path/extension is set properly.

Search for: extension_dir

You should see something like this:

;;;;;;;;;;;;;;;;;;;;;;;;;

; Paths and Directories ;

;;;;;;;;;;;;;;;;;;;;;;;;;

include_path = “.:/usr/lib/php:/usr/local/lib/php:/usr/lib/php/extensions:/usr/lib/php/extensions/no-debug-non-zts-20020429:” ;

extension_dir = /usr/lib/php/extensions/no-debug-non-zts-20020429/ ; directory in which the loadable extensions (modules) reside

Note the exact path is the same as what we wrote down when we did “make install”
If not, you will need to add it or COPY the file to the new location as mentioned above.

Add the suhosin.so extension to php.ini
While still in php.ini search for Dynamic Extensions

/Dynamic Extensions

You should see:
;;;;;;;;;;;;;;;;;;;;;;

; Dynamic Extensions ;

;;;;;;;;;;;;;;;;;;;;;;

Add this below:

============================
extension=suhosin.so
============================

Note to 64 bit OS users:
Check to make sure php.ini is using the proper extension_dir setting:

============================
extension_dir = /usr/lib64/php4
============================

Then copy the suhosin.so to that directory after you do “make install”

============================
cp -v /usr/local/lib/php/extensions/no-debug-non-zts-20020429/suhosin.so /usr/lib64/php4/
============================

End 64 Bit OS note:

Now save php.ini and check PHP from shell:

php -v

PHP 4.4.6 (cli) (built: Mar 19 2007 09:54:33)

Copyright (c) 1997-2007 The PHP Group

Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies

with Zend Extension Manager v1.2.0, Copyright (c) 2003-2006, by Zend Technologies

with Suhosin v0.9.18, Copyright (c) 2002-2006, by Hardened-PHP Project

with Zend Optimizer v3.2.2, Copyright (c) 1998-2006, by Zend Technologies

NOTE if checking using phpinfo.php page make SURE you RESTART the apache web server: service httpd restart

/etc/rc.d/ini.d/httpd restart

Thats all :)

Crontab error Cpanel server

April 24, 2008 on 2:28 pm | In Cpanel | 1 Comment

The crons are not even listed with WHM or Cpanel.

The root user as well as the Cpanel users will not be able to access the cron.

This is mainly due to a permission issue of cron binary. Hence chmod it to 755.

======================
chmod 755 /usr/bin/crontab
======================

:)

Unable to load iptables module (ipt_state), aborting. APF Error

April 24, 2008 on 1:09 pm | In APF, Linux | No Comments

root@server[/etc/apf]# apf -s
Unable to load iptables module (ipt_state), aborting.
root@server[/etc/apf]#

Here is the fix

Edit /etc/apf/internals/functions.apf

vi /etc/apf/internals/functions.apf

Replace the lines

====================
ml ipt_state 1
ml ipt_multiport 1
====================

With

====================
ml xt_state
ml xt_multiport
====================

Restart apf.

yum.conf for Centos 4.6

April 24, 2008 on 9:11 am | In Centos, Linux | No Comments

Here is the yum.conf entry for Centos 4.6. Copy all the lines below.

############################

[main]
cachedir=/var/cache/yum
debuglevel=2
logfile=/var/log/yum.log
pkgpolicy=newest
installonlypkgs=kernel kernel-smp kernel-devel kernel-smp-devel kernel-largesmp kernel-largesmp-devel kernel-hugemem kernel-hugemem-devel
distroverpkg=centos-release
tolerant=1
exactarch=1
retries=20
obsoletes=1
gpgcheck=1
plugins=1

# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d

############################

Here is the repo for Centos 4.4.

CentOS-Base.repo

# CentOS-Base.repo
#
# This file uses a new mirrorlist system developed by Lance Davis for CentOS.
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#

[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4

#released updates
[update]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4

#packages used/produced in the build but not released
[addons]
name=CentOS-$releasever - Addons
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons
#baseurl=http://mirror.centos.org/centos/$releasever/addons/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4

#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
#baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4

XCache Installation Linux Cpanel

April 24, 2008 on 9:07 am | In Apache, Cpanel, Installation, PHP | No Comments

1) Download

==============================
wget http://xcache.lighttpd.net/pub/Releases/1.2.1/xcache-1.2.1.tar.gz
phpize
./configure –enable-xcache
make
make install
==============================

Find the php.ini file.

php -i| grep php.ini

Edit the php.ini file

Add the line below.
==============================
Find other zend_extension lines. Add the line below.

zend_extension = /usr/local/lib/php/extensions/no-debug-non-zts-20020429/xcache.so
==============================

Note the line proper path “/usr/local/lib/php/extensions/no-debug-non-zts-20020429/ ” is received at the end of make install. Replace with that path.

Go for Apache restart

Check your PHP info page

« Previous PageNext Page »