jueves, 1 de marzo de 2012

Enabling Remote Access on Apache Tomcat

By default, remote access on your Apache Tomcat is disabled. This means, you can only access your page using the localhost hostname.
http://localhost:8080 will work.
http://192.168.1.9:8080 will not work. [Assuming 192.168.1.9 is your IP address]

For this to work, go to the conf folder of your tomcat6. Since I am using Ubuntu, it is located in /var/lib/tomcat6/conf.

Inside the folder, there is a server.xml file. Find the line that says:

<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="localhost_access_log." suffix=".txt"
               pattern="common" resolveHosts="false"/>
 
As we can see, resolveHosts is set to false. We change this to true to allow incoming requests to be granted.
 
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="localhost_access_log." suffix=".txt"
               pattern="common" resolveHosts="true"/>
 
After changing the file, save it and restart the server.

 

No hay comentarios:

Publicar un comentario