Reputation: 23
i enabled both non-ssl(8440) connector and ssl(8445) connector in server.xml, when ever i started the server it redirects me to "http://localhost:8445/" but i given this port in ssl connector.
When i am trying to access http://localhost:8440 , it allows me to enter application ( it must redirect to the ssl port as i given redirect port)
every thing working fine , if i removed non-ssl connector.
tomcat version : tomcat 5.0.28 -thanks in advance
My server.xml entries
<Connector port="8440" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8445" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true" />
<Connector SSLEnabled="true" acceptCount="100" clientAuth="false"
connectionTimeout="20000" debug="0" disableUploadTimeout="true"
emptySessionPath="true" enableLookups="false" maxThreads="150"
minSpareThreads="25" name="SSL" port="8445" scheme="https"
secure="true" sslProtocol="TLS"/>
server.xml file
<!-- Test entry for demonstration purposes -->
<Environment name="simpleValue" type="java.lang.Integer" value="30"/>
<!-- Editable user database that can also be used by
UserDatabaseRealm to authenticate users -->
<Resource auth="Container" description="User database that can be updated and saved" name="UserDatabase" type="org.apache.catalina.UserDatabase">
</Resource>
<ResourceParams name="UserDatabase">
<parameter>
<name>factory</name>
<value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
</parameter>
<parameter>
<name>pathname</name>
<value>conf/tomcat-users.xml</value>
</parameter>
</ResourceParams>
<Connector acceptCount="100" connectionTimeout="20000" debug="3" disableUploadTimeout="true" enableLookups="false" maxSpareThreads="75" maxThreads="150" minSpareThreads="25" name="WebServer" port="8440" redirectPort="8445"/>
<Engine debug="0" defaultHost="localhost" name="Catalina">
<Realm allRolesMode="strictAuthOnly" appName="myapp" className="com.authentication.CustomJAASRealm" roleClassNames="com.authentication.RolePrincipal" userClassNames="com.authentication.UserPrincipal">
</Realm>
<Host appBase="webapps" autoDeploy="false" debug="0" name="localhost" unpackWARs="true" xmlNamespaceAware="false" xmlValidation="false">
<Valve className="org.apache.catalina.authenticator.SingleSignOn" debug="0"/>
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" pattern="%u %U %S "%{Referer}i" %a %A %m %t %D %b %s "%{User-Agent}i"" prefix="access_log." resolveHosts="false" rotatable="false" suffix="txt"/>
<Logger className="org.apache.catalina.logger.FileLogger" directory="logs" prefix="localhost_log." suffix=".txt" timestamp="true"/>
<Context debug="0" docBase="${home}/webapps" path=""/>
<Context appBase="webapps" debug="0" docBase="${home}/help/" path="/help" reloadable="true"/>
</Host>
</Engine>
Upvotes: 0
Views: 1726
Reputation: 1113
Please always read the documentation that help you to learn. You can check it HERE.
Go to your $TOMCAT_HOME/conf/server.xml and change redirect port:
<Connector port="8080"
enableLookups="false"
redirectPort="8440" />
<Connector port="8440" protocol="HTTP/
enableLookups="false"
redirectPort="8445" />
Cheers!!
Upvotes: 1