Ad Ad Ad Ad

Disable/Enable safe_mode/register_globals value

You can disable/enable safe_mode either using .htaccess, php.ini or httpd.conf file. Selecting the right way depends on your php-apache configuration.
If php is compiled as a dso module for apache, you will have to use .htaccess method
If php-apache relationship is CGI, then php.ini file is used to disable safe_mode value
 If none …

Collecting User IP!

A sample BASH CGI script for collecting IPs of your colleagues in your network.
Prerequisites
1) apache/cgi configuration
2) a Mysql installation
Then create script “getip.sh” under “/var/www/cgi-bin/”  ( set location of cgi-bin directory  as per the apache configuration)
#!/bin/bash #Getting IP address CGI-BASH-script#Jadu Saikia http://unstableme.blogspot.com/ #MySQL settings
# MHOME=  ( location of mysql …

Installing Tomcat

  
Required packages
Apache
OpenSSL
j2sdk
jakarta-tomcat
jakarta-ant
jakarta-tomcat-connectors(mod_jk)
 
Configure Environment Variables
 
Edit and add the lines below to “/etc/profile”
 
JAVA_HOME=/usr/local/java/java
CATALINA_HOME=/usr/local/tomcat
PATH=$JAVA_HOME/bin:$PATH:$HOME/bin:/sbin:/usr/sbin
CLASSPATH=$CATALINA_HOME/bin/bootstrap.jar:$JAVA_HOME/lib/tools.jar:$CATALINA_HOME/common/lib/servlet.jar:/usr/local/pgsql/share/java/postgresql.jar:../lib/struts.jar:.
 
Now add the PATH JAVA_HOME CATALINA_HOME & CLASSPATH if any aren’t in the export line
 
export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC JAVA_HOME CATALINA_HOME CLASSPATH
 
Install Java
 
mkdir /usr/local/java
cd /usr/local/java
sh jdk-1_5_0_04-linux-i586.bin
 
The jdk directory is then extracted
 
mv jdk-1_5_0_04 /usr/local/java
ln -s jdk-1_5_0_04 java
 
Now the …

MySql Replication

Mysql Replication is used to get a mirror copy of master server to slave. All changes made in server is updated on slave. This can be achieved by the following steps. one thing to be notify is the master and salvemay contain the same version of mysql.
  changes in master …

APC mem Cache installation

   APC MM cache is an most commonly used php accelerators 

Please follow the steps to install APC mem Cache

1. cd /usr/local/src
2. wget http://pecl.php.net/get/APC-3.0.14.tgz
3. tar -xzvf APC-3.0.14.tgz
4. cd APC-3.0.14

 
 checking  the location of phpize and php-config paths

finding the  Phpize binary location

whereis phpize

output looks like:

phpize: /usr/bin/phpize /usr/local/bin/phpize

whereis php-config

output looks like:

php-config: /usr/bin/php-config /usr/local/bin/php-config

5. execute the command …

FFmpeg Installation

 1. Create a directory to do our work 

mkdir ~/ffmpeg
cd ~/ffmpeg

2. Get all the source files

wget http://www3.mplayerhq.hu/MPlayer/releases/codecs/essential-20061022.tar.bz2
wget http://rubyforge.org/frs/download.php/9225/flvtool2_1.0.5_rc6.tgz
wget http://easynews.dl.sourceforge.net/sourceforge/lame/lame-3.97.tar.gz
wget http://superb-west.dl.sourceforge.net/sourceforge/ffmpeg-php/ffmpeg-php-0.5.0.tbz2
wget http://downloads.xiph.org/releases/ogg/libogg-1.1.3.tar.gz
wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.1.2.tar.gz

3. Extract all the source files

bunzip2 essential-20061022.tar.bz2; tar xvf essential-20061022.tar
tar zxvf flvtool2_1.0.5_rc6.tgz
tar zxvf lame-3.97.tar.gz
bunzip2 ffmpeg-php-0.5.0.tbz2; tar xvf ffmpeg-php-0.5.0.tar
tar zxvf libogg-1.1.3.tar.gz
tar zxvf libvorbis-1.1.2.tar.gz

4. Create the codecs directory & import them

mkdir /usr/local/lib/codecs/
mv …

Apache SSL certificate Creation

Hi.. Guys
Please follow the steps to install SSL certificate on Apache
# cd /usr/local/apache
# mkdir cert
# cd cert
1. Generate your own Certificate Authority (CA)
# openssl genrsa -out ca.key 4096
# openssl req -new -x509 -days 365 -key ca.key -out ca.crt
2.Generate a server key and request for signing (csr)
# openssl genrsa -out server.key …

Autoresponder Plugin in Squirrelmail

1.Download the compatibility plugin and Local Auto Responder plugin from http://squirrelmail.org
2.Extract it to the Squirrelmail – plugins directory
cd /var/www/html/squirrelmail/plugins
# tar xzf compatibility-2.0.9-1.0.tar.gz
# cd compatibility
3.Patch it to your squirrelmail version
# patch -p0 < patches/compatibility_patch-1.4.11.diff
patching file ../../functions/strings.php
4.Configure the Squirrelmail to include the plugin
# cd ../../config
# ./conf.pl
5.Extract Local Auto Responder Plugin
# cd ../plugins/
# …

How to disable directory browsing in Apache

One of the “must do’s” on setting a secure apache webserver environment is to disable directory browsing. As a default Apache will be compiled with this option enabled, but its always a good idea to get rid of this setting unless its really necessary.
If you are on an RPM installation …