October 14, 2008, 17:34:32
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
: Add your links to our directory. Click
here
to add your links.
Home
Forum
Help
Search
Directory
Calendar
Login
Register
News
Add your links to our directory. Click
here
to add your links.
IT Resources
Recover Deleted Files
Php Hosting
Hot Wallpapers
Free Articles
Mousepad
Cheap Hosting
PDF to Doc Converter
Internet Eraser
Linux web hosting
DoFollow Sites
Movie Reviews
Webmaster's Talks !
>
Forum
>
Programming
>
Java
>
setting a Basic authentication on a Tomcat
Pages: [
1
]
« previous
next »
Print
Author
Topic:
setting a Basic authentication on a Tomcat
(Read 1649 times)
0 Members and 1 Guest are viewing this topic.
bostam
Jr. Member
Points: 1
Offline
Posts: 55
setting a Basic authentication on a Tomcat
«
on:
August 20, 2006, 11:31:00 »
Hi,
Is anoyone set an auth over a Tomcat ? I just trying to do that and I cannot find aby solution.
Thank you very much !
Logged
TheGodFather
Administrator
Hero Member
Points: 202
Offline
Posts: 2570
Re: setting a Basic authentication on a Tomcat
«
Reply #1 on:
August 20, 2006, 14:18:01 »
That depends by what connector you are using. It can be done in several ways. Tell us if you are using a connector and I will try to tell you how to set up the basic auth
Regards
Logged
█
Deleted Domains
█
Hostmaster Web Tools
█
Webmaster Web Tools
bostam
Jr. Member
Points: 1
Offline
Posts: 55
Re: setting a Basic authentication on a Tomcat
«
Reply #2 on:
August 23, 2006, 23:58:02 »
I use Proxy connector through apache and mod_jk2 for other site. I found some info but not clear enough ...
Thanks
Logged
TheGodFather
Administrator
Hero Member
Points: 202
Offline
Posts: 2570
Re: setting a Basic authentication on a Tomcat
«
Reply #3 on:
August 25, 2006, 18:15:19 »
For Tomcat Basic Uath System you need to do 2 steps:
Insert in the <Engine...></Engine> tag of your server configuration this tag:
<Realm className="org.apache.catalina.realm.MemoryRealm">
</Realm>
Edit (or create) the conf/tomcat-users.xml file where you will place the name of all the users you wanna give access to. A conf is like this:
<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<role rolename="test"/>
<user username="user" password="pass" roles="test"/>
</tomcat-users>
Second simply adding to your web application descriptor (web.xml) some imformation like, for example:
<security-constraint>
<web-resource-collection>
<web-resource-name>
My Protected WebSite
</web-resource-name>
<url-pattern> /* </url-pattern>
<http-method> GET </http-method>
<http-method> POST </http-method>
</web-resource-collection>
<auth-constraint>
<!-- the same like in your tomcat-users.conf file -->
<role-name> test </role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method> BASIC </auth-method>
<realm-name> Basic Authentication </realm-name>
</login-config>
<security-role>
<description> Test role </description>
<role-name> test </role-name>
</security-role>
Anyway if you use proxy system you can doit from apache in this way:
<Proxy>
Options ExecCGI
AllowOverride AuthConfig
Order Allow,Deny
Allow From All
AuthName "sms-Gw Access"
AuthType Basic
AuthUserFile /var/www/etc/htpasswd
require valid-user
</Proxy>
This second method is not suitable for mod_jk2
I hope this helps !
Regards
Logged
█
Deleted Domains
█
Hostmaster Web Tools
█
Webmaster Web Tools
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Web Design and Graphics
-----------------------------
=> General
=> Web Design Discussion
===> Adobe Photoshop, Corel PhotoPaint or other Image editing software
===> Dreamweaver, FrontPage or other WYSIWYG software
=> Web Design Reviews
=> Design Contest
-----------------------------
Programming
-----------------------------
=> Databases
=> PHP
=> ASP
=> Javascript
=> Java
=> General Coding
===> Perl
===> .NET
-----------------------------
Search Engine
-----------------------------
=> Google
=> Yahoo
=> MSN
=> Other Search Engines
=> Web Directories
===> SMF Directory
-----------------------------
Domain Names
-----------------------------
=> Domain Name Discussion
=> Domain Appraisals
=> Expired Domains
-----------------------------
Server Related
-----------------------------
=> Forum/CMS Related
=> Apache/IIS
=> Security
=> Linux
===> General Questions
===> Installations
===> Desktop & Multimedia
===> System configurations problems
===> Kernel things
-----------------------------
The Webmasters Talks !
-----------------------------
=> General Discussion
===> Fun
=> Tools
===> Link Popularity
===> Google Datacenter Query
===> Google Backlinks Checker
===> Google Page Rank Checker
===> Html Validation
===> Alexa Rank Checker
===> SEO 4 SMF
=====> Showcase
=====> Joomla
=====> Bugs
=====> Features
=> New Member Introductions
=> Suggestions & Feedback
=> News and Announcements
Loading...