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 .htaccess rewrite 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

Using wget to download FTP folders

If you want to copy all of the files and folders from one host to another by using the ftp account.

Then use the following command to download the files/folders on remote server by using wget. Use this command on destination server.

wget -r ftp://username:password@ip.of.old.host

Some on the hosting provider disabled the main ftp account for the ftp access and provide the new ftp account in the  format admin@domain.com then you need to use the following command to access the ftp account by using wget.

wget -r –ftp-user=”admin@domain.com” –ftp-password=aq1sw2de3  ftp://ip.of.old.host/*

Note: Replace the “admin@domain.com” equal to original ftp user name and also replace “aq1sw2de3″ with the original password.

how to update the awstat in plesk

How to update the awstat on plesk manually/automatically ?

Ans:

You can easily update the awstat for the particular domain  by using following command.

/usr/local/psa/admin/sbin/statistics –calculate-one –domain-name=domain.com

Note: Replace the domain.com equal to original domain name.

If you want to update the awstat for all the domains which is hosted on the serve then use the following command. You can also set the monthly cronjob ( /etc/cron.monthly) on the server by using same command.

/usr/local/psa/admin/sbin/statistics

javax.naming.NameNotFoundException

Error: javax.naming.NameNotFoundException: Name jdbc is not bound in this Context

Solution :

When I have access  site in browser then catalina.out logs show the above error and the database is not connected , I have tried all of the possibilities but  this issue is sorted  with following solution.

I have moved the mysql-connector-java-*.jar file from my own lib directory to tomcat/common/endorsed/ directory.

For example :

mv  /home/username/public_html/WEB-INF/lib/mysql-connector-java-5.1.7-bin.jar  /usr/local/jakarta/tomcat/common/endorsed/

and restart the tomcat service on the server and the issue has been solved and I am able to access site without any problem.

Done

September 2010
M T W T F S S
« Aug    
 12345
6789101112
13141516171819
20212223242526
27282930