Category: Linux

Technical Information Pertaining to Linux

Frame Forwarding using Javascript.

That is when you hit abcd.com it will forward to yahoo.com but the URL in address bar will not change. For this put the below content in index.html of the domain abcd.com

 

<html>

<head>

<title>abcd.com</title>

<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″>

</head>

<script language=”JavaScript”>

document.write(“<frameset rows=* frameborder=NO border=0 framespacing=0 cols=*>”);

document.write(“<frame name=main src=http://www.yahoo.com”+document.location.search+”>”);

document.write(“</frameset>”);

document.write(“<noframes>”);

document.write(“< body bgcolor=#FFFFFF text=#000000>”);

document.write(“</body></noframes>”);

</script>

</html>

Installing PHP5 along with working php4 on FreeBSD server

Below are the steps to install php5 on a FreeBSD server. We are going to install php 5.1.2 current satble php5 version.

# cd /usr/local/src

# wget http://us2.php.net/get/php-5.1.2.tar.bz2/from/this/mirror (or any other mirror)

# tar -jxvf php-5.1.2.tar.bz2

# cd php-5.1.2/

#5 ) PHP=’/usr/bin/php’ ( result of which php )

# CFG=`$PHP -i | grep configure | sed “s/’//g” | sed “s/–prefix=\/usr//g” | sed “s/’//g” | sed “s/\.\/configure \(.*\)–with-apxs.*apxs \(.*\)/\1 \2/” | sed “s/<tr><td class=\”e\”>Configure Command <\/td><td class=\”v\”>//g” | sed “s/<\/td><\/tr>//g”`

# CFGLINE=”${CFG##* => } –prefix=/usr/local/php5 –exec-prefix=/usr/local/php5 –enable-force-cgi-redirect –enable-discard-path”

# ./configure $CFGLINE

# make

# make install

# cp /usr/local/php5/bin/php /usr/local/cpanel/cgi-sys/php5

# chown root:wheel /usr/local/cpanel/cgi-sys/php5

# cp -f php.ini-recommended /usr/local/php5/lib/php.ini

# Edit /usr/local/apache/conf/httpd.conf to add the below enteries

Action application/x-httpd-php5 “/cgi-sys/php5″

AddType application/x-httpd-php5 .php5

Restart the httpd service.

Now for using php 5 you need to either have the scripts with extension .php5 or need to have the below entry in your .htaccess file

AddHandler application/x-httpd-php5 .php

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

 

 

Installing PHP5 along with working php4 on Redhat server

Below are the steps to install php5 on a redhat server. We are going to install php 5.1.2 current satble php5 version.

# cd /usr/local/src

# wget http://us2.php.net/get/php-5.1.2.tar.bz2/from/this/mirror (or any other mirror)

# tar -jxvf php-5.1.2.tar.bz2

# cd php-5.1.2/

# PHP=’/usr/local/bin/php’ ( result of which php )

# CFG=`$PHP -i | grep configure | sed “s/–prefix=\/usr\/local//g” | sed “s/’//g” | sed “s/\.\/configure \(.*\)–with-apxs.*apxs \(.*\)/\1 \2/”`

 # CFGLINE=”${CFG##* => } –prefix=/usr/local/php5 –exec-prefix=/usr/local/php5 –enable-force-cgi-redirect –enable-discard-path”

# ./configure $CFGLINE

# make

# make install

# cp /usr/local/php5/bin/php /usr/local/cpanel/cgi-sys/php5

# chown root:wheel /usr/local/cpanel/cgi-sys/php5

# cp -f php.ini-recommended /usr/local/php5/lib/php.ini

Edit /usr/local/apache/conf/httpd.conf to add the below enteries

Action application/x-httpd-php5 “/cgi-sys/php5″

AddType application/x-httpd-php5 .php5

# /etc/init.d/httpd restart

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

Getting blank page on taking cpanel.

There are many issues associated with this. Steps to resolve the issue is

1 ) Check the cpanel error log to check what error comes up when taking a cpanel

2 ) If you get the below error

error: Unable to locate httpd.conf at /usr/local/cpanel/Cpanel/HttpUtils.pm line 64.

Then the solution is as below.

# chmod 755 /usr/local/apache/conf

Also check the permission of the httpd.conf file, it should ideally have the permission below

-rw——- 1 root wheel 400675 Apr 13 08:12 /usr/local/apache/conf/httpd.conf

Hope this helps you resolve the issue.