[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

.htaccess question

Posted on 2002-07-11
8
Medium Priority
?
323 Views
Last Modified: 2010-04-01
Hi

I am developing a site using jsp/java/tomcat and oracle.  I understand if I put the .htaccess file in the root of my webserver this should password protect my web pages.  

Is that it? Do I need to add any code? If so can someone give me an example.

Thanks
0
Comment
Question by:jhazard
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 2
8 Comments
 
LVL 19

Expert Comment

by:cheekycj
ID: 7146486
0
 
LVL 19

Expert Comment

by:cheekycj
ID: 7146501
You have an interesting problem here and I can think of a few SIMPLE ways to go about it.

the basics here are counters.  You want to see if the page has been loaded more than once.

The first thing to do is when the page is loaded (for the first time) check for an existing counter.. if it exists increment it and if it doesn't exist set it 1.

If counter > 1 then redirect to login page.

The different approaches that I mentioned are in the ways of storing the counter.

1. cookies (page specific of course)
2. url params
3. session var (page specific of course)

Does that work for what you want?

CJ
0
 
LVL 19

Expert Comment

by:cheekycj
ID: 7146507
sorry the second comment was posted in the wrong question... I am losing it :-)

CJ
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:jhazard
ID: 7146566
Thank you for that but I'm still not clear on what else it is I need to do aside from adding the .htaccess file to my webserver.  What code do I need to add?
0
 
LVL 19

Expert Comment

by:cheekycj
ID: 7146597
once you create .htaccess in the directory that you want to protect.  Then you must create the htpasswd file.

the htpasswd file is created by typing:
htpasswd -c .htpasswd username

at the command prompt in the directory that you want protected.

Now after you type the command you will be asked to enter the password.

repeat the command for each user.

That should be it.

CJ
0
 

Author Comment

by:jhazard
ID: 7146613
I'm assuming I should have to set environment variables in Java.  How do I do that (excuse me but I have limited experience with Java).
0
 
LVL 19

Accepted Solution

by:
cheekycj earned 200 total points
ID: 7146628
no this has nothing to do with Java.  This is a security constraint outside of the realm of Java but more of an *nix and I think Apache too enforced implementation.

CJ
0
 
LVL 19

Expert Comment

by:cheekycj
ID: 7149213
Glad I could help and Thanx for the "A".

CJ
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As much as Microsoft wants to kill off PST file support, just as they tried to do with public folders, there are still times when it is useful or downright necessary to export Exchange mailboxes to PST files. Thankfully, it is still possible to e…
If something goes wrong with Exchange, your IT resources are in trouble.All Exchange server migration processes are not designed to be identical and though migrating email from on-premises Exchange mailbox to Cloud’s Office 365 is relatively simple…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question