You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Martin Stafford <ma...@spike.com.au> on 2001/10/09 12:52:14 UTC
Apache authentication with WebApp connector
I'm trying to get configure a apache/tomcat server to use apache's
authentication for a tomcat web application. The webapp connector however
seems to bypass the tomcat authentication configuration.
The reason I'm trying to do this is that I would like to authenticate a
staging server so that only the customer can access it. I don't want to
modify the web.xml between stage and live as that would make publishing more
complex and using apache's authentication would let me do this.
If I remove the WebAppDeploy from the config below the authentication works
ok. It also doesn't matter which apache authentication module I use - still
happens.
Configuration:
Redhat 7.1
Tomcat 4
Apache 1.3.20
Sun JDK 1.3.1
Config File Extracts:
httpd.conf:
LoadModule pam_auth_module modules/mod_auth_pam.so
LoadModule webapp_module modules/mod_webapp.so
AddModule mod_auth_pam.c
AddModule mod_webapp.c
WebAppConnection stage.info info
WebAppConnection stage.company warp localhost:8050
NameVirtualHost 203.x.x.x
<VirtualHost 203.x.x.x>
ServerName www-stage.company.com
DocumentRoot '/u01/stage/company/webapps/www-stage.company.com/root'
CustomLog '/u01/stage/company/logs/kms.apache.log' common
<Directory />
AuthName "username/password"
AuthType Basic
Require group groupname
</Directory>
WebAppDeploy stage.company.www-stage stage.company /
WebAppDeploy stage.company.www-stage.manager stage.company /manager
</VirtualHost>
server.xml:
<Server port="8000" shutdown="SHUTDOWN" debug="0">
<Service name="stage.company.server">
<Connector className="org.apache.catalina.connector.warp.WarpConnector"
port="8050" minProcessors="5" maxProcessors="75" enableLookups="true"
acceptCount="10" debug="0"/>
<Connector className="org.apache.catalina.connector.http.HttpConnector"
port="8100" minProcessors="5" maxProcessors="75" acceptCount="10" debug="0"
connectionTimeout="60000"/>
<Engine className="org.apache.catalina.connector.warp.WarpEngine"
name="stage.company.engine" debug="0" defaultHost="www-stage.company.com">
<DefaultContext reloadable="true">
<Parameter name="serverType" value="stage" />
</DefaultContext>
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="catalina." suffix=".log" timestamp="true"/>
<Realm className="org.apache.catalina.realm.MemoryRealm"/>
<Host name="www-stage.company.com"
appBase="webapps/www-stage.company.com/root">
<Logger className="org.apache.catalina.logger.FileLogger"
directory="logs" prefix="www-stage.tomcat." suffix=".log" timestamp="true"/>
<Context docBase="" path=""/>
<Context docBase="/usr/tomcat4/webapps/manager" path="/manager"/>
</Host>
</Engine>
</Service>
</Server>
Thanks,
Martin Stafford