Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

This is my current server.xml file. I would like to access my application using http://www.myapp.subdomain.com without port number 8080. But in the below changes nothing is loaded when i try using this URL : http://www.myapp.subdomain.com.

<?xml version='1.0' encoding='utf-8'?>   
<Server port="8005" shutdown="SHUTDOWN">   
  <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />   
  <Listener className="org.apache.catalina.core.JasperListener" />   
  <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />   
  <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />   
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />   
  <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="80" protocol="HTTP/1.1"    
               connectionTimeout="20000"    
               redirectPort="8443" />   
    <Engine name="Catalina" defaultHost="localhost">   
      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"  
             resourceName="UserDatabase"/>   
    <Host name="www.mydomain.subdomain.com" appBase="webapps/myapps"  
          unpackWARs="true" autoDeploy="true"  
          xmlValidation="false" xmlNamespaceAware="false">   
         <Context path="" docBase="."/>   
            <Alias>.mydomain.subdomain.com</Alias>   
        </Host>   

    </Engine>   
  </Service>   
</Server>  

Could you please help on this?.

Kind Regards S.Saravanan

share|improve this question

2 Answers 2

You need to find the following part of server.xml file and change it to look like:

<Connector port="80" protocol="HTTP/1.1"
           connectionTimeout="20000"
           URIEncoding="UTF-8"
           redirectPort="8443" />

Then, you should restart your tomcat.

share|improve this answer

If you don't want to run tomcat as root, you can translate the port with iptables like:

/sbin/iptables -t nat -I PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080
/sbin/iptables-save
/sbin/chkconfig iptables on
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.