Problem In Password Protection Using .Htaccess

Problem in password protection using .htaccess

How to protect CRE Loaded admin area ?

or

Problem when page requires authentication
or

How to set password protection for sub directory without affecting to other .htaccessrewrite rules

Ans :

You will notice that the default .htaccess will not work if your page requires authentication.

Suppose you have set the password protection for admin or any other sub-directory and when you tyr to access the URL http://domain.com/admin then it shows the “401 error .

This problem is occurred due the root .htaccess ( which is under document root) file.

I have trying all sorts of htaccess rewrites in different places but the solution is very simple.

Add this line to the beginning of the .htaccess file in your root .htaccess means “/home/username/publi_html/.htaccess ” file.

ErrorDocument 401 “Unauthorized”

After that when you have access the URL http://domain.com/admin then it ask the login details.

Done

How To Install Red5 On Linux Server

How to install red5 on linux server ?

Ans :

I have used following steps to install the red5 on linux server.

root@server [] cd /etc/init.d/

root@server [] wget http://www.indianwebportal.com/downloads/red5
root@server [] chmod 755 red5

root@server [] yum -y install java-1.6.0-openjdk java-1.6.0-openjdk-devel

root@server [] cd /usr/src
root@server [] rm -rf apache-ant-1.8.0-bin.tar.gz apache-ant-1.8.0 red5-0.8.0.tar.gz

root@server [] wget http://pradeeps.in/apache-ant-1.8.0-bin.tar.gz

root@server [] tar -zxvf apache-ant-1.8.0-bin.tar.gz

root@server [] ls -d /usr/local/ant | mv apache-ant-1.8.0 /usr/local/ant

root@server [] export ANT_HOME=/usr/local/ant
root@server [] export JAVA_HOME=/usr/lib/jvm/java
root@server [] export PATH=$PATH:/usr/local/ant/bin
root@server [] export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib/classes.zip

root@server [] echo export ANT_HOME=/usr/local/ant >> /etc/bashrc
root@server [] echo export JAVA_HOME=/usr/lib/jvm/java >> /etc/bashrc
root@server [] echo export PATH=$PATH:/usr/local/ant/bin >> /etc/bashrc
root@server[]echo export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib/classes.zip >> /etc/bashrc

root@server [] cd /usr/local/src

root@server[]wget http://www.indianwebportal.com/downloads/perl-URI-1.35-3.noarch.rpm

root@server [] rpm -i perl-URI-1.35-3.noarch.rpm

root@server [] yum install subversion

root@server [] svn checkout http://red5.googlecode.com/svn/java/server/trunk/ red5
root@server [] mv red5 /usr/local/
root@server [] cd /usr/local/red5
root@server [] ant prepare
root@server [] ant dist
root@server [] cp -r dist/conf /usr/local/red5/
root@server [] ./red5.sh

root@server [] /etc/init.d/red5 start

You can access red5 by using the following url.

http://your.ip.address:5080

Done

Script To Check NFS Mount Point

How to check NFS mount point by using the script ?

Ans : If you we have mounted the NFS directory one or more servers and you want to monitor that mount point then you can use the following method.
1) Check the mount point directoy name, in the following example the mount directory name is NEWFTPFOLDER

[root@Server]# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/mapper/VolGroup-lv_root
14225776 2419848 11076636 18% /
tmpfs 1960568 0 1960568 0% /dev/shm
/dev/xvda1 487652 70084 391968 16% /boot
/dev/xvdf 206293688 1224268 194583660 1% /home/NEWFTPFOLDER

2) Create one file checkmountpoint.sh and add the following code with replaing the mount folder name and email address and save that file.

[root@Server]# cat /root/checkmountpoint.sh
HOSTNM=`hostname -i`
DATE=$(date +”%d-%b-%y %H:%M”)
SHORTNAME=”FileSystem Mount”
LONGNAME=”Filesystem NEWFTPFOLDER”
#Checking Filesytem Test
df -k | grep NEWFTPFOLDER
if [ $? == “1” ]
then
echo $LONGNAME is not running on $HOSTNM please investigate. Sent by myscript $DATE | mail -s “$SHORTNAME is not accessible”
exit 1
fi

3) Set the cron every 30 minutes to check the mount point
[root@SingaporeExfoFtpServer cron.daily]# crontab -l
*/30 * * * * sh /root/checkmountpoint.sh

After that if the server is rebooted and mount point is not mount then it send the email to your email address.

1 3 4 5 6 7 160