Archive for November, 2005

Installing php5 with existing php4

This script allow you to install php5 along with php4 on a Cpanel server with Choon’s annonymous spamer patch.

To run php 5 scripts, you have to name the file with .php5 extension.

http://devel.webonce.com/php5.txt

#!/bin/sh
# Copyright 2005 (c) Jacob Mather / WebOnce Technologies
# jmather@webonce.com
# All Rights Reserved

VERSION=5.0.5
cd /usr/src
wget -O php.tbz2 “http://us3.php.net/get/php-${VERSION}.tar.bz2/from/this/mirror”
tar -xjvf php.tbz2
rm -f php.tbz2

wget http://choon.net/opensource/php/php-${VERSION}-mail-header.patch

cd php-${VERSION}

patch -p1 } –prefix=/usr/local/php5 –exec-prefix=/usr/local/php5 –enable-force-cgi-redirect –enable-discard-path”

./configure $CFGLINE

make
make install

if [ -f /usr/local/php5/bin/php ]
then
#cp -f php.ini-recommended /usr/local/php5/lib/php.ini

cp /usr/local/php5/bin/php /usr/local/cpanel/cgi-sys/php5
chown root:wheel /usr/local/cpanel/cgi-sys/php5

echo “Action application/x-httpd-php5 \”/cgi-sys/php5\”" > /usr/local/apache/conf/php5.conf
echo “AddType application/x-httpd-php5 .php5″ >> /usr/local/apache/conf/php5.conf

TEST=`grep php5.conf /usr/local/apache/conf/httpd.conf`

if [ "$TEST" = "" ]
then
echo “Include /usr/local/apache/conf/php5.conf” >> /usr/local/apache/conf/httpd.conf
/etc/init.d/httpd restart
fi
else
echo “There was an error…”
fi

Comments off

Setting ProFTPd default tranfer mode

By default ProFTPd transfer all files in BINARY mode. This will work fine for images, zip files, other data files.

When you upload scripts, mainly .pl and .cgi (perl scripts), you have to upload then in ASCII mode to get it working.

Many FTP clients are smart enough to upload .pl and .cgi files in ASCII mode.

If you prefer, you can set ProFTPd to start all transefer in ASCII mode. This can be done by editing /etc/proftpd.conf

DefaultTransferMode ascii

If you do this, make sure you upload all images and other binary data files in banary mode.

Comments off

Domain Name not resolving in Cpanel Server

In a cpanel dedicated server, client added a domain name. But it won’t resolve even after 24 Hours. So i checked the if the domain name resolved by the DNS server of the server.

root@godislove [/tmp]# nslookup
> server 72.36.203.186
Default server: 72.36.203.186
Address: 72.36.203.186#53
> theworldslargestbusinessfranchise.com
Server: 72.36.203.186
Address: 72.36.203.186#53

** server can’t find theworldslargestbusinessfranchise.com: NXDOMAIN
> exit

So i loged into the server and checked if name servers (BIND) is running. service named status shows it running. I checked if the domain resolve within the server, but it fails.

So checked if domain is added to httpd.conf file

Found the domain in httpd.conf pointing to IP 72.36.203.186 (IP of virtualhost) and the domain entry was not in /etc/named.conf file.

So i added a DNS Zone for this domain name with

root@server1 [/scripts]# ./adddns
Add Dns 1.0 …
Warning, this only adds dns to the local server …
If this server is not the dns master, this will not work
Enter ip? 72.36.203.186
Enter the new domain? theworldslargestbusinessfranchise.com
Setup theworldslargestbusinessfranchise.com OK

root@server1 [/scripts]# service named restart
Stopping named: [ OK ]
Starting named: [ OK ]
root@server1 [/scripts]#

Now the domain start working.

It seems there was some problem with DNS server at the time domain created in WHM, so it won’t get added to DNS server properly.

Comments off

portupgrade - upgrading installed ports

Today i have upgraded software packages installed on my FreeBSD 5.4 server. This is done with utility called portupgrade. To upgrade installed ports, you have to first install portupgrade from ports.

Check if you have portupgrade package already installed

# pkg_info | grep portupgrade
portupgrade-20041226_2 FreeBSD ports/packages administration and management tool s
#

If you don’t get any result, you don’t have portupgrade installed. You need to install it. To install portsupgrade, do the following.

# cd /usr/ports/sysutils/portupgrade
# make install clean
# rehash

Now you have portsupgrade installed on your FreeBSD server,

Next we will upgrade ports database

/usr/local/sbin/portsdb -Uu

Next we will find out which ports need updated, to do this, use the command

# /usr/local/sbin/portversion -l ”

Once we find out the ports that need upgraded, we can upgrade the ports with command

# /usr/local/sbin/portupgrade -arR

Now all ports will get upgraded.

# Run
# /usr/local/sbin/pkgdb -F
# if you are prompted to.

If some thing goes wrong, you can go back with

# Run
# /usr/local/sbin/pkgdb -fu
# if everything goes wrong.

Pray before doing this, so nothing goes wrong :-)

Comments (1)

« Previous entries · Next entries »