How do I configure Tomcat 8 on Windows to allow access from external IPs?
I'm running Tomcat 8 on an Amazon Web Services EC2 instance. The instance's operating system is Windows Server 2012.
I am trying to use my local PC's browser to connect to Tomcat on that instance. I configured the instance's security rules for inbound traffic to allow all addresses to access both ports 80 and 8080.
I know those rules are working because I ran a simple static web server on both those ports in turn and could access it from my local desktop.
Here is the unedited Tomcat server.xml file with the comments stripped out:
<?xml version="1.0" encoding="UTF-8"?>
<Server port="8005" shutdown="SHUTDOWN">
<Listener className="org.apache.catalina.startup.VersionLoggerListener" />
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
<GlobalNamingResources>
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
pathname="conf/tomcat-users.xml" />
</GlobalNamingResources>
<Service name="Catalina">
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
<Engine name="Catalina" defaultHost="localhost">
<Realm className="org.apache.catalina.realm.LockOutRealm">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
</Realm>
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true">
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log" suffix=".txt"
pattern="%h %l %u %t "%r" %s %b" />
</Host>
</Engine>
</Service>
</Server>
One suggestion I tried was to add address="0.0.0.0" to Connector tag for port 8080
Another suggestion was to add useIPVHosts="true" to Connector tag for port 8080 and/or add resolveHosts="true" to Valve tag
I tried other suggestions as well but they're pretty much a mashup of the ones I've already mentioned.
Can someone please tell me how to configure server.xml to allow Tomcat 8 to accept connections from other than localhost?
networking amazon-web-services amazon-ec2 tomcat
add a comment |
I'm running Tomcat 8 on an Amazon Web Services EC2 instance. The instance's operating system is Windows Server 2012.
I am trying to use my local PC's browser to connect to Tomcat on that instance. I configured the instance's security rules for inbound traffic to allow all addresses to access both ports 80 and 8080.
I know those rules are working because I ran a simple static web server on both those ports in turn and could access it from my local desktop.
Here is the unedited Tomcat server.xml file with the comments stripped out:
<?xml version="1.0" encoding="UTF-8"?>
<Server port="8005" shutdown="SHUTDOWN">
<Listener className="org.apache.catalina.startup.VersionLoggerListener" />
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
<GlobalNamingResources>
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
pathname="conf/tomcat-users.xml" />
</GlobalNamingResources>
<Service name="Catalina">
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
<Engine name="Catalina" defaultHost="localhost">
<Realm className="org.apache.catalina.realm.LockOutRealm">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
</Realm>
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true">
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log" suffix=".txt"
pattern="%h %l %u %t "%r" %s %b" />
</Host>
</Engine>
</Service>
</Server>
One suggestion I tried was to add address="0.0.0.0" to Connector tag for port 8080
Another suggestion was to add useIPVHosts="true" to Connector tag for port 8080 and/or add resolveHosts="true" to Valve tag
I tried other suggestions as well but they're pretty much a mashup of the ones I've already mentioned.
Can someone please tell me how to configure server.xml to allow Tomcat 8 to accept connections from other than localhost?
networking amazon-web-services amazon-ec2 tomcat
1
@bertieb I'm not sure what makes my question opinion based. This is after reading the rules in the help center. I feel I'm asking for help on something specific, could you please point me in the right direction on how I need to modify or narrow my question? Thanks
– vfs23
Jan 14 at 15:23
I voted to reopen from the "primarily opinion-based" state, but please show us these "various suggestions" from which "nothing has worked". I guess you don't want us to repeat these suggestions here; but we possibly will unless you tell us what they are.
– Kamil Maciorowski
Jan 15 at 7:04
could you post the <Connector .... /> section of the server.xml? Because normally by default tomcat should listen on all interfaces on defined port.
– AtomiX84
Jan 15 at 10:16
@Kamil I've edited my question to give more detail
– vfs23
Jan 16 at 20:15
add a comment |
I'm running Tomcat 8 on an Amazon Web Services EC2 instance. The instance's operating system is Windows Server 2012.
I am trying to use my local PC's browser to connect to Tomcat on that instance. I configured the instance's security rules for inbound traffic to allow all addresses to access both ports 80 and 8080.
I know those rules are working because I ran a simple static web server on both those ports in turn and could access it from my local desktop.
Here is the unedited Tomcat server.xml file with the comments stripped out:
<?xml version="1.0" encoding="UTF-8"?>
<Server port="8005" shutdown="SHUTDOWN">
<Listener className="org.apache.catalina.startup.VersionLoggerListener" />
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
<GlobalNamingResources>
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
pathname="conf/tomcat-users.xml" />
</GlobalNamingResources>
<Service name="Catalina">
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
<Engine name="Catalina" defaultHost="localhost">
<Realm className="org.apache.catalina.realm.LockOutRealm">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
</Realm>
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true">
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log" suffix=".txt"
pattern="%h %l %u %t "%r" %s %b" />
</Host>
</Engine>
</Service>
</Server>
One suggestion I tried was to add address="0.0.0.0" to Connector tag for port 8080
Another suggestion was to add useIPVHosts="true" to Connector tag for port 8080 and/or add resolveHosts="true" to Valve tag
I tried other suggestions as well but they're pretty much a mashup of the ones I've already mentioned.
Can someone please tell me how to configure server.xml to allow Tomcat 8 to accept connections from other than localhost?
networking amazon-web-services amazon-ec2 tomcat
I'm running Tomcat 8 on an Amazon Web Services EC2 instance. The instance's operating system is Windows Server 2012.
I am trying to use my local PC's browser to connect to Tomcat on that instance. I configured the instance's security rules for inbound traffic to allow all addresses to access both ports 80 and 8080.
I know those rules are working because I ran a simple static web server on both those ports in turn and could access it from my local desktop.
Here is the unedited Tomcat server.xml file with the comments stripped out:
<?xml version="1.0" encoding="UTF-8"?>
<Server port="8005" shutdown="SHUTDOWN">
<Listener className="org.apache.catalina.startup.VersionLoggerListener" />
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
<GlobalNamingResources>
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
pathname="conf/tomcat-users.xml" />
</GlobalNamingResources>
<Service name="Catalina">
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
<Engine name="Catalina" defaultHost="localhost">
<Realm className="org.apache.catalina.realm.LockOutRealm">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
</Realm>
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true">
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log" suffix=".txt"
pattern="%h %l %u %t "%r" %s %b" />
</Host>
</Engine>
</Service>
</Server>
One suggestion I tried was to add address="0.0.0.0" to Connector tag for port 8080
Another suggestion was to add useIPVHosts="true" to Connector tag for port 8080 and/or add resolveHosts="true" to Valve tag
I tried other suggestions as well but they're pretty much a mashup of the ones I've already mentioned.
Can someone please tell me how to configure server.xml to allow Tomcat 8 to accept connections from other than localhost?
networking amazon-web-services amazon-ec2 tomcat
networking amazon-web-services amazon-ec2 tomcat
edited Jan 15 at 14:55
vfs23
asked Jan 13 at 18:01
vfs23vfs23
11
11
1
@bertieb I'm not sure what makes my question opinion based. This is after reading the rules in the help center. I feel I'm asking for help on something specific, could you please point me in the right direction on how I need to modify or narrow my question? Thanks
– vfs23
Jan 14 at 15:23
I voted to reopen from the "primarily opinion-based" state, but please show us these "various suggestions" from which "nothing has worked". I guess you don't want us to repeat these suggestions here; but we possibly will unless you tell us what they are.
– Kamil Maciorowski
Jan 15 at 7:04
could you post the <Connector .... /> section of the server.xml? Because normally by default tomcat should listen on all interfaces on defined port.
– AtomiX84
Jan 15 at 10:16
@Kamil I've edited my question to give more detail
– vfs23
Jan 16 at 20:15
add a comment |
1
@bertieb I'm not sure what makes my question opinion based. This is after reading the rules in the help center. I feel I'm asking for help on something specific, could you please point me in the right direction on how I need to modify or narrow my question? Thanks
– vfs23
Jan 14 at 15:23
I voted to reopen from the "primarily opinion-based" state, but please show us these "various suggestions" from which "nothing has worked". I guess you don't want us to repeat these suggestions here; but we possibly will unless you tell us what they are.
– Kamil Maciorowski
Jan 15 at 7:04
could you post the <Connector .... /> section of the server.xml? Because normally by default tomcat should listen on all interfaces on defined port.
– AtomiX84
Jan 15 at 10:16
@Kamil I've edited my question to give more detail
– vfs23
Jan 16 at 20:15
1
1
@bertieb I'm not sure what makes my question opinion based. This is after reading the rules in the help center. I feel I'm asking for help on something specific, could you please point me in the right direction on how I need to modify or narrow my question? Thanks
– vfs23
Jan 14 at 15:23
@bertieb I'm not sure what makes my question opinion based. This is after reading the rules in the help center. I feel I'm asking for help on something specific, could you please point me in the right direction on how I need to modify or narrow my question? Thanks
– vfs23
Jan 14 at 15:23
I voted to reopen from the "primarily opinion-based" state, but please show us these "various suggestions" from which "nothing has worked". I guess you don't want us to repeat these suggestions here; but we possibly will unless you tell us what they are.
– Kamil Maciorowski
Jan 15 at 7:04
I voted to reopen from the "primarily opinion-based" state, but please show us these "various suggestions" from which "nothing has worked". I guess you don't want us to repeat these suggestions here; but we possibly will unless you tell us what they are.
– Kamil Maciorowski
Jan 15 at 7:04
could you post the <Connector .... /> section of the server.xml? Because normally by default tomcat should listen on all interfaces on defined port.
– AtomiX84
Jan 15 at 10:16
could you post the <Connector .... /> section of the server.xml? Because normally by default tomcat should listen on all interfaces on defined port.
– AtomiX84
Jan 15 at 10:16
@Kamil I've edited my question to give more detail
– vfs23
Jan 16 at 20:15
@Kamil I've edited my question to give more detail
– vfs23
Jan 16 at 20:15
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1393840%2fhow-do-i-configure-tomcat-8-on-windows-to-allow-access-from-external-ips%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1393840%2fhow-do-i-configure-tomcat-8-on-windows-to-allow-access-from-external-ips%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
@bertieb I'm not sure what makes my question opinion based. This is after reading the rules in the help center. I feel I'm asking for help on something specific, could you please point me in the right direction on how I need to modify or narrow my question? Thanks
– vfs23
Jan 14 at 15:23
I voted to reopen from the "primarily opinion-based" state, but please show us these "various suggestions" from which "nothing has worked". I guess you don't want us to repeat these suggestions here; but we possibly will unless you tell us what they are.
– Kamil Maciorowski
Jan 15 at 7:04
could you post the <Connector .... /> section of the server.xml? Because normally by default tomcat should listen on all interfaces on defined port.
– AtomiX84
Jan 15 at 10:16
@Kamil I've edited my question to give more detail
– vfs23
Jan 16 at 20:15