PHP 5 Local

As php5 compiled in the cgi mode customers cannot to use .htaccess directives like php_admin, php_value, php_flag. In phpsuexec setup (for main php) it is overridden by allowing customers place custom php.ini with the variables.

However if you build the php5 as the secondary php it will not have such ability. So how to solve it? To write very simple wrapper to pass php.ini line of the current directory if exists.

The steps to be done after php5 setup.

Moving php5 binary:

mv /usr/local/cpanel/cgi-sys/php5 /usr/local/cpanel/cgi-sys/php5.bin

Then creating wrapper file in the /usr/local/cpanel/cgi-sys/php5 with the following content:

#!/bin/bash

# This will fake the name & path and hide the /usr/local/cpanel/cgi-sys/php5 path!
export SCRIPT_NAME=$REQUEST_URI
export SCRIPT_FILENAME=$PATH_TRANSLATED
export PWD=`echo $PATH_TRANSLATED|egrep -o “(.*?/)”`

if [ -f “$PWD/php.ini” ]; then
exec /usr/local/cpanel/cgi-sys/php5.bin -c $PWD
else
exec /usr/local/cpanel/cgi-sys/php5.bin
fi

Save the file and change the permissons:

chown root:wheel /usr/local/cpanel/cgi-sys/php5*;
chmod 755 /usr/local/cpanel/cgi-sys/php5*;

We are done! By default php5 will use the global php.ini, but if the customer has the own php.ini in its folder php5 will use it instead

Wild Card DNS

For the DNS, edit the DNS zone file and add the following:
Code:

* IN A x.x.x.x

(where x.x.x.x is the IP for the hosting account using the wildcard)

Edit your httpd.conf config file for your web server and add a
server alias wildcard for the host you want to have wildcards:
Code:

ServerAlias *.mydomain.com

OpenDNS error

change etc/named.conf from:

options {
directory “/var”;
auth-nxdomain no;
pid-file “/var/run/named/named.pid”;

to this:

options {
directory “/var”;
auth-nxdomain no;
pid-file “/var/run/named/named.pid”;
allow-recursion { 127.0.0.1; };

Kernel compilation

Go to the /usr/src directory
Unpack the source code with tar -xvzf linux-2.x.x.tag.gz.
Move to the /usr/src/linux sub-directory.

make mrproper
make menuconfig
make all     — make vmlinux
— make modules
— make bzimage
make modules_install
make install
cp /usr/src/linux/arch/i386/boot/zImage /zImage

——————————————————————
Making an initrd Image

An initrd image is needed for loading your SCSI module at boot time or if you are compiling the kernel with ext3 support as a module. If you do not need an initrd image, do not make one and do not edit lilo.conf or grub.conf to include this image.

Use the /sbin/mkinitrd shell script to build an initrd image for your machine. To use this command, the loopback block device must be available.

To build the new initrd image, run /sbin/mkinitrd with parameters such as this:

/sbin/mkinitrd /boot/initrd-2.4.18-0.12-jul2001.img 2.4.18-0.12-jul2001

In the above example, /boot/initrd-2.4.18-0.12-jul2001.img is the file name of the new initrd image. 2.4.18-0.12-jul2001 is the kernel whose modules (from /lib/modules) should be used in the initrd image. This is not necessarily the same as the version number of the currently running kernel.

——————————————————————

Cleaning targets:

clean           – Remove most generated files but keep the config and
enough build support to build external modules
mrproper        – Remove all generated files + config + various backup files
distclean       – mrproper + remove editor backup and patch files

Configuration targets:
config          – Update current config utilising a line-oriented program
menuconfig      – Update current config utilising a menu based program
xconfig         – Update current config utilising a QT based front-end
gconfig         – Update current config utilising a GTK based front-end
oldconfig       – Update current config utilising a provided .config as base
silentoldconfig – Same as oldconfig, but quietly
randconfig      – New config with random answer to all options
defconfig       – New config with default answer to all options
allmodconfig    – New config selecting modules when possible
allyesconfig    – New config where all options are accepted with yes
allnoconfig     – New config where all options are answered with no

Other generic targets:
all             – Build all targets marked with [*]
* vmlinux         – Build the bare kernel
* modules         – Build all modules
modules_install – Install all modules to INSTALL_MOD_PATH (default: /)
dir/            – Build all files in dir and below
dir/file.[ois]  – Build specified target only
dir/file.ko     – Build module including final link
rpm             – Build a kernel as an RPM package
tags/TAGS       – Generate tags file for editors
cscope          – Generate cscope index
kernelrelease   – Output the release version string
kernelversion   – Output the version stored in Makefile
headers_install – Install sanitised kernel headers to INSTALL_HDR_PATH                    (default: /usr/src/linux-2.6.24.3/usr)

Static analysers
checkstack      – Generate a list of stack hogs
namespacecheck  – Name space analysis on compiled kernel
export_report   – List the usages of all exported symbols
headers_check   – Sanity check on exported headers

Kernel packaging:
rpm-pkg         – Build the kernel as an RPM package
binrpm-pkg      – Build an rpm package containing the compiled kernel
and modules
deb-pkg         – Build the kernel as an deb package
tar-pkg         – Build the kernel as an uncompressed tarball
targz-pkg       – Build the kernel as a gzip compressed tarball
tarbz2-pkg      – Build the kernel as a bzip2 compressed tarball

Documentation targets:
Linux kernel internal documentation in different formats:
htmldocs        – HTML
installmandocs  – install man pages generated by mandocs
mandocs         – man pages
pdfdocs         – PDF
psdocs          – Postscript
xmldocs         – XML DocBook

Architecture specific targets (i386):
* bzImage       – Compressed kernel image (arch/x86/boot/bzImage)
install       – Install kernel using
(your) ~/bin/installkernel or
(distribution) /sbin/installkernel or
install to $(INSTALL_PATH) and run lilo
bzdisk       – Create a boot floppy in /dev/fd0
fdimage      – Create a boot floppy image
isoimage     – Create a boot CD-ROM image

make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build
make V=2   [targets] 2 => give reason for rebuild of target
make O=dir [targets] Locate all output files in “dir”, including .config
make C=1   [targets] Check all c source with $CHECK (sparse by default)
make C=2   [targets] Force check of all c source with $CHECK

Execute “make” or “make all” to build all targets marked with [*]
For further info see the ./README file